[ Root ] [ Search ] [ Index ]

PHP Cross Reference of bbPress Trunk

Provided by Yoast

title

Body

[close]

/bb-admin/ -> index.php (source)

   1  <?php
   2  require_once ('admin.php');
   3  require_once( BB_PATH . BB_INC . 'functions.bb-statistics.php' );
   4  
   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  
   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 ) );
  10  
  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 ) );
  13  
  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 ) );
  16  
  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 ) );
  19  
  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 ) );
  22  
  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 ) );
  25  
  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 ) );
  28  
  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 ) );
  31  
  32  $rn = apply_filters( 'bb_admin_right_now', array(
  33      'forums'     => array( $rn_forums, '-' ),
  34      'topics'     => array( $rn_topics, $rn_topics_average ),
  35      'posts'      => array( $rn_posts, $rn_posts_average ),
  36      'topic_tags' => array( $rn_topic_tags, $rn_topic_tags_average ),
  37      'users'      => array( $rn_users, $rn_users_average )
  38  ) );
  39  
  40  $bb_admin_body_class = ' bb-admin-dashboard';
  41  
  42  bb_get_admin_header();
  43  ?>
  44  
  45  <div class="wrap">
  46      <h2><?php _e('Dashboard'); ?></h2>
  47      <?php do_action( 'bb_admin_notices' ); ?>
  48  
  49      <div id="dashboard-right-now" class="dashboard">
  50          <h3><?php _e('Right Now'); ?></h3>
  51          <div class="table">
  52              <table cellpadding="0" cellspacing="0">
  53                  <thead>
  54                      <tr>
  55                          <th><?php _e( 'Totals' ); ?></th>
  56                          <th><?php _e( 'Per Day' ); ?></th>
  57                      </tr>
  58                  </thead>
  59  <?php
  60  if ( !empty( $rn ) && is_array( $rn ) ) {
  61  ?>
  62                  <tbody>
  63  <?php
  64      foreach ( $rn as $rn_row ) {
  65  ?>
  66                      <tr>
  67                          <td><?php echo $rn_row[0]; ?></td>
  68                          <td><?php echo $rn_row[1]; ?></td>
  69                      </tr>
  70  <?php
  71      }
  72  ?>
  73                  </tbody>
  74  <?php
  75  }
  76  ?>
  77              </table>
  78          </div>
  79  
  80          <div class="versions">
  81              <p class="theme"><a class="button" href="<?php bb_uri( 'bb-admin/themes.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN ); ?>"><?php _e( 'Change Theme' ); ?></a><?php printf ( __( 'Theme <a href="%1$s">%2$s</a>' ), bb_get_uri( 'bb-admin/themes.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN ), bb_get_current_theme_data( 'Name' ) ); ?></p>
  82              <p class="bbpress"><?php printf( __( 'You are using <span class="b">bbPress %s</span>' ), bb_get_option( 'version' ) ); ?></p>
  83          </div>
  84      </div>
  85  
  86      <div id="dashboard-moderated" class="dashboard">
  87          <h3><?php _e('Recently Moderated Items'); ?></h3>
  88          <?php if ( $objects = bb_get_recently_moderated_objects() ) : ?>
  89          <ul class="posts">
  90              <?php add_filter( 'get_topic_where', 'bb_no_where' ); foreach ( $objects as $object ) : ?>
  91              <?php if ( 'post' == $object['type'] ) : global $bb_post; $bb_post = $object['data']; ?>
  92              <li>
  93              <?php
  94                      if ( $bb_post->poster_id ) {
  95                          printf(
  96                              __( '<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by <a href="%4$s">%5$s</a>' ),
  97                              esc_attr( add_query_arg( 'view', 'all', get_post_link() ) ),
  98                              get_topic_link( $bb_post->topic_id ),
  99                              get_topic_title( $bb_post->topic_id ),
 100                              get_user_profile_link( $bb_post->poster_id ),
 101                              get_post_author()
 102                          );
 103                      } else {
 104                          printf(
 105                              __( '<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by %4$s' ),
 106                              esc_attr( add_query_arg( 'view', 'all', get_post_link() ) ),
 107                              get_topic_link( $bb_post->topic_id ),
 108                              get_topic_title( $bb_post->topic_id ),
 109                              get_post_author()
 110                          );
 111                      }
 112              ?>
 113              </li>
 114              <?php elseif ( 'topic' == $object['type'] ) : global $topic; $topic = $object['data']; ?>
 115              <li>
 116              <?php
 117                      if ( $topic->topic_poster ) {
 118                          printf(
 119                              __( 'Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>' ),
 120                              esc_attr( add_query_arg( 'view', 'all', get_topic_link() ) ),
 121                              get_topic_title( $topic->topic_id ),
 122                              get_user_profile_link( $topic->topic_poster ),
 123                              get_topic_author( $topic->topic_id )
 124                          );
 125                      } else {
 126                          printf(
 127                              __( 'Topic titled <a href="%1$s">%2$s</a> started by %3$s' ),
 128                              esc_attr( add_query_arg( 'view', 'all', get_topic_link() ) ),
 129                              get_topic_title( $topic->topic_id ),
 130                              get_topic_author( $topic->topic_id )
 131                          );
 132                      }
 133              ?>
 134              </li>
 135              <?php endif; endforeach; remove_filter( 'get_topic_where', 'bb_no_where' ); ?>
 136          </ul>
 137          <?php else : ?>
 138          <p>
 139              <?php _e('No moderated posts or topics&#8230; you must have very well behaved members.'); ?>
 140          </p>
 141          <?php endif; ?>
 142      </div>
 143      <div class="clear"></div>
 144  </div>
 145  
 146  <?php bb_get_admin_footer(); ?>


Generated: Mon Nov 15 04:45:27 2010 Cross-referenced by PHPXref 0.7