Skip to:
Content

BuddyPress.org

Ticket #3456: 3456.01.patch

File 3456.01.patch, 28.8 KB (added by r-a-y, 14 years ago)
  • bp-activity/bp-activity-template.php

    class BP_Activity_Template { 
    174174                                'format'    => '',
    175175                                'total'     => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
    176176                                'current'   => (int)$this->pag_page,
    177                                 'prev_text' => '←',
    178                                 'next_text' => '→',
     177                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Activity pagination previous text', 'buddypress' ) ),
     178                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Activity pagination next text', 'buddypress' ) ),
    179179                                'mid_size'  => 1
    180180                        ) );
    181181                }
    function bp_has_activities( $args = '' ) { 
    269269                if ( 'public' != $bp->groups->current_group->status && ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) || $bp->loggedin_user->is_super_admin ) )
    270270                        $show_hidden = true;
    271271        }
    272        
     272
    273273        // The default scope should recognize custom slugs
    274274        if ( array_key_exists( $bp->current_action, (array)$bp->loaded_components ) ) {
    275275                $scope = $bp->loaded_components[$bp->current_action];
    function bp_has_activities( $args = '' ) { 
    280280        // Support for permalinks on single item pages: /groups/my-group/activity/124/
    281281        if ( bp_is_current_action( bp_get_activity_slug() ) )
    282282                $include = bp_action_variable( 0 );
    283                
     283
    284284        // Note: any params used for filtering can be a single value, or multiple values comma separated.
    285285        $defaults = array(
    286286                'display_comments' => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
    function bp_activity_content() { 
    754754
    755755                // Insert the time since.
    756756                $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) );
    757        
     757
    758758                // Insert the permalink
    759759                if ( !bp_is_single_activity() )
    760760                        $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );
    function bp_activity_user_can_delete( $activity = false ) { 
    769769
    770770        if ( !$activity )
    771771                $activity = $activities_template->activity;
    772        
     772
    773773        if ( isset( $activity->current_comment ) )
    774774                $activity = $activity->current_comment;
    775775
    function bp_activity_comments( $args = '' ) { 
    860860
    861861                bp_activity_recurse_comments( $activities_template->activity );
    862862        }
    863        
     863
    864864                /**
    865865                 * Loops through a level of activity comments and loads the template for each
    866866                 *
    function bp_activity_comments( $args = '' ) { 
    874874                 */
    875875                function bp_activity_recurse_comments( $comment ) {
    876876                        global $activities_template, $bp, $counter;
    877                        
     877
    878878                        if ( !$comment )
    879879                                return false;
    880                                
     880
    881881                        if ( empty( $comment->children ) )
    882882                                return false;
    883883
    function bp_activity_comments( $args = '' ) { 
    887887                                $activities_template->activity->current_comment = $comment_child;
    888888
    889889                                $template = locate_template( 'activity/comment.php', false, false );
    890                                
     890
    891891                                // Backward compatibility. In older versions of BP, the markup was
    892892                                // generated in the PHP instead of a template. This ensures that
    893893                                // older themes (which are not children of bp-default and won't
    function bp_activity_comments( $args = '' ) { 
    895895                                if ( !$template ) {
    896896                                        $template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
    897897                                }
    898                                
     898
    899899                                load_template( $template, false );
    900                                
     900
    901901                                unset( $activities_template->activity->current_comment );
    902902                        }
    903903                        echo '</ul>';
    function bp_activity_comments( $args = '' ) { 
    914914 */
    915915function bp_activity_current_comment() {
    916916        global $activities_template;
    917        
     917
    918918        $current_comment = !empty( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : false;
    919        
     919
    920920        return apply_filters( 'bp_activity_current_comment', $current_comment );
    921921}
    922922
    function bp_activity_comment_id() { 
    942942         */
    943943        function bp_get_activity_comment_id() {
    944944                global $activities_template;
    945                
     945
    946946                $comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : false;
    947        
     947
    948948                return apply_filters( 'bp_activity_comment_id', $comment_id );
    949949        }
    950950
    function bp_activity_comment_user_id() { 
    969969         */
    970970        function bp_get_activity_comment_user_id() {
    971971                global $activities_template;
    972                
     972
    973973                $user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false;
    974                
     974
    975975                return apply_filters( 'bp_activity_comment_user_id', $user_id );
    976976        }
    977977
    function bp_activity_comment_user_link() { 
    996996         */
    997997        function bp_get_activity_comment_user_link() {
    998998                $user_link = bp_core_get_user_domain( bp_get_activity_comment_user_id() );
    999        
     999
    10001000                return apply_filters( 'bp_activity_comment_user_link', $user_link );
    10011001        }
    10021002
    function bp_activity_comment_name() { 
    10231023         */
    10241024        function bp_get_activity_comment_name() {
    10251025                global $activities_template;
    1026                
     1026
    10271027                $name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment ); // backward compatibility
    1028                
     1028
    10291029                return apply_filters( 'bp_activity_comment_name', $name );
    10301030        }
    10311031
    function bp_activity_comment_date_recorded() { 
    10501050         */
    10511051        function bp_get_activity_comment_date_recorded() {
    10521052                global $activities_template;
    1053                
     1053
    10541054                if ( empty( $activities_template->activity->current_comment->date_recorded ) )
    10551055                        return false;
    1056                
     1056
    10571057                $date_recorded = bp_core_time_since( $activities_template->activity->current_comment->date_recorded );
    1058                
     1058
    10591059                return apply_filters( 'bp_activity_comment_date_recorded', $date_recorded );
    10601060        }
    10611061
    function bp_activity_comment_delete_link() { 
    10801080         */
    10811081        function bp_get_activity_comment_delete_link() {
    10821082                global $bp;
    1083                
     1083
    10841084                $link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
    1085                
     1085
    10861086                return apply_filters( 'bp_activity_comment_delete_link', $link );
    10871087        }
    10881088
    function bp_activity_comment_content() { 
    11111111         */
    11121112        function bp_get_activity_comment_content() {
    11131113                global $activities_template;
    1114                
     1114
    11151115                $content = apply_filters( 'bp_get_activity_content', $activities_template->activity->current_comment->content );
    1116                
     1116
    11171117                return apply_filters( 'bp_activity_comment_content', $content );
    11181118        }
    11191119
  • bp-blogs/bp-blogs-template.php

    class BP_Blogs_Template { 
    132132                                'format'    => '',
    133133                                'total'     => ceil( (int)$this->total_blog_count / (int)$this->pag_num ),
    134134                                'current'   => (int)$this->pag_page,
    135                                 'prev_text' => '&larr;',
    136                                 'next_text' => '&rarr;',
     135                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Blog pagination previous text', 'buddypress' ) ),
     136                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Blog pagination next text', 'buddypress' ) ),
    137137                                'mid_size'  => 1
    138138                        ) );
    139139                }
    function bp_blogs_blog_tabs() { 
    588588function bp_directory_blogs_search_form() {
    589589        global $bp;
    590590
    591         $default_search_value = bp_get_search_default_text(); 
     591        $default_search_value = bp_get_search_default_text();
    592592        $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
    593593
    594594        <form action="" method="get" id="search-blogs-form">
  • bp-forums/bp-forums-template.php

    class BP_Forums_Template_Forum { 
    101101                $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number );
    102102        }
    103103
    104         function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {     
     104        function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
    105105                global $bp;
    106106
    107107                $this->pag_page     = $page;
    class BP_Forums_Template_Forum { 
    113113                $this->number       = $number;
    114114
    115115                switch ( $type ) {
    116                         case 'newest': default:                         
     116                        case 'newest': default:
    117117                                $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) );
    118118                                break;
    119119
    class BP_Forums_Template_Forum { 
    152152                        } else {
    153153                                $this->total_topic_count = (int)$max;
    154154                        }
    155                        
     155
    156156                        if ( $max ) {
    157157                                if ( $max >= count($this->topics) ) {
    158158                                        $this->topic_count = count( $this->topics );
    class BP_Forums_Template_Forum { 
    176176                                'format'    => '',
    177177                                'total'     => ceil( (int)$this->total_topic_count / (int)$this->pag_num),
    178178                                'current'   => $this->pag_page,
    179                                 'prev_text' => '&larr;',
    180                                 'next_text' => '&rarr;',
     179                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ) ),
     180                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ) ),
    181181                                'mid_size'  => 1
    182182                        ) );
    183183                }
    function bp_has_forum_topics( $args = '' ) { 
    260260        // User filtering
    261261        if ( !empty( $bp->displayed_user->id ) )
    262262                $user_id = $bp->displayed_user->id;
    263        
     263
    264264        // "Replied" query must be manually modified
    265265        if ( 'replies' == bp_current_action() ) {
    266266                $user_id = 0; // User id must be handled manually by the filter, not by BB_Query
    267                
     267
    268268                add_filter( 'get_topics_distinct',   'bp_forums_add_replied_distinct_sql', 20 );
    269269                add_filter( 'get_topics_join',       'bp_forums_add_replied_join_sql', 20 );
    270270                add_filter( 'get_topics_where',      'bp_forums_add_replied_where_sql', 20  );
    function bp_has_forum_topics( $args = '' ) { 
    285285        // If $_GET['fs'] is set, let's auto populate the search_terms var
    286286        if ( bp_is_directory() && !empty( $_GET['fs'] ) )
    287287                $search_terms = $_GET['fs'];
    288        
     288
    289289        // Get the pagination arguments from $_REQUEST
    290290        $page     = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : 1;
    291291        $per_page = isset( $_REQUEST['n'] ) ? intval( $_REQUEST['n'] ) : 20;
    292        
     292
    293293        // Unless set otherwise, stickies appear in normal order on the global forum directory
    294294        if ( bp_is_directory() && bp_is_forums_component() && !bp_forums_enable_global_directory_stickies() )
    295295                $do_stickies = false;
    function bp_has_forum_topics( $args = '' ) { 
    315315        if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) {
    316316                $type = 'tags';
    317317        }
    318        
     318
    319319        /** Sticky logic ******************************************************************/
    320        
     320
    321321        if ( $do_stickies ) {
    322322                // Fetch the stickies
    323323                $stickies_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 0, 0, $max, 'sticky', $search_terms );
    324                
     324
    325325                // If stickies are found, try merging them
    326326                if ( $stickies_template->has_topics() ) {
    327                
    328                         // If stickies are for current $page           
     327
     328                        // If stickies are for current $page
    329329                        $page_start_num = ( ( $page - 1 ) * $per_page ) + 1;
    330330                        $page_end_num   = $page * $per_page <= $stickies_template->total_topic_count ? $page * $per_page : $stickies_template->total_topic_count;
    331                        
     331
    332332                        // Calculate the number of sticky topics that will be shown on this page
    333333                        if ( $stickies_template->topic_count < $page_start_num ) {
    334334                                $this_page_stickies = 0;
    335                         } else {                       
     335                        } else {
    336336                                $this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page
    337                                
     337
    338338                                // $this_page_stickies cannot be more than $per_page or less than 0
    339339                                if ( $this_page_stickies > $per_page )
    340340                                        $this_page_stickies = $per_page;
    341341                                else if ( $this_page_stickies < 0 )
    342342                                        $this_page_stickies = 0;
    343343                        }
    344                        
     344
    345345                        // Calculate the total number of topics that will be shown on this page
    346346                        $this_page_topics = $stickies_template->total_topic_count >= ( $page * $per_page ) ? $per_page : $page_end_num - ( $page_start_num - 1 );
    347                        
     347
    348348                        // If the number of stickies to be shown is less than $per_page, fetch some
    349349                        // non-stickies to fill in the rest
    350350                        if ( $this_page_stickies < $this_page_topics ) {
    351351                                // How many non-stickies do we need?
    352352                                $non_sticky_number = $this_page_topics - $this_page_stickies;
    353                                
    354                                 // Calculate the non-sticky offset                     
     353
     354                                // Calculate the non-sticky offset
    355355                                // How many non-stickies on all pages up to this point?
    356356                                $non_sticky_total = $page_end_num - $stickies_template->topic_count;
    357                                
     357
    358358                                // The offset is the number of total non-stickies, less the number
    359359                                // to be shown on this page
    360360                                $non_sticky_offset = $non_sticky_total - $non_sticky_number;
    361                                
     361
    362362                                // Fetch the non-stickies
    363363                                $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 1, $per_page, $max, 'no', $search_terms, $non_sticky_offset, $non_sticky_number );
    364                                
     364
    365365                                // If there are stickies to merge on this page, do it now
    366366                                if ( $this_page_stickies ) {
    367367                                        // Correct the topic_count
    368368                                        $forum_template->topic_count += (int)$this_page_stickies;
    369                                        
     369
    370370                                        // Figure out which stickies need to be included
    371371                                        $this_page_sticky_topics = array_slice( $stickies_template->topics, 0 - $this_page_stickies );
    372                                        
     372
    373373                                        // Merge these topics into the forum template
    374374                                        $forum_template->topics = array_merge( $this_page_sticky_topics, (array)$forum_template->topics );
    375375                                }
    376376                        } else {
    377377                                // This page has no non-stickies
    378378                                $forum_template = $stickies_template;
    379                                
     379
    380380                                // Adjust the topic count and trim the topics
    381381                                $forum_template->topic_count = $this_page_stickies;
    382                                 $forum_template->topics      = array_slice( $forum_template->topics, $page - 1 );       
     382                                $forum_template->topics      = array_slice( $forum_template->topics, $page - 1 );
    383383                        }
    384                                        
     384
    385385                        // Because we're using a manual offset and number for the topic query, we
    386386                        // must set the page number manually, and recalculate the pagination links
    387387                        $forum_template->pag_num     = $per_page;
    388388                        $forum_template->pag_page    = $page;
    389                        
     389
    390390                        $forum_template->pag_links = paginate_links( array(
    391391                                'base'      => add_query_arg( array( 'p' => '%#%', 'n' => $forum_template->pag_num ) ),
    392392                                'format'    => '',
    393393                                'total'     => ceil( (int)$forum_template->total_topic_count / (int)$forum_template->pag_num ),
    394394                                'current'   => $forum_template->pag_page,
    395                                 'prev_text' => '&larr;',
    396                                 'next_text' => '&rarr;',
     395                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ) ),
     396                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ) ),
    397397                                'mid_size'  => 1
    398398                        ) );
    399                        
     399
    400400                } else {
    401401                        // Fetch the non-sticky topics if no stickies were found
    402402                        $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms );
    function bp_has_forum_topics( $args = '' ) { 
    405405                // When skipping the sticky logic, just pull up the forum topics like usual
    406406                $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms );
    407407        }
    408                
     408
    409409        return apply_filters( 'bp_has_topics', $forum_template->has_topics(), $forum_template );
    410410}
    411411
    function bp_forum_topic_type() { 
    864864 */
    865865function bp_forums_tag_name() {
    866866        echo bp_get_forums_tag_name();
    867 }       
     867}
    868868        /**
    869869         * Outputs the currently viewed tag name
    870870         *
    function bp_forums_tag_name() { 
    873873         */
    874874        function bp_get_forums_tag_name() {
    875875                $tag_name = bp_is_directory() && bp_is_forums_component() ? bp_action_variable( 0 ) : false;
    876                
     876
    877877                return apply_filters( 'bp_get_forums_tag_name', $tag_name );
    878878        }
    879879
    class BP_Forums_Template_Topic { 
    939939        function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) {
    940940                $this->__construct( $topic_id, $per_page, $max, $order );
    941941        }
    942                
     942
    943943        function __construct( $topic_id, $per_page, $max, $order ) {
    944944                global $bp, $current_user, $forum_template;
    945945
    class BP_Forums_Template_Topic { 
    973973                                $this->post_count = count( $this->posts );
    974974                        }
    975975                }
    976                
     976
    977977                // Load topic tags
    978978                $this->topic_tags = bb_get_topic_tags( $this->topic_id );
    979979
    class BP_Forums_Template_Topic { 
    983983                                'format'    => '',
    984984                                'total'     => ceil( (int)$this->total_post_count / (int)$this->pag_num ),
    985985                                'current'   => $this->pag_page,
    986                                 'prev_text' => '&larr;',
    987                                 'next_text' => '&rarr;',
     986                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Forum thread pagination previous text', 'buddypress' ) ),
     987                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Forum thread pagination next text', 'buddypress' ) ),
    988988                                'mid_size'  => 1
    989989                        ) );
    990990
    function bp_has_forum_topic_posts( $args = '' ) { 
    10681068                if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) )
    10691069                        return false;
    10701070        }
    1071        
     1071
    10721072        return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
    10731073}
    10741074
    function bp_forum_topic_tag_list() { 
    13341334         */
    13351335        function bp_get_forum_topic_tag_list( $format = 'string' ) {
    13361336                global $topic_template;
    1337                
     1337
    13381338                $tags_data = !empty( $topic_template->topic_tags ) ? $topic_template->topic_tags : false;
    1339                
     1339
    13401340                $tags = array();
    1341                
     1341
    13421342                if ( $tags_data ) {
    13431343                        foreach( $tags_data as $tag_data ) {
    13441344                                $tags[] = $tag_data->name;
    13451345                        }
    13461346                }
    1347                
     1347
    13481348                if ( 'string' == $format )
    13491349                        $tags = implode( ', ', $tags );
    1350                        
     1350
    13511351                return apply_filters( 'bp_forum_topic_tag_list', $tags, $format );
    13521352        }
    13531353
    function bp_forum_topic_tag_list() { 
    13611361 */
    13621362function bp_forum_topic_has_tags() {
    13631363        global $topic_template;
    1364        
     1364
    13651365        $has_tags = false;
    1366        
     1366
    13671367        if ( !empty( $topic_template->topic_tags ) )
    13681368                $has_tags = true;
    1369        
     1369
    13701370        return apply_filters( 'bp_forum_topic_has_tags', $has_tags );
    13711371}
    13721372
  • bp-groups/bp-groups-template.php

    class BP_Groups_Template { 
    168168                                'format'    => '',
    169169                                'total'     => ceil( (int)$this->total_group_count / (int)$this->pag_num ),
    170170                                'current'   => $this->pag_page,
    171                                 'prev_text' => '&larr;',
    172                                 'next_text' => '&rarr;',
     171                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Group pagination previous text', 'buddypress' ) ),
     172                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Group pagination next text', 'buddypress' ) ),
    173173                                'mid_size'  => 1
    174174                        ) );
    175175                }
    function bp_group_admin_ids( $group = false, $format = 'string' ) { 
    625625
    626626        $admin_ids = array();
    627627
    628         if ( $group->admins ) { 
     628        if ( $group->admins ) {
    629629                foreach( $group->admins as $admin ) {
    630630                        $admin_ids[] = $admin->user_id;
    631631                }
    632632        }
    633                        
    634         if ( 'string' == $format ) 
     633
     634        if ( 'string' == $format )
    635635                $admin_ids = implode( ',', $admin_ids );
    636        
     636
    637637        return apply_filters( 'bp_group_admin_ids', $admin_ids );
    638638}
    639639
    function bp_group_mod_ids( $group = false, $format = 'string' ) { 
    655655
    656656        $mod_ids = array();
    657657
    658         if ( $group->mods ) { 
     658        if ( $group->mods ) {
    659659                foreach( $group->mods as $mod ) {
    660660                        $mod_ids[] = $mod->user_id;
    661661                }
    662662        }
    663        
    664         if ( 'string' == $format ) 
     663
     664        if ( 'string' == $format )
    665665                $mod_ids = implode( ',', $mod_ids );
    666        
     666
    667667        return apply_filters( 'bp_group_mod_ids', $mod_ids );
    668668}
    669669
    function bp_group_show_status_setting( $setting, $group = false ) { 
    896896 * @param str $setting The setting you want to check against ('members', 'mods', or 'admins')
    897897 * @param obj $group (optional) The group whose status you want to check
    898898 */
    899 function bp_group_show_invite_status_setting( $setting, $group = false ) { 
     899function bp_group_show_invite_status_setting( $setting, $group = false ) {
    900900        $group_id = isset( $group->id ) ? $group->id : false;
    901        
     901
    902902        $invite_status = bp_group_get_invite_status( $group_id );
    903        
     903
    904904        if ( $setting == $invite_status )
    905905                echo ' checked="checked"';
    906906}
    function bp_group_show_invite_status_setting( $setting, $group = false ) { 
    924924 */
    925925function bp_group_get_invite_status( $group_id = false ) {
    926926        global $bp, $groups_template;
    927                
     927
    928928        if ( !$group_id ) {
    929929                if ( isset( $bp->groups->current_group->id ) ) {
    930930                        // Default to the current group first
    function bp_group_get_invite_status( $group_id = false ) { 
    936936                        return false;
    937937                }
    938938        }
    939        
     939
    940940        $invite_status = groups_get_groupmeta( $group_id, 'invite_status' );
    941941
    942942        // Backward compatibility. When 'invite_status' is not set, fall back to a default value
    function bp_group_get_invite_status( $group_id = false ) { 
    957957 * @param int $group_id (optional) The id of the group whose status you want to check
    958958 * @return bool $can_send_invites
    959959 */
    960 function bp_groups_user_can_send_invites( $group_id = false ) { 
    961         global $bp; 
     960function bp_groups_user_can_send_invites( $group_id = false ) {
     961        global $bp;
    962962
    963963        $can_send_invites = false;
    964964        $invite_status    = false;
    965        
     965
    966966        if ( is_user_logged_in() ) {
    967                 if ( is_super_admin() ) { 
    968                         // Super admins can always send invitations 
     967                if ( is_super_admin() ) {
     968                        // Super admins can always send invitations
    969969                        $can_send_invites = true;
    970970
    971971                } else {
    function bp_groups_user_can_send_invites( $group_id = false ) { 
    982982                                return false;
    983983
    984984                        switch ( $invite_status ) {
    985                                 case 'admins' : 
    986                                         if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) ) 
     985                                case 'admins' :
     986                                        if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) )
    987987                                                $can_send_invites = true;
    988988                                        break;
    989989
    function bp_groups_user_can_send_invites( $group_id = false ) { 
    10011001        }
    10021002
    10031003        return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status );
    1004 } 
     1004}
    10051005
    10061006/**
    10071007 * Since BuddyPress 1.0, this generated the group settings admin/member screen.
    class BP_Groups_Group_Members_Template { 
    16681668        var $total_group_count;
    16691669
    16701670        function bp_groups_group_members_template( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) {
    1671                 $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude );     
     1671                $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude );
    16721672        }
    1673        
     1673
    16741674        function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) {
    16751675                global $bp;
    16761676
    class BP_Groups_Membership_Requests_Template { 
    23982398        function bp_groups_membership_requests_template( $group_id, $per_page, $max ) {
    23992399                $this->__construct( $group_id, $per_page, $max );
    24002400        }
    2401        
    2402        
     2401
     2402
    24032403        function __construct( $group_id, $per_page, $max ) {
    2404                
     2404
    24052405                global $bp;
    24062406
    24072407                $this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1;
    class BP_Groups_Invite_Template { 
    25722572        var $total_invite_count;
    25732573
    25742574        function bp_groups_invite_template( $user_id, $group_id ) {
    2575                 $this->__construct( $user_id, $group_id ); 
     2575                $this->__construct( $user_id, $group_id );
    25762576        }
    2577                
     2577
    25782578        function __construct( $user_id, $group_id ) {
    25792579
    25802580                global $bp;
    2581                
     2581
    25822582                $this->invites = groups_get_invites_for_group( $user_id, $group_id );
    25832583                $this->invite_count = count( $this->invites );
    25842584
    function bp_group_activity_feed_link() { 
    27522752 */
    27532753function bp_current_group_id() {
    27542754        echo bp_get_current_group_id();
    2755 }       
     2755}
    27562756        /**
    27572757         * Returns the ID of the current group
    27582758         *
    function bp_current_group_id() { 
    27602760         * @since 1.5
    27612761         * @uses apply_filters() Filter bp_get_current_group_id to modify this output
    27622762         *
    2763          * @return int $current_group_id The id of the current group, if there is one 
     2763         * @return int $current_group_id The id of the current group, if there is one
    27642764         */
    27652765        function bp_get_current_group_id() {
    27662766                $current_group = groups_get_current_group();
    2767                
     2767
    27682768                $current_group_id = isset( $current_group->id ) ? (int)$current_group->id : 0;
    2769                
     2769
    27702770                return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
    27712771        }
    27722772
    function bp_current_group_id() { 
    27782778 */
    27792779function bp_current_group_slug() {
    27802780        echo bp_get_current_group_slug();
    2781 }       
     2781}
    27822782        /**
    27832783         * Returns the slug of the current group
    27842784         *
    function bp_current_group_slug() { 
    27862786         * @since 1.5
    27872787         * @uses apply_filters() Filter bp_get_current_group_slug to modify this output
    27882788         *
    2789          * @return str $current_group_slug The slug of the current group, if there is one 
     2789         * @return str $current_group_slug The slug of the current group, if there is one
    27902790         */
    27912791        function bp_get_current_group_slug() {
    27922792                $current_group = groups_get_current_group();
    2793                
     2793
    27942794                $current_group_slug = isset( $current_group->slug ) ? $current_group->slug : '';
    2795                
     2795
    27962796                return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
    27972797        }
    27982798
    function bp_current_group_name() { 
    28112811         * @since 1.5
    28122812         * @uses apply_filters() Filter bp_get_current_group_name to modify this output
    28132813         *
    2814          * @return str The name of the current group, if there is one 
     2814         * @return str The name of the current group, if there is one
    28152815         */
    28162816        function bp_get_current_group_name() {
    28172817                global $bp;
  • bp-members/bp-members-template.php

    class BP_Core_Members_Template { 
    174174
    175175        function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
    176176                global $bp;
    177                
     177
    178178                $this->pag_page  = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number;
    179179                $this->pag_num   = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int)$per_page;
    180180                $this->type      = $type;
    class BP_Core_Members_Template { 
    209209                                'format'    => '',
    210210                                'total'     => ceil( (int)$this->total_member_count / (int)$this->pag_num ),
    211211                                'current'   => (int) $this->pag_page,
    212                                 'prev_text' => '&larr;',
    213                                 'next_text' => '&rarr;',
     212                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', __( '&larr;', 'buddypress' ) ),
     213                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', __( '&rarr;', 'buddypress' ) ),
    214214                                'mid_size'   => 1
    215215                        ) );
    216216                }
    function bp_has_members( $args = '' ) { 
    296296
    297297                'user_id'         => $user_id,      // Pass a user_id to only show friends of this user
    298298                'search_terms'    => $search_terms, // Pass search_terms to filter users by their profile data
    299                
     299
    300300                'meta_key'        => false,             // Only return users with this usermeta
    301301                'meta_value'      => false,             // Only return users where the usermeta value matches. Requires meta_key
    302302
    function bp_member_name() { 
    523523         */
    524524        function bp_get_member_name() {
    525525                global $members_template;
    526                
     526
    527527                // Generally, this only fires when xprofile is disabled
    528528                if ( empty( $members_template->member->fullname ) ) {
    529529                        // Our order of preference for alternative fullnames
    function bp_last_activity( $user_id = 0 ) { 
    815815                $last_activity = bp_core_get_last_activity( bp_get_user_meta( $user_id, 'last_activity', true ), __('active %s', 'buddypress') );
    816816
    817817                return apply_filters( 'bp_get_last_activity', $last_activity );
    818         }       
     818        }
    819819
    820820function bp_user_firstname() {
    821821        echo bp_get_user_firstname();
  • bp-messages/bp-messages-template.php

    Class BP_Messages_Box_Template { 
    7272                                'format'    => '',
    7373                                'total'     => ceil( (int)$this->total_thread_count / (int)$this->pag_num ),
    7474                                'current'   => $this->pag_page,
    75                                 'prev_text' => '&larr;',
    76                                 'next_text' => '&rarr;',
     75                                'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '&larr;', 'Message pagination previous text', 'buddypress' ) ),
     76                                'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '&rarr;', 'Message pagination next text', 'buddypress' ) ),
    7777                                'mid_size'  => 1
    7878                        ) );
    7979                }