Changeset 2802
- Timestamp:
- 01/13/2011 11:47:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/index.php
r2535 r2802 1 1 <?php 2 3 // Get started 2 4 require_once('admin.php'); 3 5 require_once( BB_PATH . BB_INC . 'functions.bb-statistics.php' ); 4 6 5 $rn_forums = get_total_forums(); 6 $rn_forums = sprintf(__ngettext('<span>%d</span> forum', '<span>%d</span> forums', $rn_forums), number_format( $rn_forums ) ); 7 // Get counts and format numbers 8 $rn_forums = number_format( get_total_forums() ); 9 $rn_forums = sprintf(__ngettext('<span>%s</span> forum', '<span>%s</span> forums', $rn_forums), $rn_forums ); 7 10 8 $rn_topics = get_total_topics();9 $rn_topics = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics), number_format( $rn_topics ));11 $rn_topics = number_format( get_total_topics() ); 12 $rn_topics = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics), $rn_topics ); 10 13 11 $rn_posts = get_total_posts();12 $rn_posts = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts), number_format( $rn_posts ));14 $rn_posts = number_format( get_total_posts() ); 15 $rn_posts = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts), $rn_posts ); 13 16 14 $rn_users = bb_get_total_users();15 $rn_users = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users), number_format( $rn_users ));17 $rn_users = number_format( bb_get_total_users() ); 18 $rn_users = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users), $rn_users ); 16 19 17 $rn_topic_tags = bb_get_total_topic_tags();18 $rn_topic_tags = sprintf(__ngettext('<span>%d</span> tag', '<span>%d</span> tags', $rn_topic_tags), number_format( $rn_topic_tags ));20 $rn_topic_tags = number_format( bb_get_total_topic_tags() ); 21 $rn_topic_tags = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags), $rn_topic_tags ); 19 22 20 $rn_topics_average = get_topics_per_day();21 $rn_topics_average = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics_average), number_format( $rn_topics_average ));23 $rn_topics_average = number_format( get_topics_per_day() ); 24 $rn_topics_average = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics_average), $rn_topics_average ); 22 25 23 $rn_posts_average = get_posts_per_day();24 $rn_posts_average = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts_average), number_format( $rn_posts_average ));26 $rn_posts_average = number_format( get_posts_per_day() ); 27 $rn_posts_average = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts_average), $rn_posts_average ); 25 28 26 $rn_users_average = get_registrations_per_day();27 $rn_users_average = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users_average), number_format( $rn_users_average ));29 $rn_users_average = number_format( get_registrations_per_day() ); 30 $rn_users_average = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users_average), $rn_users_average ); 28 31 29 $rn_topic_tags_average = bb_get_topic_tags_per_day();30 $rn_topic_tags_average = sprintf(__ngettext('<span>% d</span> tag', '<span>%d</span> tags', $rn_topic_tags_average), number_format( $rn_topic_tags_average ));32 $rn_topic_tags_average = number_format( bb_get_topic_tags_per_day() ); 33 $rn_topic_tags_average = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags_average), $rn_topic_tags_average ); 31 34 35 // Filter the numbers 32 36 $rn = apply_filters( 'bb_admin_right_now', array( 33 37 'forums' => array( $rn_forums, '-' ), … … 40 44 $bb_admin_body_class = ' bb-admin-dashboard'; 41 45 42 bb_get_admin_header(); 43 ?> 46 bb_get_admin_header(); ?> 44 47 45 48 <div class="wrap"> 46 49 <h2><?php _e('Dashboard'); ?></h2> 50 47 51 <?php do_action( 'bb_admin_notices' ); ?> 48 52 … … 57 61 </tr> 58 62 </thead> 59 <?php 60 if ( !empty( $rn ) && is_array( $rn ) ) { 61 ?> 63 64 <?php if ( !empty( $rn ) && is_array( $rn ) ) { ?> 65 62 66 <tbody> 63 <?php 64 foreach ( $rn as $rn_row ) {65 ?> 67 68 <?php foreach ( $rn as $rn_row ) { ?> 69 66 70 <tr> 67 71 <td><?php echo $rn_row[0]; ?></td> 68 72 <td><?php echo $rn_row[1]; ?></td> 69 73 </tr> 70 <?php 71 } 72 ?> 74 <?php } ?> 75 73 76 </tbody> 74 <?php 75 } 76 ?> 77 78 <?php } ?> 79 77 80 </table> 78 81 </div>
Note: See TracChangeset
for help on using the changeset viewer.