This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

example member stat adjustments

By: a guest on Aug 13th, 2010  |  syntax: None  |  size: 2.05 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function bp_member_profile_stats_header_meta() {
  2. ?>
  3.         <div id="item-member-meta-stats">
  4.                 <?php bp_member_profile_stats_member_since(); ?>
  5.                 <p><?php if ( bp_member_profile_stats_displaycounts_check('status') ) bp_member_profile_stats_member_status_daysince(); ?></p>
  6.                 <?php if ( bp_member_profile_stats_displaycounts_check('topics') ) bp_member_profile_stats_member_topics_daysince(); ?>
  7.                 <?php if ( bp_member_profile_stats_displaycounts_check('posts') ) bp_member_profile_stats_member_posts_daysince(); ?>
  8.                 <?php if ( bp_member_profile_stats_displaycounts_check('comments') ) bp_member_profile_stats_member_comments_daysince(); ?>
  9.                 <?php do_action('bp_member_profile_stats_header_meta'); ?>
  10.         </div>
  11.         <?php
  12. }
  13.  
  14. function bp_member_profile_stats_member_status_daysince() {
  15.         echo bp_member_profile_stats_get_member_status_daysince();
  16. }
  17.  
  18.         function bp_member_profile_stats_get_member_status_daysince() {
  19.                
  20.                 if ( !bp_is_active( 'activity' ) )
  21.                         return;
  22.                        
  23.                 $daysince = bp_member_profile_stats_days_since();
  24.                
  25.                 $total_count = bp_member_profile_stats_get_member_status_count();
  26.                
  27.                 //$content = '<div><span class="status-count">';
  28.                
  29.                 if ( $total_count == 0 ) {
  30.                         $content .= __( 'No status updates yet.', 'bp-member-profile-stats' );
  31.                 } else if ( $total_count == 1 ) {
  32.                     $total_count = '<span class="the-count">' . $total_count . '</span>';
  33.                         $content .= $total_count . __( ' status update', 'bp-member-profile-stats' );
  34.                 } else {
  35.                         if ( $daysince > 0 ) {
  36.                              $total_count = '<span class="the-count">' . $total_count . '</span>';
  37.                                 $content .= $total_count .  __( ' status updates <span class="meta">(', 'bp-member-profile-stats' ) . round( $total_count / $daysince, 2 ) . __( ' updates per day on average)', 'bp-member-profile-stats' ) . '</span>';
  38.                         } else {
  39.                                 $content .= $total_count . __( ' status updates (', 'bp-member-profile-stats' );
  40.                         }
  41.                 }
  42.                
  43.                 //$content .= '</span></div>';
  44.                
  45.                 return apply_filters( 'bp_member_profile_stats_get_member_status_daysince', $content, $total_count );
  46.         }
clone this paste RAW Paste Data