Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/24/2012 09:28:14 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Statistics:

  • Add widget and shortcode for forum statistics.
  • Props MZAWeb.
  • Fixes #2052.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/default/extras/page-forum-statistics.php

    r4497 r4510  
    77 * @subpackage Theme
    88 */
    9 
    10 // Get the statistics and extract them for later use in this template
    11 $stats = bbp_get_statistics();
    129
    1310get_header(); ?>
     
    2724                                <div id="bbpress-forums">
    2825
    29                                         <dl role="main">
    30 
    31                                                 <?php do_action( 'bbp_before_statistics' ); ?>
    32 
    33                                                 <dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
    34                                                 <dd>
    35                                                         <strong><?php echo $stats['user_count']; ?></strong>
    36                                                 </dd>
    37 
    38                                                 <dt><?php _e( 'Forums', 'bbpress' ); ?></dt>
    39                                                 <dd>
    40                                                         <strong><?php echo $stats['forum_count']; ?></strong>
    41                                                 </dd>
    42 
    43                                                 <dt><?php _e( 'Topics', 'bbpress' ); ?></dt>
    44                                                 <dd>
    45                                                         <strong><?php echo $stats['topic_count']; ?></strong>
    46                                                 </dd>
    47 
    48                                                 <dt><?php _e( 'Replies', 'bbpress' ); ?></dt>
    49                                                 <dd>
    50                                                         <strong><?php echo $stats['reply_count']; ?></strong>
    51                                                 </dd>
    52 
    53                                                 <dt><?php _e( 'Topic Tags', 'bbpress' ); ?></dt>
    54                                                 <dd>
    55                                                         <strong><?php echo $stats['topic_tag_count']; ?></strong>
    56                                                 </dd>
    57 
    58                                                 <?php if ( !empty( $stats['empty_topic_tag_count'] ) ) : ?>
    59 
    60                                                         <dt><?php _e( 'Empty Topic Tags', 'bbpress' ); ?></dt>
    61                                                         <dd>
    62                                                                 <strong><?php echo $stats['empty_topic_tag_count']; ?></strong>
    63                                                         </dd>
    64 
    65                                                 <?php endif; ?>
    66 
    67                                                 <?php if ( !empty( $stats['topic_count_hidden'] ) ) : ?>
    68 
    69                                                         <dt><?php _e( 'Hidden Topics', 'bbpress' ); ?></dt>
    70                                                         <dd>
    71                                                                 <strong>
    72                                                                         <abbr title="<?php echo esc_attr( $stats['hidden_topic_title'] ); ?>"><?php echo $stats['topic_count_hidden']; ?></abbr>
    73                                                                 </strong>
    74                                                         </dd>
    75 
    76                                                 <?php endif; ?>
    77 
    78                                                 <?php if ( !empty( $stats['reply_count_hidden'] ) ) : ?>
    79 
    80                                                         <dt><?php _e( 'Hidden Replies', 'bbpress' ); ?></dt>
    81                                                         <dd>
    82                                                                 <strong>
    83                                                                         <abbr title="<?php echo esc_attr( $stats['hidden_reply_title'] ); ?>"><?php echo $stats['reply_count_hidden']; ?></abbr>
    84                                                                 </strong>
    85                                                         </dd>
    86 
    87                                                 <?php endif; ?>
    88 
    89                                                 <?php do_action( 'bbp_after_statistics' ); ?>
    90 
    91                                         </dl>
     26                                        <?php bbp_get_template_part( 'content', 'statistics' ); ?>
    9227
    9328                                        <?php do_action( 'bbp_before_popular_topics' ); ?>
     
    11954        <?php do_action( 'bbp_after_main_content' ); ?>
    12055
    121 <?php unset( $stats ); ?>
    122 
    12356<?php get_sidebar(); ?>
    12457
Note: See TracChangeset for help on using the changeset viewer.