Changeset 1839 for trunk/bp-activity/bp-activity-templatetags.php
- Timestamp:
- 09/10/2009 01:24:01 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-templatetags.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r1834 r1839 17 17 var $full_name; 18 18 19 function bp_activity_template( $type, $user_id, $per_page, $max, $ timeframe, $filter ) {19 function bp_activity_template( $type, $user_id, $per_page, $max, $filter ) { 20 20 global $bp; 21 21 … … 28 28 29 29 if ( $type == 'personal' ) 30 $this->activities = bp_activity_get_user_activity( $user_id, $max, $t imeframe, $this->pag_num, $this->pag_page, $filter );30 $this->activities = bp_activity_get_user_activity( $user_id, $max, $this->pag_num, $this->pag_page, $filter ); 31 31 32 32 if ( $type == 'friends' && ( bp_is_home() || is_site_admin() || $bp->loggedin_user->id == $user_id ) ) 33 $this->activities = bp_activity_get_friends_activity( $user_id, $max, $timeframe,false, $this->pag_num, $this->pag_page, $filter );33 $this->activities = bp_activity_get_friends_activity( $user_id, $max, false, $this->pag_num, $this->pag_page, $filter ); 34 34 35 35 if ( !$max || $max >= (int)$this->activities['total'] ) … … 89 89 return true; 90 90 } elseif ( $this->current_activity + 1 == $this->activity_count ) { 91 do_action(' loop_end');91 do_action('activity_loop_end'); 92 92 // Do some cleaning up after the loop 93 93 $this->rewind_activities(); … … 108 108 109 109 if ( $this->current_activity == 0 ) // loop has just started 110 do_action(' loop_start');110 do_action('activity_loop_start'); 111 111 } 112 112 } … … 125 125 function bp_has_activities( $args = '' ) { 126 126 global $bp, $activities_template, $bp_activity_user_id, $bp_activity_limit; 127 127 128 /* Note: any params used for filtering can be a single value, or multiple values comma seperated. */ 129 128 130 $defaults = array( 129 131 'type' => 'sitewide', 130 'user_id' => false,131 132 'per_page' => 25, 132 133 'max' => false, 133 'timeframe' => '-4 weeks', 134 'filter' => false 134 'user_id' => false, // user_id to filter on 135 'object' => false, // object to filter on e.g. groups, profile, status, friends 136 'action' => false, // action to filter on e.g. new_wire_post, new_forum_post, profile_updated 137 'primary_id' => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 138 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id 135 139 ); 136 140 … … 162 166 163 167 if ( isset( $_GET['afilter'] ) ) 164 $filter = $_GET['afilter']; 165 166 $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $timeframe, $filter ); 168 $filter = array( 'object' => $_GET['afilter'] ); 169 else 170 $filter = array( 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id ); 171 172 $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $filter ); 167 173 return $activities_template->has_activities(); 168 174 }
Note: See TracChangeset
for help on using the changeset viewer.