Ticket #7526: 7526-2.patch
File 7526-2.patch, 3.8 KB (added by , 8 years ago) |
---|
-
src/bp-activity/classes/class-bp-activity-list-table.php
313 313 ?></h2> 314 314 315 315 <ul class="subsubsub"> 316 <li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>316 <li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' );printf( __( ' <span class="count">(%d)</span>' ), $this->count_all_activity() ); ?></a> |</li> 317 317 <li class="spam"><a href="<?php echo esc_url( add_query_arg( array( 'activity_status' => 'spam' ), $url_base ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li> 318 318 319 319 <?php … … 855 855 856 856 return $tree; 857 857 } 858 859 /** 860 * Get count for All activities tab 861 * 862 * It will show count of activities which are not spam. 863 * 864 * @return int $activity_count Count of non spam activities. 865 */ 866 public static function count_all_activity() { 867 global $wpdb; 868 $activity_count = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}bp_activity WHERE `component` = 'activity' AND `is_spam` = '0'" ); 869 return $activity_count; 870 } 858 871 } -
src/bp-groups/classes/class-bp-groups-list-table.php
331 331 ?></h2> 332 332 333 333 <ul class="subsubsub"> 334 <li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>334 <li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' );printf( __( ' <span class="count">(%d)</span>' ), $this->count_all_groups() ); ?></a> |</li> 335 335 <li class="public"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'public', $url_base ) ); ?>" class="<?php if ( 'public' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Public <span class="count">(%s)</span>', 'Public <span class="count">(%s)</span>', $this->group_counts['public'], 'buddypress' ), number_format_i18n( $this->group_counts['public'] ) ); ?></a> |</li> 336 336 <li class="private"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'private', $url_base ) ); ?>" class="<?php if ( 'private' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', $this->group_counts['private'], 'buddypress' ), number_format_i18n( $this->group_counts['private'] ) ); ?></a> |</li> 337 337 <li class="hidden"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Hidden <span class="count">(%s)</span>', 'Hidden <span class="count">(%s)</span>', $this->group_counts['hidden'], 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li> … … 790 790 </div> 791 791 <?php 792 792 } 793 794 /** 795 * Get count for All groups tab 796 * 797 * It will show count of all groups. 798 * 799 * @return int $group_count Count of all groups. 800 */ 801 public function count_all_groups() { 802 $group_count = $this->group_counts['public'] + $this->group_counts['private'] + $this->group_counts['hidden']; 803 return $group_count; 804 } 793 805 }