Changeset 2488
- Timestamp:
- 01/31/2010 12:05:08 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r2487 r2488 127 127 $search_terms = false; 128 128 $object = false; 129 $action = false; 129 130 $primary_id = false; 130 131 $display_comments = 'threaded'; … … 134 135 $user_id = $bp->displayed_user->id; 135 136 137 /* Action filtering */ 138 if ( !empty( $_COOKIE['bp-activity-filter'] ) && '-1' != $_COOKIE['bp-activity-filter'] ) 139 $action = $_COOKIE['bp-activity-filter']; 140 136 141 /* User activity scope filtering */ 137 if ( !empty( $user_id ) ) { 138 if ( empty( $bp->current_action ) || 'just-me' == $bp->current_action ) 142 if ( !empty( $user_id ) || !empty( $_COOKIE['bp-activity-scope'] ) ) { 143 $scope = ( !empty( $bp->current_action ) ) ? $bp->current_action : $_COOKIE['bp-activity-scope']; 144 $current_user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 145 146 if ( empty( $scope ) || 'just-me' == $scope ) 139 147 $display_comments = 'stream'; 140 148 141 switch ( $ bp->current_action) {149 switch ( $scope ) { 142 150 case 'friends': 143 151 if ( function_exists( 'friends_get_friend_user_ids' ) ) 144 $user_id = implode( ',', (array)friends_get_friend_user_ids( $ bp->displayed_user->id ) );152 $user_id = implode( ',', (array)friends_get_friend_user_ids( $current_user_id ) ); 145 153 break; 146 154 case 'groups': 147 155 if ( function_exists( 'groups_get_user_groups' ) ) { 148 $groups = groups_get_user_groups( $ bp->displayed_user->id );156 $groups = groups_get_user_groups( $current_user_id ); 149 157 $object = $bp->groups->id; 150 158 $primary_id = implode( ',', (array)$groups['groups'] ); 151 $show_hidden = ( bp_is_my_profile()) ? 1 : 0;159 $show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0; 152 160 $user_id = false; 153 161 } 154 162 break; 155 163 case 'favorites': 156 $favs = bp_activity_get_user_favorites( $ bp->displayed_user->id );164 $favs = bp_activity_get_user_favorites( $current_user_id ); 157 165 $include = implode( ',', (array)$favs ); 158 $show_hidden = ( bp_is_my_profile()) ? 1 : 0;166 $show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0; 159 167 break; 160 168 case 'mentions': 169 $user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename; 170 $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login; 171 $search_terms = '@' . bp_core_get_username( $current_user_id, $user_nicename, $user_login ); 172 $show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0; 173 $display_comments = 'stream'; 161 174 $user_id = false; 162 $search_terms = '@' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );163 $show_hidden = ( bp_is_my_profile() ) ? 1 : 0;164 $display_comments = 'stream';165 175 break; 166 176 } … … 190 200 'user_id' => $user_id, // user_id to filter on 191 201 'object' => $object, // object to filter on e.g. groups, profile, status, friends 192 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated202 'action' => $action, // action to filter on e.g. activity_update, new_forum_post, profile_updated 193 203 'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 194 204 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id -
trunk/bp-blogs/bp-blogs-templatetags.php
r2389 r2488 127 127 global $blogs_template; 128 128 129 /*** 130 * Set the defaults based on the current page. Any of these will be overridden 131 * if arguments are directly passed into the loop. Custom plugins should always 132 * pass their parameters directly to the loop. 133 */ 134 $type = 'active'; 135 $user_id = false; 136 $page = 1; 137 138 /* User filtering */ 139 if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-blogs-scope'] ) 140 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 141 142 /* Action filtering */ 143 if ( !empty( $_COOKIE['bp-blogs-filter'] ) && '-1' != $_COOKIE['bp-blogs-filter'] ) 144 $type = $_COOKIE['bp-blogs-filter']; 145 146 if ( !empty( $_COOKIE['bp-blogs-page'] ) && '-1' != $_COOKIE['bp-blogs-page'] ) 147 $page = $_COOKIE['bp-blogs-page']; 148 129 149 $defaults = array( 130 'type' => 'active',131 'page' => 1,150 'type' => $type, 151 'page' => $page, 132 152 'per_page' => 20, 133 153 'max' => false, 134 154 135 'user_id' => false, // Pass a user_id to limit to only blogs this user has higher than subscriber access to155 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 136 156 'search_terms' => false // Pass search terms to filter on the blog title or description. 137 157 ); -
trunk/bp-core/bp-core-templatetags.php
r2485 r2488 118 118 global $bp, $members_template; 119 119 120 /*** 121 * Set the defaults based on the current page. Any of these will be overridden 122 * if arguments are directly passed into the loop. Custom plugins should always 123 * pass their parameters directly to the loop. 124 */ 125 $type = 'active'; 126 $user_id = false; 127 $page = 1; 128 129 /* User filtering */ 130 if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-members-scope'] ) 131 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 132 133 /* Action filtering */ 134 if ( !empty( $_COOKIE['bp-members-filter'] ) && '-1' != $_COOKIE['bp-members-filter'] ) 135 $type = $_COOKIE['bp-members-filter']; 136 137 if ( !empty( $_COOKIE['bp-members-page'] ) && '-1' != $_COOKIE['bp-members-page'] ) 138 $page = $_COOKIE['bp-members-page']; 139 120 140 // type: active ( default ) | random | newest | popular | online | alphabetical 121 141 $defaults = array( 122 'type' => 'active',123 'page' => 1,124 'per_page' => 10,142 'type' => $type, 143 'page' => $page, 144 'per_page' => 20, 125 145 'max' => false, 126 146 127 147 'include' => false, // Pass a user_id or comma separated list of user_ids to only show these users 128 148 129 'user_id' => false, // Pass a user_id to only show friends of this user149 'user_id' => $user_id, // Pass a user_id to only show friends of this user 130 150 'search_terms' => false, // Pass search_terms to filter users by their profile data 131 151 … … 134 154 135 155 $r = wp_parse_args( $args, $defaults ); 136 extract( $r , EXTR_SKIP);156 extract( $r ); 137 157 138 158 if ( $max ) { -
trunk/bp-forums/bp-forums-templatetags.php
r2460 r2488 153 153 global $forum_template, $bp; 154 154 155 /*** 156 * Set the defaults based on the current page. Any of these will be overridden 157 * if arguments are directly passed into the loop. Custom plugins should always 158 * pass their parameters directly to the loop. 159 */ 160 $type = 'newest'; 161 $user_id = false; 162 $page = 1; 163 164 /* User filtering */ 165 if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-forums-scope'] ) 166 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 167 168 /* Action filtering */ 169 if ( !empty( $_COOKIE['bp-forums-filter'] ) && '-1' != $_COOKIE['bp-forums-filter'] ) 170 $type = $_COOKIE['bp-forums-filter']; 171 172 if ( !empty( $_COOKIE['bp-forums-page'] ) && '-1' != $_COOKIE['bp-forums-page'] ) 173 $page = $_COOKIE['bp-forums-page']; 174 155 175 $defaults = array( 156 'type' => 'newest',176 'type' => $type, 157 177 'forum_id' => false, 158 'user_id' => false,159 'page' => 1,160 'per_page' => 15,178 'user_id' => $user_id, 179 'page' => $page, 180 'per_page' => 20, 161 181 'max' => false, 162 182 'no_stickies' => false, … … 165 185 166 186 $r = wp_parse_args( $args, $defaults ); 167 extract( $r , EXTR_SKIP);187 extract( $r ); 168 188 169 189 /* If we're in a single group, set this group's forum_id */ -
trunk/bp-groups/bp-groups-templatetags.php
r2471 r2488 171 171 global $groups_template, $bp; 172 172 173 /*** 174 * Set the defaults based on the current page. Any of these will be overridden 175 * if arguments are directly passed into the loop. Custom plugins should always 176 * pass their parameters directly to the loop. 177 */ 178 $type = 'active'; 179 $user_id = false; 180 $page = 1; 181 182 /* User filtering */ 183 if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-groups-scope'] ) 184 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 185 186 /* Action filtering */ 187 if ( !empty( $_COOKIE['bp-groups-filter'] ) && '-1' != $_COOKIE['bp-groups-filter'] ) 188 $type = $_COOKIE['bp-groups-filter']; 189 190 if ( !empty( $_COOKIE['bp-groups-page'] ) && '-1' != $_COOKIE['bp-groups-page'] ) 191 $page = $_COOKIE['bp-groups-page']; 192 173 193 $defaults = array( 174 'type' => 'active',175 'page' => 1,194 'type' => $type, 195 'page' => $page, 176 196 'per_page' => 20, 177 197 'max' => false, 178 198 179 'user_id' => false, // Pass a user ID to limit to groups this user has joined199 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined 180 200 'slug' => false, // Pass a group slug to only return that group 181 201 'search_terms' => false // Pass search terms to return only matching groups … … 183 203 184 204 $r = wp_parse_args( $args, $defaults ); 185 extract( $r , EXTR_SKIP);205 extract( $r ); 186 206 187 207 if ( '' == $args ) { -
trunk/bp-themes/bp-default/_inc/ajax.php
r2485 r2488 201 201 $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/favorites/feed/'; 202 202 break; 203 case ' atme':203 case 'mentions': 204 204 $query_string = 'show_hidden=1&search_terms=@' . bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ); 205 205 $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/mentions/feed/'; … … 228 228 229 229 /* Add the comments param */ 230 if ( $bp->displayed_user->id || ' atme' == $scope )230 if ( $bp->displayed_user->id || 'mentions' == $scope ) 231 231 $query_string .= '&display_comments=stream'; 232 232 else -
trunk/bp-themes/bp-default/_inc/global.js
r2485 r2488 5 5 /**** Page Load Actions *******************************************************/ 6 6 7 /* Activity */ 8 if ( j('div.activity').length && !j('div.activity').hasClass('no-ajax') ) { 9 /* If there's a hash URL, try and use it. */ 10 if ( location.hash.length ) 11 var scope = location.hash.substr( 1, location.hash.length - 2 ); 12 else 13 var scope = j.cookie('bp-activity-scope'); 14 15 bp_activity_request( scope, j.cookie('bp-activity-filter') ); 7 /* Activity Filter Select Set */ 8 if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length ) 9 j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' ); 10 11 /* Activity Tab Set */ 12 if ( null != j.cookie('bp-activity-scope') && j('div.item-list-tabs').length ) { 13 j('div.item-list-tabs li').each( function() { 14 j(this).removeClass('selected'); 15 }); 16 j('li#activity-' + j.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected'); 16 17 } 17 18 18 /* Members */ 19 if ( j('div.members').length ) 20 bp_filter_request( 'members', j.cookie('bp-members-filter'), j.cookie('bp-members-scope'), 'div.members', false, 1, j.cookie('bp-members-extras') ); 21 22 /* Groups */ 23 if ( j('div.groups').length ) 24 bp_filter_request( 'groups', j.cookie('bp-groups-filter'), j.cookie('bp-groups-scope'), 'div.groups', false, 1, j.cookie('bp-groups-extras') ); 25 26 /* Blogs */ 27 if ( j('div.blogs').length ) 28 bp_filter_request( 'blogs', j.cookie('bp-blogs-filter'), j.cookie('bp-blogs-scope'), 'div.blogs', false, 1, j.cookie('bp-blogs-extras') ); 29 30 /* Forums */ 31 if ( j('div.forums').length ) { 19 /* Hide Forums Post Form */ 20 if ( j('div.forums').length ) 32 21 j('div#new-topic-post').hide(); 33 bp_filter_request( 'forums', j.cookie('bp-forums-filter'), j.cookie('bp-forums-scope'), 'div.forums', false, 1, j.cookie('bp-forums-extras') ); 34 } 22 23 /* Object filter and scope set. */ 24 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 25 j(objects).each( function(i) { 26 if ( null != j.cookie('bp-' + objects[i] + '-filter') && j('div.' + objects[i]).length ) 27 j('li#' + objects[i] + '-order-select select option[value=' + j.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' ); 28 29 if ( null != j.cookie('bp-' + objects[i] + '-scope') && j('div.' + objects[i]).length ) { 30 j('div.item-list-tabs li').each( function() { 31 j(this).removeClass('selected'); 32 }); 33 j('div.item-list-tabs li#' + objects[i] + '-' + j.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected'); 34 } 35 }); 35 36 36 37 /* @mention Compose Scrolling */ … … 117 118 var filter = j("#activity-filter-select select").val(); 118 119 119 if ( scope == ' atme' )120 if ( scope == 'mentions' ) 120 121 j( 'li#' + target.attr('id') + ' a strong' ).remove(); 121 122 … … 168 169 if ( 'fav' == type ) { 169 170 if ( !j('div.item-list-tabs li#activity-favorites').length ) 170 j('div.item-list-tabs ul li#activity- atme').before( '<li id="activity-favorites"><a href="#">' + bp_terms_my_favs + ' (<span>0</span>)</a></li>');171 j('div.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + bp_terms_my_favs + ' (<span>0</span>)</a></li>'); 171 172 172 173 target.removeClass('fav'); … … 972 973 }); 973 974 974 /* Clear specificcookies on logout */975 /* Clear BP cookies on logout */ 975 976 j('a.logout').click( function() { 976 977 j.cookie('bp-activity-scope', null); 977 978 j.cookie('bp-activity-filter', null); 978 979 j.cookie('bp-activity-querystring', null); 980 981 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 982 j(objects).each( function(i) { 983 j.cookie('bp-' + objects[i] + '-scope', null ); 984 j.cookie('bp-' + objects[i] + '-filter', null ); 985 j.cookie('bp-' + objects[i] + '-search-terms', null ); 986 j.cookie('bp-' + objects[i] + '-page', null ); 987 j.cookie('bp-' + objects[i] + '-extras', null ); 988 }); 979 989 }); 980 990 }); -
trunk/bp-themes/bp-default/activity/index.php
r2485 r2488 38 38 <?php endif; ?> 39 39 40 <li id="activity- atme"><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>40 <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> 41 41 42 42 <?php endif; ?> … … 72 72 73 73 <div class="activity"> 74 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 75 <noscript><?php locate_template( array( 'activity/activity-loop.php' ), true ) ?></noscript> 74 <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?> 76 75 </div><!-- .activity --> 77 76 -
trunk/bp-themes/bp-default/blogs/index.php
r2455 r2488 39 39 40 40 <div id="blogs-dir-list" class="blogs dir-list"> 41 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 42 <noscript><?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?></noscript> 41 <?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?> 43 42 </div><!-- #blogs-dir-list --> 44 43 -
trunk/bp-themes/bp-default/forums/index.php
r2455 r2488 93 93 94 94 <div id="forums-dir-list" class="forums dir-list"> 95 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 96 <noscript><?php locate_template( array( 'forums/forums-loop.php' ), true ) ?></noscript> 95 <?php locate_template( array( 'forums/forums-loop.php' ), true ) ?> 97 96 </div> 98 97 -
trunk/bp-themes/bp-default/groups/index.php
r2455 r2488 39 39 40 40 <div id="groups-dir-list" class="groups dir-list"> 41 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 42 <noscript><?php locate_template( array( 'groups/groups-loop.php' ), true ) ?></noscript> 41 <?php locate_template( array( 'groups/groups-loop.php' ), true ) ?> 43 42 </div><!-- #groups-dir-list --> 44 43 -
trunk/bp-themes/bp-default/groups/single/activity.php
r2459 r2488 29 29 30 30 <div class="activity single-group"> 31 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 32 <noscript><?php locate_template( array( 'activity/activity-loop.php' ), true ) ?></noscript> 31 <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?> 33 32 </div><!-- .activity --> 34 33 -
trunk/bp-themes/bp-default/groups/single/forum.php
r2460 r2488 10 10 11 11 <div class="forums single-forum"> 12 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 13 <noscript><?php locate_template( array( 'forums/forums-loop.php' ), true ) ?></noscript> 12 <?php locate_template( array( 'forums/forums-loop.php' ), true ) ?> 14 13 </div><!-- .forums --> 15 14 -
trunk/bp-themes/bp-default/members/index.php
r2455 r2488 39 39 40 40 <div id="members-dir-list" class="members dir-list"> 41 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 42 <noscript><?php locate_template( array( 'members/members-loop.php' ), true ) ?></noscript> 41 <?php locate_template( array( 'members/members-loop.php' ), true ) ?> 43 42 </div><!-- #members-dir-list --> 44 43 -
trunk/bp-themes/bp-default/members/single/activity.php
r2485 r2488 31 31 32 32 <div class="activity"> 33 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 34 <noscript><?php locate_template( array( 'activity/activity-loop.php' ), true ) ?></noscript> 33 <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?> 35 34 </div><!-- .activity --> 36 35 -
trunk/bp-themes/bp-default/members/single/blogs.php
r2455 r2488 19 19 20 20 <div class="blogs myblogs"> 21 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 22 <noscript><?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?></noscript> 21 <?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?> 23 22 </div><!-- .blogs --> 24 23 -
trunk/bp-themes/bp-default/members/single/friends.php
r2455 r2488 27 27 28 28 <div class="members friends"> 29 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 30 <noscript><?php locate_template( array( 'members/members-loop.php' ), true ) ?></noscript> 29 <?php locate_template( array( 'members/members-loop.php' ), true ) ?> 31 30 </div> 32 31 -
trunk/bp-themes/bp-default/members/single/groups.php
r2455 r2488 30 30 31 31 <div class="groups mygroups"> 32 <?php // The loop will be loaded here via AJAX on page load to retain selected settings and not waste cycles. ?> 33 <noscript><?php locate_template( array( 'groups/groups-loop.php' ), true ) ?></noscript> 32 <?php locate_template( array( 'groups/groups-loop.php' ), true ) ?> 34 33 </div> 35 34
Note: See TracChangeset
for help on using the changeset viewer.