Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/20/2011 03:56:04 AM (14 years ago)
Author:
johnjamesjacoby
Message:

First pass at BP_Component class. Refactor Activity component to use BP_Component. Introduce page templates for root directories. Rename bp-activity-templatetags to bp-activity-template per WP coding standards. Split bp-activity up into smaller parts. Introduce get_slug functions for activity component. More refactoring to do on other components. This will temporarily break trunk while refactoring happens, so be sure to pin to the previous revision if needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/activity/index.php

    r3698 r3751  
     1<?php
     2
     3/**
     4 * Template Name: BuddyPress - Activity Directory
     5 *
     6 * @package bbPress
     7 * @subpackage Theme
     8 */
     9
     10?>
     11
    112<?php get_header() ?>
    213
     
    516
    617            <?php if ( !is_user_logged_in() ) : ?>
     18
    719                <h3><?php _e( 'Site Activity', 'buddypress' ) ?></h3>
     20
    821            <?php endif; ?>
    922
     
    1124
    1225            <?php if ( is_user_logged_in() ) : ?>
     26
    1327                <?php locate_template( array( 'activity/post-form.php'), true ) ?>
     28
    1429            <?php endif; ?>
    1530
     
    2035                    <?php do_action( 'bp_before_activity_type_tab_all' ) ?>
    2136
    22                     <li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ) ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?></a></li>
     37                    <li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . bp_get_group_slug() . '/' ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ) ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?></a></li>
    2338
    2439                    <?php if ( is_user_logged_in() ) : ?>
     
    2742
    2843                        <?php if ( bp_is_active( 'friends' ) ) : ?>
     44
    2945                            <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    30                                 <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_FRIENDS_SLUG . '/' ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ) ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
     46
     47                                <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_group_slug() . '/' . BP_FRIENDS_SLUG . '/' ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ) ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
     48
    3149                            <?php endif; ?>
     50
    3251                        <?php endif; ?>
    3352
     
    3554
    3655                        <?php if ( bp_is_active( 'groups' ) ) : ?>
     56
    3757                            <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
    38                                 <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_GROUPS_SLUG . '/' ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ) ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     58
     59                                <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_group_slug() . '/' . BP_GROUPS_SLUG . '/' ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ) ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     60
    3961                            <?php endif; ?>
     62
    4063                        <?php endif; ?>
    4164
     
    4366
    4467                        <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
    45                             <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/favorites/' ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ) ?>"><?php printf( __( 'My Favorites (<span>%s</span>)', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     68
     69                            <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_group_slug() . '/favorites/' ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ) ?>"><?php printf( __( 'My Favorites (<span>%s</span>)', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     70
    4671                        <?php endif; ?>
    4772
    4873                        <?php do_action( 'bp_before_activity_type_tab_mentions' ) ?>
    4974
    50                         <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/mentions/' ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ) ?>"><?php printf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ) ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '(%s new)', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) ?></strong><?php endif; ?></a></li>
     75                        <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_group_slug() . '/mentions/' ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ) ?>"><?php printf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ) ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '(%s new)', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) ?></strong><?php endif; ?></a></li>
    5176
    5277                    <?php endif; ?>
     
    6893
    6994                            <?php if ( bp_is_active( 'blogs' ) ) : ?>
     95
    7096                                <option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option>
    7197                                <option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option>
     98
    7299                            <?php endif; ?>
    73100
    74101                            <?php if ( bp_is_active( 'forums' ) ) : ?>
    75                                 <option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ) ?></option>
    76                                 <option value="new_forum_post"><?php _e( 'Show Forum Replies', 'buddypress' ) ?></option>
     102
     103                                <option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ); ?></option>
     104                                <option value="new_forum_post"><?php _e( 'Show Forum Replies', 'buddypress' ); ?></option>
     105
    77106                            <?php endif; ?>
    78107
    79108                            <?php if ( bp_is_active( 'groups' ) ) : ?>
    80                                 <option value="created_group"><?php _e( 'Show New Groups', 'buddypress' ) ?></option>
    81                                 <option value="joined_group"><?php _e( 'Show New Group Memberships', 'buddypress' ) ?></option>
     109
     110                                <option value="created_group"><?php _e( 'Show New Groups', 'buddypress' ); ?></option>
     111                                <option value="joined_group"><?php _e( 'Show New Group Memberships', 'buddypress' ); ?></option>
     112
    82113                            <?php endif; ?>
    83114
    84115                            <?php if ( bp_is_active( 'friends' ) ) : ?>
    85                                 <option value="friendship_accepted,friendship_created"><?php _e( 'Show Friendship Connections', 'buddypress' ) ?></option>
     116
     117                                <option value="friendship_accepted,friendship_created"><?php _e( 'Show Friendship Connections', 'buddypress' ); ?></option>
     118
    86119                            <?php endif; ?>
    87120
    88                             <option value="new_member"><?php _e( 'Show New Members', 'buddypress' ) ?></option>
     121                            <option value="new_member"><?php _e( 'Show New Members', 'buddypress' ); ?></option>
    89122
    90                             <?php do_action( 'bp_activity_filter_options' ) ?>
     123                            <?php do_action( 'bp_activity_filter_options' ); ?>
     124
    91125                        </select>
    92126                    </li>
     
    97131
    98132            <div class="activity" role="main">
     133
    99134                <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
     135
    100136            </div><!-- .activity -->
    101137
     
    107143    </div><!-- #content -->
    108144
    109     <?php get_sidebar() ?>
     145<?php get_sidebar() ?>
    110146
    111147<?php get_footer() ?>
Note: See TracChangeset for help on using the changeset viewer.