web/wp-content/plugins/bbpress/templates/default/extras/page-forum-statistics.php
changeset 196 5e8dcbe22c24
equal deleted inserted replaced
195:c7c0fbc09788 196:5e8dcbe22c24
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * Template Name: bbPress - Statistics
       
     5  *
       
     6  * @package bbPress
       
     7  * @subpackage Theme
       
     8  */
       
     9 
       
    10 // Get the statistics and extract them for later use in this template
       
    11 // @todo - remove variable references
       
    12 extract( bbp_get_statistics(), EXTR_SKIP );
       
    13 
       
    14 get_header(); ?>
       
    15 
       
    16 	<?php do_action( 'bbp_before_main_content' ); ?>
       
    17 
       
    18 	<?php do_action( 'bbp_template_notices' ); ?>
       
    19 
       
    20 	<?php while ( have_posts() ) : the_post(); ?>
       
    21 
       
    22 		<div id="bbp-statistics" class="bbp-statistics">
       
    23 			<h1 class="entry-title"><?php the_title(); ?></h1>
       
    24 			<div class="entry-content">
       
    25 
       
    26 				<?php get_the_content() ? the_content() : _e( '<p>Here are the statistics and popular topics of our forums.</p>', 'bbpress' ); ?>
       
    27 
       
    28 				<div id="bbpress-forums">
       
    29 
       
    30 					<dl role="main">
       
    31 
       
    32 						<?php do_action( 'bbp_before_statistics' ); ?>
       
    33 
       
    34 						<dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
       
    35 						<dd>
       
    36 							<strong><?php echo $user_count; ?></strong>
       
    37 						</dd>
       
    38 
       
    39 						<dt><?php _e( 'Forums', 'bbpress' ); ?></dt>
       
    40 						<dd>
       
    41 							<strong><?php echo $forum_count; ?></strong>
       
    42 						</dd>
       
    43 
       
    44 						<dt><?php _e( 'Topics', 'bbpress' ); ?></dt>
       
    45 						<dd>
       
    46 							<strong><?php echo $topic_count; ?></strong>
       
    47 						</dd>
       
    48 
       
    49 						<dt><?php _e( 'Replies', 'bbpress' ); ?></dt>
       
    50 						<dd>
       
    51 							<strong><?php echo $reply_count; ?></strong>
       
    52 						</dd>
       
    53 
       
    54 						<dt><?php _e( 'Topic Tags', 'bbpress' ); ?></dt>
       
    55 						<dd>
       
    56 							<strong><?php echo $topic_tag_count; ?></strong>
       
    57 						</dd>
       
    58 
       
    59 						<?php if ( !empty( $empty_topic_tag_count ) ) : ?>
       
    60 
       
    61 							<dt><?php _e( 'Empty Topic Tags', 'bbpress' ); ?></dt>
       
    62 							<dd>
       
    63 								<strong><?php echo $empty_topic_tag_count; ?></strong>
       
    64 							</dd>
       
    65 
       
    66 						<?php endif; ?>
       
    67 
       
    68 						<?php if ( !empty( $topic_count_hidden ) ) : ?>
       
    69 
       
    70 							<dt><?php _e( 'Hidden Topics', 'bbpress' ); ?></dt>
       
    71 							<dd>
       
    72 								<strong>
       
    73 									<abbr title="<?php echo esc_attr( $hidden_topic_title ); ?>"><?php echo $topic_count_hidden; ?></abbr>
       
    74 								</strong>
       
    75 							</dd>
       
    76 
       
    77 						<?php endif; ?>
       
    78 
       
    79 						<?php if ( !empty( $reply_count_hidden ) ) : ?>
       
    80 
       
    81 							<dt><?php _e( 'Hidden Replies', 'bbpress' ); ?></dt>
       
    82 							<dd>
       
    83 								<strong>
       
    84 									<abbr title="<?php echo esc_attr( $hidden_reply_title ); ?>"><?php echo $reply_count_hidden; ?></abbr>
       
    85 								</strong>
       
    86 							</dd>
       
    87 
       
    88 						<?php endif; ?>
       
    89 
       
    90 						<?php do_action( 'bbp_after_statistics' ); ?>
       
    91 
       
    92 					</dl>
       
    93 
       
    94 					<?php do_action( 'bbp_before_popular_topics' ); ?>
       
    95 
       
    96 					<?php bbp_set_query_name( 'bbp_popular_topics' ); ?>
       
    97 
       
    98 					<?php if ( bbp_has_topics( array( 'meta_key' => '_bbp_reply_count', 'posts_per_page' => 15, 'max_num_pages' => 1, 'orderby' => 'meta_value_num', 'show_stickies' => false ) ) ) : ?>
       
    99 
       
   100 						<h2 class="entry-title"><?php _e( 'Popular Topics', 'bbpress' ); ?></h2>
       
   101 
       
   102 						<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
       
   103 
       
   104 						<?php bbp_get_template_part( 'loop',       'topics' ); ?>
       
   105 
       
   106 						<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
       
   107 
       
   108 					<?php endif; ?>
       
   109 
       
   110 					<?php bbp_reset_query_name(); ?>
       
   111 
       
   112 					<?php do_action( 'bbp_after_popular_topics' ); ?>
       
   113 
       
   114 				</div>
       
   115 			</div>
       
   116 		</div><!-- #bbp-statistics -->
       
   117 
       
   118 	<?php endwhile; ?>
       
   119 
       
   120 	<?php do_action( 'bbp_after_main_content' ); ?>
       
   121 
       
   122 <?php get_sidebar(); ?>
       
   123 <?php get_footer(); ?>