Changeset 3728 for trunk/bp-activity/bp-activity-templatetags.php
- Timestamp:
- 01/18/2011 12:53:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r3685 r3728 176 176 177 177 // The default scope should recognize custom slugs 178 if ( array_key_exists( $bp->current_action, (array)$bp->active_components ) ) {178 if ( array_key_exists( $bp->current_action, (array)$bp->active_components ) ) 179 179 $scope = $bp->active_components[$bp->current_action]; 180 } else {180 else 181 181 $scope = $bp->current_action; 182 } 183 184 /* Support for permalinks on single item pages: /groups/my-group/activity/124/ */ 182 183 // Support for permalinks on single item pages: /groups/my-group/activity/124/ 185 184 if ( $bp->current_action == $bp->activity->slug ) 186 185 $include = $bp->action_variables[0]; 187 186 188 / * Note: any params used for filtering can be a single value, or multiple values comma separated. */187 // Note: any params used for filtering can be a single value, or multiple values comma separated. 189 188 $defaults = array( 190 'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items191 'include' => $include,// pass an activity_id or string of IDs comma-separated192 'exclude' => $exclude,// pass an activity_id or string of IDs comma-separated193 'in' => $in,// comma-separated list or array of activity IDs among which to search194 'sort' => 'DESC',// sort DESC or ASC195 'page' => 1,// which page to load196 'per_page' => 20,// number of items per page197 'max' => false,// max number to return198 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?199 200 / * Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) */201 'scope' => $bp->current_action,202 203 / * Filtering */204 'user_id' => $user_id,// user_id to filter on205 'object' => $object,// object to filter on e.g. groups, profile, status, friends206 'action' => false,// action to filter on e.g. activity_update, new_forum_post, profile_updated207 'primary_id' => $primary_id,// object ID to filter on e.g. a group_id or forum_id or blog_id etc.208 'secondary_id' => false,// secondary object ID to filter on e.g. a post_id209 210 / * Searching */211 'search_terms' => false// specify terms to search on189 'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items 190 'include' => $include, // pass an activity_id or string of IDs comma-separated 191 'exclude' => $exclude, // pass an activity_id or string of IDs comma-separated 192 'in' => $in, // comma-separated list or array of activity IDs among which to search 193 'sort' => 'DESC', // sort DESC or ASC 194 'page' => 1, // which page to load 195 'per_page' => 20, // number of items per page 196 'max' => false, // max number to return 197 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? 198 199 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) 200 'scope' => $scope, 201 202 // Filtering 203 'user_id' => $user_id, // user_id to filter on 204 'object' => $object, // object to filter on e.g. groups, profile, status, friends 205 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated 206 'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 207 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id 208 209 // Searching 210 'search_terms' => false // specify terms to search on 212 211 ); 213 212 … … 215 214 extract( $r ); 216 215 217 / * If you have passed a "scope" then this will override any filters you have passed. */216 // If you have passed a "scope" then this will override any filters you have passed. 218 217 if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) { 219 218 if ( 'just-me' == $scope ) … … 272 271 } 273 272 274 /* Support for basic filters in earlier BP versions. */ 275 $filter = false; 273 // Support for basic filters in earlier BP versions. 276 274 if ( isset( $_GET['afilter'] ) ) 277 275 $filter = array( 'object' => $_GET['afilter'] ); 278 276 else if ( !empty( $user_id ) || !empty( $object ) || !empty( $action ) || !empty( $primary_id ) || !empty( $secondary_id ) ) 279 277 $filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id ); 278 else 279 $filter = false; 280 280 281 281 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in );
Note: See TracChangeset
for help on using the changeset viewer.