Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2010 01:08:31 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Committing patch from #2566 for easier review and testing. Adds BP_Button class and associated template tags. Also includes code formatting fixes, phpdoc, widget fixes when friends component is disabled, and possibly the kitchen sink.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-widgets.php

    r3143 r3260  
    2222        global $bp;
    2323
    24         extract( $args );
     24        extract( $args );
    2525
    2626        echo $before_widget;
     
    3232            <div class="item-options" id="members-list-options">
    3333                <span class="ajax-loader" id="ajax-loader-members"></span>
    34                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a> |
    35                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a> |
    36                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
     34                <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a>
     35                |  <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a>
     36
     37                <?php if ( bp_is_active( 'friends' ) ) : ?>
     38
     39                    | <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
     40
     41                <?php endif; ?>
     42
    3743            </div>
    3844
     
    148154        global $bp;
    149155
    150         extract( $args );
     156        extract( $args );
    151157
    152158        echo $before_widget;
     
    202208        case 'newest-members':
    203209            $type = 'newest';
    204         break;
     210            break;
     211
    205212        case 'recently-active-members':
    206213            $type = 'active';
    207         break;
     214            break;
     215
    208216        case 'popular-members':
    209             $type = 'popular';
    210         break;
     217            if ( bp_is_active( 'friends' ) )
     218                $type = 'popular';
     219            else
     220                $type = 'active';
     221
     222            break;
    211223    }
    212224
     
    224236                        <?php if ( 'active' == $type || 'newest' == $type ) : ?>
    225237                            <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
    226                         <?php else : ?>
     238                        <?php elseif ( bp_is_active( 'friends' ) ) : ?>
    227239                            <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
    228240                        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.