Changeset 641
- Timestamp:
- 12/10/2008 07:19:46 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 13 added
- 19 edited
-
bp-activity.php (modified) (9 diffs)
-
bp-activity/bp-activity-classes.php (modified) (6 diffs)
-
bp-activity/bp-activity-filters.php (added)
-
bp-activity/bp-activity-templatetags.php (modified) (10 diffs)
-
bp-activity/bp-activity-widgets.php (modified) (1 diff)
-
bp-blogs.php (modified) (2 diffs)
-
bp-blogs/bp-blogs-templatetags.php (modified) (16 diffs)
-
bp-core/bp-core-catchuri.php (modified) (1 diff)
-
bp-core/bp-core-templatetags.php (modified) (14 diffs)
-
bp-forums (added)
-
bp-forums.php (added)
-
bp-forums/bbpress-plugins (added)
-
bp-forums/bbpress-plugins/buddypress-enable.php (added)
-
bp-forums/bp-forums-admin.php (added)
-
bp-forums/bp-forums-bbpress-live.php (added)
-
bp-forums/bp-forums-filters.php (added)
-
bp-forums/bp-forums-templatetags.php (added)
-
bp-friends.php (modified) (3 diffs)
-
bp-friends/bp-friends-filters.php (added)
-
bp-friends/bp-friends-templatetags.php (modified) (11 diffs)
-
bp-groups.php (modified) (16 diffs)
-
bp-groups/bp-groups-ajax.php (modified) (1 diff)
-
bp-groups/bp-groups-filters.php (added)
-
bp-groups/bp-groups-templatetags.php (modified) (43 diffs)
-
bp-messages.php (modified) (2 diffs)
-
bp-messages/bp-messages-filters.php (added)
-
bp-messages/bp-messages-templatetags.php (modified) (8 diffs)
-
bp-wire.php (modified) (2 diffs)
-
bp-wire/bp-wire-filters.php (added)
-
bp-wire/bp-wire-templatetags.php (modified) (14 diffs)
-
bp-xprofile.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-templatetags.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r601 r641 3 3 4 4 define ( 'BP_ACTIVITY_IS_INSTALLED', 1 ); 5 define ( 'BP_ACTIVITY_VERSION', '0.2. 6' );5 define ( 'BP_ACTIVITY_VERSION', '0.2.8' ); 6 6 7 7 /* How long before activity items in streams are re-cached? */ … … 12 12 include_once( 'bp-activity/bp-activity-widgets.php' ); 13 13 include_once( 'bp-activity/bp-activity-cssjs.php' ); 14 //include_once( 'bp-activity/bp-activity-ajax.php' );14 include_once( 'bp-activity/bp-activity-filters.php' ); 15 15 //include_once( 'bp-activity/bp-activity-admin.php' ); 16 16 … … 30 30 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 31 31 item_id int(11) NOT NULL, 32 secondary_item_id int(11), 32 33 user_id int(11) NOT NULL, 33 34 component_name varchar(75) NOT NULL, … … 43 44 $sql[] = "CREATE TABLE ". $bp['activity']['table_name_current_user_cached'] ." ( 44 45 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 46 item_id int(11) NOT NULL, 47 secondary_item_id int(11), 45 48 content longtext NOT NULL, 46 49 primary_link varchar(150) NOT NULL, … … 52 55 KEY date_recorded (date_recorded), 53 56 KEY is_private (is_private), 57 KEY item_id (item_id), 54 58 KEY component_name (component_name) 55 59 ) {$charset_collate};"; … … 90 94 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 91 95 user_id int(11) NOT NULL, 96 item_id int(11) NOT NULL, 97 secondary_item_id int(11), 92 98 content longtext NOT NULL, 93 99 primary_link varchar(150) NOT NULL, … … 98 104 KEY date_recorded (date_recorded), 99 105 KEY user_id (user_id), 106 KEY item_id (item_id), 100 107 KEY component_name (component_name) 101 108 ) {$charset_collate};"; … … 197 204 /***** Actions **********/ 198 205 199 function bp_activity_record( $item_id, $component_name, $component_action, $is_private, $ user_id = false, $secondary_user_id = false ) {206 function bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id = false, $user_id = false, $secondary_user_id = false ) { 200 207 global $bp, $wpdb; 201 208 … … 207 214 $activity = new BP_Activity_Activity; 208 215 $activity->item_id = $item_id; 216 $activity->secondary_item_id = $secondary_item_id; 209 217 $activity->user_id = $user_id; 210 218 $activity->component_name = $component_name; -
trunk/bp-activity/bp-activity-classes.php
r635 r641 4 4 var $id; 5 5 var $item_id; 6 var $secondary_item_id; 6 7 var $user_id; 7 8 var $primary_link; … … 32 33 33 34 $this->item_id = $activity->item_id; 35 $this->secondary_item_id = $activity->secondary_item_id; 34 36 $this->user_id = $activity->user_id; 35 37 $this->component_name = $activity->component_name; … … 51 53 if ( !$this->exists() ) { 52 54 // Insert the new activity into the activity table. 53 $activity = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name . " ( item_id, user_id, component_name, component_action, date_recorded, is_private ) VALUES ( %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_recorded, $this->is_private ) );55 $activity = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name . " ( item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, is_private ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_recorded, $this->is_private ) ); 54 56 55 57 // Fetch the formatted activity content so we can add it to the cache. 56 58 if ( function_exists( $bp[$this->component_name]['format_activity_function'] ) ) { 57 if ( !$activity_content = call_user_func($bp[$this->component_name]['format_activity_function'], $this->item_id, $this->user_id, $this->component_action, $this-> for_secondary_user ) )59 if ( !$activity_content = call_user_func($bp[$this->component_name]['format_activity_function'], $this->item_id, $this->user_id, $this->component_action, $this->secondary_item_id, $this->for_secondary_user ) ) 58 60 return false; 59 61 } 60 62 61 63 // Add the cached version of the activity to the cached activity table. 62 $activity_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name_cached . " ( content, primary_link, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d), %d )", $activity_content['content'], $activity_content['primary_link'], $this->component_name, time(), $this->date_recorded, $this->is_private ) );64 $activity_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name_cached . " ( item_id, secondary_item_id, content, primary_link, component_name, date_cached, date_recorded, is_private ) VALUES ( %d, %d, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, time(), $this->date_recorded, $this->is_private ) ); 63 65 64 66 // Add the cached version of the activity to the cached activity table. 65 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, primary_link, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $bp['loggedin_userid'], $activity_content['content'], $activity_content['primary_link'], $this->component_name, time(), $this->date_recorded ) );67 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, item_id, secondary_item_id, content, primary_link, component_name, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $bp['loggedin_userid'], $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, time(), $this->date_recorded ) ); 66 68 67 69 if ( $activity && $activity_cached ) … … 74 76 function exists() { 75 77 global $wpdb, $bp; 76 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM " . $this->table_name . " WHERE item_id = %d AND user_id = %d AND component_name = %s AND component_action = %s", $this->item_id, $this->user_id, $this->component_name, $this->component_action ) );78 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM " . $this->table_name . " WHERE item_id = %d AND secondary_item_id = %d AND user_id = %d AND component_name = %s AND component_action = %s", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action ) ); 77 79 } 78 80 79 81 /* Static Functions */ 80 82 81 function delete( $item_id, $ user_id, $component_name, $component_action ) {82 global $wpdb, $bp; 83 84 return $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_loggedin_user'] . " WHERE item_id = %d AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) );83 function delete( $item_id, $secondary_item_id, $user_id, $component_name, $component_action ) { 84 global $wpdb, $bp; 85 86 return $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_loggedin_user'] . " WHERE item_id = %d AND secondary_item_id = %d AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $secondary_item_id, $user_id, $component_name, $component_action ) ); 85 87 } 86 88 … … 134 136 $activities_formatted[$i]['content'] = $content['content']; 135 137 $activities_formatted[$i]['primary_link'] = $content['primary_link']; 138 $activities_formatted[$i]['item_id'] = $activities[$i]->item_id; 139 $activities_formatted[$i]['secondary_item_id'] = $activities[$i]->secondary_item_id; 136 140 $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded; 137 141 $activities_formatted[$i]['component_name'] = $activities[$i]->component_name; … … 279 283 280 284 // Cache that sucka... 281 282 //echo $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_current_user_cached'] . " ( content, primary_link, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %s, FROM_UNIXTIME(%d), %s, %d )", $activity_array[$i]['content'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'], $activity_array[$i]['is_private'] ); 283 284 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_current_user_cached'] . " ( content, primary_link, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %s, %s, FROM_UNIXTIME(%d), %s, %d )", $activity_array[$i]['content'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'], $activity_array[$i]['is_private'] ) ); 285 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_current_user_cached'] . " ( content, item_id, secondary_item_id, primary_link, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %d, %d, %s, %s, FROM_UNIXTIME(%d), %s, %d )", $activity_array[$i]['content'], $activity_array[$i]['item_id'], $activity_array[$i]['secondary_item_id'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'], $activity_array[$i]['is_private'] ) ); 285 286 286 287 // Add to the sitewide activity stream 287 288 if ( !$activity_array[$i]['is_private'] ) 288 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, primary_link, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, %s, FROM_UNIXTIME(%d), %s )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'] ) );289 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, item_id, secondary_item_id, primary_link, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %d, %d, %s, %s, FROM_UNIXTIME(%d), %s )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['item_id'], $activity_array[$i]['secondary_item_id'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'] ) ); 289 290 } 290 291 -
trunk/bp-activity/bp-activity-templatetags.php
r626 r641 126 126 function bp_activities_title() { 127 127 global $bp_activity_title; 128 echo $bp_activity_title;128 echo apply_filters( 'bp_activities_title', $bp_activity_title ); 129 129 } 130 130 131 131 function bp_activities_no_activity() { 132 132 global $bp_activity_no_activity; 133 echo $bp_activity_no_activity;133 echo apply_filters( 'bp_activities_no_activity', $bp_activity_no_activity ); 134 134 } 135 135 … … 139 139 if ( $activities_template->filter_content ) { 140 140 if ( $activities_template->is_home ) { 141 echo bp_activity_content_filter( $activities_template->activity['content'], $activities_template->activity['date_recorded'], $activities_template->full_name);141 echo apply_filters( 'bp_activity_content', bp_activity_content_filter( $activities_template->activity['content'], $activities_template->activity['date_recorded'], $activities_template->full_name ) ); 142 142 } else { 143 echo bp_activity_content_filter( $activities_template->activity['content'], $activities_template->activity['date_recorded'], $activities_template->full_name, true, false, false);143 echo apply_filters( 'bp_activity_content', bp_activity_content_filter( $activities_template->activity['content'], $activities_template->activity['date_recorded'], $activities_template->full_name, true, false, false ) ); 144 144 } 145 145 } else { 146 146 $activities_template->activity['content'] = bp_activity_insert_time_since( $activities_template->activity['content'], $activities_template->activity['date_recorded'] ); 147 echo $activities_template->activity['content'];147 echo apply_filters( 'bp_activity_content', $activities_template->activity['content'] ); 148 148 } 149 149 } … … 176 176 $content_new .= $content[$i]; 177 177 178 return $content_new;178 return apply_filters( 'bp_activity_content_filter', $content_new ); 179 179 } 180 180 … … 183 183 return false; 184 184 185 return @sprintf( $content, @sprintf( __( ' %s ago', 'buddypress' ), bp_core_time_since( strtotime( $date) ) ) );185 return apply_filters( 'bp_activity_insert_time_since', @sprintf( $content, @sprintf( __( ' %s ago', 'buddypress' ), bp_core_time_since( strtotime( $date ) ) ) ) ); 186 186 } 187 187 188 188 function bp_activity_css_class() { 189 189 global $activities_template; 190 echo $activities_template->activity['component_name'];190 echo apply_filters( 'bp_activity_css_class', $activities_template->activity['component_name'] ); 191 191 } 192 192 … … 194 194 global $bp; 195 195 196 echo site_url() . '/' . $bp['activity']['slug'] . '/feed';196 echo apply_filters( 'bp_sitewide_activity_feed_link', site_url() . '/' . $bp['activity']['slug'] . '/feed' ); 197 197 } 198 198 … … 201 201 202 202 if ( ( $bp['current_component'] == $bp['profile']['slug'] ) || $bp['current_action'] == 'just-me' ) 203 echo $bp['current_domain'] . $bp['activity']['slug'] . '/feed';203 echo apply_filters( 'bp_activities_member_rss_link', $bp['current_domain'] . $bp['activity']['slug'] . '/feed' ); 204 204 else 205 echo $bp['current_domain'] . $bp['activity']['slug'] . '/my-friends/feed';205 echo apply_filters( 'bp_activities_member_rss_link', $bp['current_domain'] . $bp['activity']['slug'] . '/my-friends/feed' ); 206 206 } 207 207 … … 212 212 213 213 $title = explode( '<span', $activities_template->activity['content'] ); 214 echo trim( strip_tags( $title[0]) );214 echo apply_filters( 'bp_activity_feed_item_title', trim( strip_tags( $title[0] ) ) ); 215 215 } 216 216 … … 218 218 global $activities_template; 219 219 220 echo $activities_template->activity['primary_link'];220 echo apply_filters( 'bp_activity_feed_item_link', $activities_template->activity['primary_link'] ); 221 221 } 222 222 … … 224 224 global $activities_template; 225 225 226 echo $activities_template->activity['date_recorded'];226 echo apply_filters( 'bp_activity_feed_item_date', $activities_template->activity['date_recorded'] ); 227 227 } 228 228 … … 230 230 global $activities_template; 231 231 232 echo sprintf( $activities_template->activity['content'], '');232 echo apply_filters( 'bp_activity_feed_item_description', sprintf( $activities_template->activity['content'], '' ) ); 233 233 } 234 234 -
trunk/bp-activity/bp-activity-widgets.php
r601 r641 38 38 <?php foreach( $activity as $item ) : ?> 39 39 <li class="<?php echo $item['component_name'] ?>"> 40 <?php echo bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true );?>40 <?php echo apply_filters( 'bp_activity_content', bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true ) ); ?> 41 41 </li> 42 42 <?php endforeach; ?> -
trunk/bp-blogs.php
r623 r641 223 223 extract($args); 224 224 225 bp_activity_record( $item_id, $component_name, $component_action, $is_private, $user_id );225 bp_activity_record( $item_id, $component_name, $component_action, $is_private, false, $user_id ); 226 226 } 227 227 } … … 236 236 **************************************************************************/ 237 237 238 function bp_blogs_format_activity( $item_id, $user_id, $action, $ for_secondary_user = false ) {238 function bp_blogs_format_activity( $item_id, $user_id, $action, $secondary_item_id = false, $for_secondary_user = false ) { 239 239 global $bp; 240 240 -
trunk/bp-blogs/bp-blogs-templatetags.php
r633 r641 104 104 function bp_blog_title() { 105 105 global $blogs_template; 106 echo $blogs_template->blog['title'];106 echo apply_filters( 'bp_blog_title', $blogs_template->blog['title'] ); 107 107 } 108 108 109 109 function bp_blog_description() { 110 110 global $blogs_template; 111 echo $blogs_template->blog['description'];111 echo apply_filters( 'bp_blog_description', $blogs_template->blog['description'] ); 112 112 } 113 113 114 114 function bp_blog_permalink() { 115 115 global $blogs_template; 116 echo $blogs_template->blog['siteurl'];116 echo apply_filters( 'bp_blog_permalink', $blogs_template->blog['siteurl'] ); 117 117 } 118 118 … … 225 225 226 226 if ( $echo ) 227 echo $posts_template->post->post_title;228 else 229 return $posts_template->post->post_title;227 echo apply_filters( 'bp_post_title', $posts_template->post->post_title ); 228 else 229 return apply_filters( 'bp_post_title', $posts_template->post->post_title ); 230 230 } 231 231 232 232 function bp_post_permalink() { 233 233 global $posts_template; 234 echo bp_post_get_permalink();234 echo apply_filters( 'bp_post_permalink', bp_post_get_permalink() ); 235 235 } 236 236 237 237 function bp_post_excerpt() { 238 238 global $posts_template; 239 echo $posts_template->post->post_excerpt;239 echo apply_filters( 'bp_post_excerpt', $posts_template->post->post_excerpt ); 240 240 } 241 241 … … 245 245 $content = apply_filters('the_content', $content); 246 246 $content = str_replace(']]>', ']]>', $content); 247 echo $content;247 echo apply_filters( 'bp_post_content', $content ); 248 248 } 249 249 250 250 function bp_post_status() { 251 251 global $posts_template; 252 echo $posts_template->post->post_status;252 echo apply_filters( 'bp_post_status', $posts_template->post->post_status ); 253 253 } 254 254 … … 260 260 261 261 if ( $echo ) 262 echo mysql2date( $date_format, $posts_template->post->post_date);263 else 264 return mysql2date( $date_format, $posts_template->post->post_date);262 echo apply_filters( 'bp_post_date', mysql2date( $date_format, $posts_template->post->post_date ) ); 263 else 264 return apply_filters( 'bp_post_date', mysql2date( $date_format, $posts_template->post->post_date ) ); 265 265 } 266 266 267 267 function bp_post_comment_count() { 268 268 global $posts_template; 269 echo $posts_template->post->comment_count;269 echo apply_filters( 'bp_post_comment_count', $posts_template->post->comment_count ); 270 270 } 271 271 … … 311 311 312 312 if ( $echo ) 313 echo bp_core_get_userlink( $posts_template->post->post_author);314 else 315 return bp_core_get_userlink( $posts_template->post->post_author);313 echo apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) ); 314 else 315 return apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) ); 316 316 } 317 317 318 318 function bp_post_id() { 319 319 global $posts_template; 320 echo $posts_template->post->ID;320 echo apply_filters( 'bp_post_id', $posts_template->post->ID ); 321 321 } 322 322 … … 325 325 326 326 if ( $echo ) 327 echo get_the_category_list( $separator, $parents, $posts_template->post->ID);328 else 329 return get_the_category_list( $separator, $parents, $posts_template->post->ID);327 echo apply_filters( 'bp_post_category', get_the_category_list( $separator, $parents, $posts_template->post->ID ) ); 328 else 329 return apply_filters( 'bp_post_category', get_the_category_list( $separator, $parents, $posts_template->post->ID ) ); 330 330 } 331 331 … … 339 339 function bp_post_blog_id() { 340 340 global $posts_template; 341 echo $posts_template->post->blog_id;341 echo apply_filters( 'bp_post_blog_id', $posts_template->post->blog_id ); 342 342 } 343 343 344 344 function bp_post_blog_title() { 345 345 global $posts_template; 346 echo $posts_template->post->blog_id;346 echo apply_filters( 'bp_post_blog_title', $posts_template->post->blog_id ); 347 347 } 348 348 349 349 function bp_post_blog_description() { 350 350 global $posts_template; 351 echo $posts_template->post->blog_id;351 echo apply_filters( 'bp_post_blog_description', $posts_template->post->blog_id ); 352 352 } 353 353 354 354 function bp_post_blog_permalink() { 355 355 global $posts_template; 356 echo $posts_template->post->blog_id;356 echo apply_filters( 'bp_post_blog_permalink', $posts_template->post->blog_id ); 357 357 } 358 358 … … 568 568 function bp_comment_id() { 569 569 global $comments_template; 570 echo $comments_template->comment->comment_ID;570 echo apply_filters( 'bp_comment_id', $comments_template->comment->comment_ID ); 571 571 } 572 572 … … 575 575 576 576 if ( $echo ) 577 echo bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID;578 else 579 return bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID;577 echo apply_filters( 'bp_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID ); 578 else 579 return apply_filters( 'bp_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID ); 580 580 } 581 581 … … 584 584 585 585 if ( $echo ) 586 echo $comments_template->comment->post->post_title;587 else 588 return $comments_template->comment->post->post_title;586 echo apply_filters( 'bp_comment_post_title', $comments_template->comment->post->post_title ); 587 else 588 return apply_filters( 'bp_comment_post_title', $comments_template->comment->post->post_title ); 589 589 } 590 590 … … 593 593 594 594 if ( $echo ) 595 echo bp_core_get_userlink( $comments_template->comment->user_id);596 else 597 return bp_core_get_userlink( $comments_template->comment->user_id);595 echo apply_filters( 'bp_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) ); 596 else 597 return apply_filters( 'bp_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) ); 598 598 } 599 599 … … 603 603 $content = apply_filters('the_content', $content); 604 604 $content = str_replace(']]>', ']]>', $content); 605 echo $content;605 echo apply_filters( 'bp_comment_content', $content ); 606 606 } 607 607 … … 613 613 614 614 if ( $echo == true ) 615 echo mysql2date( $date_format, $comments_template->comment->post->post_date);615 echo apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->post->post_date ) ); 616 616 else 617 return mysql2date( $date_format, $comments_template->comment->post->post_date);617 return apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->post->post_date ) ); 618 618 } 619 619 … … 622 622 623 623 if ( $echo ) 624 echo get_blog_option( $comments_template->comment->blog_id, 'siteurl');625 else 626 return get_blog_option( $comments_template->comment->blog_id, 'siteurl');624 echo apply_filters( 'bp_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) ); 625 else 626 return apply_filters( 'bp_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) ); 627 627 } 628 628 … … 631 631 632 632 if ( $echo ) 633 echo get_blog_option( $comments_template->comment->blog_id, 'blogname');634 else 635 return get_blog_option( $comments_template->comment->blog_id, 'blogname');633 echo apply_filters( 'bp_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) ); 634 else 635 return apply_filters( 'bp_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) ); 636 636 } 637 637 … … 800 800 801 801 if ( bp_is_home() ) { 802 echo '<a href="' . $bp['loggedin_domain'] . $bp['blogs']['slug'] . '/create-a-blog">' . __('Create a Blog', 'buddypress') . '</a>';802 echo apply_filters( 'bp_create_blog_link', '<a href="' . $bp['loggedin_domain'] . $bp['blogs']['slug'] . '/create-a-blog">' . __('Create a Blog', 'buddypress') . '</a>' ); 803 803 } 804 804 } -
trunk/bp-core/bp-core-catchuri.php
r639 r641 211 211 function bp_core_catch_no_access() { 212 212 global $bp, $bp_path, $bp_no_status_set; 213 213 214 214 // If bp_core_redirect() and $bp_no_status_set is true, 215 215 // we are redirecting to an accessable page, so skip this check. -
trunk/bp-core/bp-core-templatetags.php
r638 r641 169 169 global $bp; 170 170 171 echo $bp['bp_options_avatar'];171 echo apply_filters( 'bp_get_options_avatar', $bp['bp_options_avatar'] ); 172 172 } 173 173 … … 178 178 $bp['bp_options_title'] = __('Options', 'buddypress'); 179 179 180 echo $bp['bp_options_title'];180 echo apply_filters( 'bp_get_options_avatar', $bp['bp_options_title'] ); 181 181 } 182 182 … … 194 194 195 195 if ( function_exists('bp_core_get_avatar') ) { 196 echo bp_core_get_avatar( $comment->user_id, 1);196 echo apply_filters( 'bp_comment_author_avatar', bp_core_get_avatar( $comment->user_id, 1 ) ); 197 197 } else if ( function_exists('get_avatar') ) { 198 198 get_avatar(); … … 204 204 205 205 if ( function_exists('bp_core_get_avatar') ) { 206 echo bp_core_get_avatar( $post->post_author, 1);206 echo apply_filters( 'bp_post_author_avatar', bp_core_get_avatar( $post->post_author, 1 ) ); 207 207 } else if ( function_exists('get_avatar') ) { 208 208 get_avatar(); … … 214 214 215 215 if ( $width && $height ) 216 echo bp_core_get_avatar( $bp['loggedin_userid'], 2, $width, $height);216 echo apply_filters( 'bp_loggedinuser_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 2, $width, $height ) ); 217 217 else 218 echo bp_core_get_avatar( $bp['loggedin_userid'], 2);218 echo apply_filters( 'bp_loggedinuser_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 2 ) ); 219 219 } 220 220 … … 223 223 224 224 if ( $width && $height ) 225 echo bp_core_get_avatar( $bp['loggedin_userid'], 1, $width, $height);225 echo apply_filters( 'bp_get_options_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 1, $width, $height ) ); 226 226 else 227 echo bp_core_get_avatar( $bp['loggedin_userid'], 1);227 echo apply_filters( 'bp_get_options_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 1 ) ); 228 228 } 229 229 … … 257 257 258 258 if ( $echo ) 259 echo stripslashes( trim( $data) );259 echo apply_filters( 'bp_fetch_user_fullname', stripslashes( trim( $data ) ) ); 260 260 else 261 return stripslashes ( trim ( $data) );261 return apply_filters( 'bp_fetch_user_fullname', stripslashes ( trim ( $data ) ) ); 262 262 } 263 263 … … 271 271 272 272 if ( $echo ) 273 echo $last_activity;273 echo apply_filters( 'bp_last_activity', $last_activity ); 274 274 else 275 return $last_activity;275 return apply_filters( 'bp_last_activity', $last_activity ); 276 276 } 277 277 278 278 function bp_the_avatar() { 279 279 global $bp; 280 echo bp_core_get_avatar( $bp['current_userid'], 2);280 echo apply_filters( 'bp_the_avatar', bp_core_get_avatar( $bp['current_userid'], 2 ) ); 281 281 } 282 282 283 283 function bp_the_avatar_thumbnail() { 284 284 global $bp; 285 echo bp_core_get_avatar( $bp['current_userid'], 1);285 echo apply_filters( 'bp_the_avatar_thumbnail', bp_core_get_avatar( $bp['current_userid'], 1 ) ); 286 286 } 287 287 288 288 function bp_user_link() { 289 echo ''; 289 global $bp; 290 291 echo apply_filters( 'bp_the_avatar_thumbnail', $bp['current_domain'] ); 290 292 } 291 293 … … 312 314 } 313 315 314 return $date;316 return apply_filters( 'bp_format_time', $date ); 315 317 } 316 318 … … 324 326 if ( $bp['current_userid'] == $bp['loggedin_userid'] ) { 325 327 if ( $echo ) 326 echo $youtext;328 echo apply_filters( 'bp_word_or_name', $youtext ); 327 329 else 328 return $youtext;330 return apply_filters( 'bp_word_or_name', $youtext ); 329 331 } else { 330 332 $nametext = sprintf($nametext, $bp['current_fullname']); 331 333 if ( $echo ) 332 echo $nametext;334 echo apply_filters( 'bp_word_or_name', $nametext ); 333 335 else 334 return $nametext;336 return apply_filters( 'bp_word_or_name', $nametext ); 335 337 } 336 338 } … … 344 346 if ( $bp['current_userid'] == $bp['loggedin_userid'] ) { 345 347 if ( $echo ) 346 echo $yourtext;348 echo apply_filters( 'bp_your_or_their', $yourtext ); 347 349 else 348 return $yourtext;350 return apply_filters( 'bp_your_or_their', $yourtext ); 349 351 } else { 350 352 if ( $echo ) 351 echo $theirtext;353 echo apply_filters( 'bp_your_or_their', $theirtext ); 352 354 else 353 return $theirtext;355 return apply_filters( 'bp_your_or_their', $theirtext ); 354 356 } 355 357 } … … 359 361 360 362 if ( $link = bp_core_get_userlink( $bp['loggedin_userid'] ) ) { 361 echo $link;363 echo apply_filters( 'bp_loggedinuser_link', $link ); 362 364 } else { 363 365 $ud = get_userdata($current_user->ID); 364 echo $ud->user_login;366 echo apply_filters( 'bp_loggedinuser_link', $ud->user_login ); 365 367 } 366 368 } … … 389 391 390 392 if ( $bp['current_fullname'] != '' ) { 391 echo $bp['current_fullname'] . ' » ' . ucwords($bp['current_component']) . ' » ' . $bp['bp_options_nav'][$bp['current_component']][$bp['current_action']]['name'];392 } else { 393 echo ucwords($bp['current_component']) . ' » ' . ucwords($bp['bp_options_title']) . ' » ' . ucwords($bp['current_action']);393 echo apply_filters( 'bp_page_title', $bp['current_fullname'] . ' » ' . ucwords($bp['current_component']) . ' » ' . $bp['bp_options_nav'][$bp['current_component']][$bp['current_action']]['name'] ); 394 } else { 395 echo apply_filters( 'bp_page_title', ucwords($bp['current_component']) . ' » ' . ucwords($bp['bp_options_title']) . ' » ' . ucwords($bp['current_action']) ); 394 396 } 395 397 } … … 417 419 function bp_current_user_id() { 418 420 global $bp; 419 return $bp['current_userid'];421 return apply_filters( 'bp_current_user_id', $bp['current_userid'] ); 420 422 } 421 423 422 424 function bp_user_fullname() { 423 425 global $bp; 424 echo $bp['current_fullname'];426 echo apply_filters( 'bp_user_fullname', $bp['current_fullname'] ); 425 427 } 426 428 -
trunk/bp-friends.php
r623 r641 11 11 include_once( 'bp-friends/bp-friends-widgets.php' ); 12 12 include_once( 'bp-friends/bp-friends-notifications.php' ); 13 include_once( 'bp-friends/bp-friends-filters.php' ); 13 14 /*include_once( 'bp-messages/bp-friends-admin.php' );*/ 14 15 … … 195 196 if ( function_exists('bp_activity_record') ) { 196 197 extract($args); 197 bp_activity_record( $item_id, $component_name, $component_action, $is_private , $dual_record);198 bp_activity_record( $item_id, $component_name, $component_action, $is_private ); 198 199 } 199 200 } … … 209 210 **************************************************************************/ 210 211 211 function friends_format_activity( $ friendship_id, $user_id, $action, $for_secondary_user = false ) {212 function friends_format_activity( $item_id, $user_id, $action, $secondary_item_id = false, $for_secondary_user = false ) { 212 213 global $bp; 213 214 214 215 switch( $action ) { 215 216 case 'friendship_accepted': 216 $friendship = new BP_Friends_Friendship( $ friendship_id, false, false );217 $friendship = new BP_Friends_Friendship( $item_id, false, false ); 217 218 218 219 if ( !$friendship->initiator_user_id || !$friendship->friend_user_id ) -
trunk/bp-friends/bp-friends-templatetags.php
r612 r641 148 148 $template = &$friends_template->friendship->friend; 149 149 150 echo $template->avatar_thumb;150 echo apply_filters( 'bp_friend_avatar_thumb', $template->avatar_thumb ); 151 151 } 152 152 function bp_user_avatar_thumb() { … … 162 162 163 163 if ( $template->status ) 164 echo $template->status;164 echo apply_filters( 'bp_friend_status', $template->status ); 165 165 } 166 166 function bp_user_status_message() { … … 175 175 $template = &$friends_template->friendship->friend; 176 176 177 echo $template->user_link;177 echo apply_filters( 'bp_friend_link', $template->user_link ); 178 178 } 179 179 function bp_user_url() { … … 191 191 $template = &$friends_template->friendship->friend; 192 192 193 echo $time;193 echo apply_filters( 'bp_friend_last_active', $time ); 194 194 } 195 195 function bp_user_last_active( $time = false ) { … … 204 204 $template = &$friends_template->friendship->friend; 205 205 206 echo $template->profile_last_updated;206 echo apply_filters( 'bp_friend_last_profile_update', $template->profile_last_updated ); 207 207 } 208 208 function bp_user_last_profile_update() { … … 217 217 $template = &$friends_template->friendship->friend; 218 218 219 echo $template->profile_last_updated;219 echo apply_filters( 'bp_friend_last_status_update', $template->profile_last_updated ); 220 220 } 221 221 function bp_user_last_status_update() { … … 230 230 $template = &$friends_template->friendship->friend; 231 231 232 echo $template->content_last_updated;232 echo apply_filters( 'bp_friend_last_content_update', $template->content_last_updated ); 233 233 } 234 234 function bp_user_last_content_update() { … … 241 241 242 242 if ( $friends_template->friendship->date_created != "0000-00-00 00:00:00" ) { 243 echo sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $friends_template->friendship->date_created) ) );243 echo apply_filters( 'bp_friend_time_since_requested', sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $friends_template->friendship->date_created ) ) ) ); 244 244 } 245 245 } … … 248 248 global $friends_template, $bp; 249 249 250 echo $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests/accept/' . $friends_template->friendship->id;250 echo apply_filters( 'bp_friend_accept_request_link', $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests/accept/' . $friends_template->friendship->id ); 251 251 } 252 252 … … 254 254 global $friends_template, $bp; 255 255 256 echo $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests/reject/' . $friends_template->friendship->id;256 echo apply_filters( 'bp_friend_reject_request_link', $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests/reject/' . $friends_template->friendship->id ); 257 257 } 258 258 259 259 function bp_friend_pagination() { 260 260 global $friends_template; 261 echo $friends_template->pag_links;261 echo apply_filters( 'bp_friend_pagination', $friends_template->pag_links ); 262 262 } 263 263 … … 281 281 function bp_friend_all_friends_link() { 282 282 global $bp; 283 echo $bp['current_domain'] . 'my-friends/all-friends';283 echo apply_filters( 'bp_friend_all_friends_link', $bp['current_domain'] . 'my-friends/all-friends' ); 284 284 } 285 285 286 286 function bp_friend_latest_update_link() { 287 287 global $bp; 288 echo $bp['current_domain'] . 'my-friends/last-updated';288 echo apply_filters( 'bp_friend_latest_update_link', $bp['current_domain'] . 'my-friends/last-updated' ); 289 289 } 290 290 291 291 function bp_friend_recent_activity_link() { 292 292 global $bp; 293 echo $bp['current_domain'] . 'my-friends/recently-active';293 echo apply_filters( 'bp_friend_recent_activity_link', $bp['current_domain'] . 'my-friends/recently-active' ); 294 294 } 295 295 296 296 function bp_friend_recent_status_link() { 297 297 global $bp; 298 echo $bp['current_domain'] . 'my-friends/status-updates';298 echo apply_filters( 'bp_friend_recent_status_link', $bp['current_domain'] . 'my-friends/status-updates' ); 299 299 } 300 300 -
trunk/bp-groups.php
r612 r641 11 11 include_once( 'bp-groups/bp-groups-widgets.php' ); 12 12 include_once( 'bp-groups/bp-groups-notifications.php' ); 13 include_once( 'bp-groups/bp-groups-filters.php' ); 13 14 include_once( 'bp-groups/bp-groups-admin.php' ); 14 15 include_once( 'bp-groups/directories/bp-groups-directory-groups.php' ); … … 244 245 if ( $group_obj->status == 'private' && ( !groups_is_user_member( $bp['loggedin_userid'], $group_obj->id ) && !groups_check_for_membership_request( $bp['loggedin_userid'], $group_obj->id ) ) && is_user_logged_in() ) 245 246 bp_core_add_subnav_item( $bp['groups']['slug'], 'request-membership', __('Request Membership', 'buddypress'), $group_link , 'groups_screen_group_request_membership', 'request-membership' ); 246 247 bp_core_add_subnav_item( $bp['groups']['slug'], 'forum', __('Forum', 'buddypress'), $group_link , 'groups_screen_group_forum', 'group-forum', $is_visible); 248 249 if ( function_exists('bp_wire_install') ) { 247 248 if ( function_exists('bp_forums_setup') && $group_obj->enable_forum ) { 249 bp_core_add_subnav_item( $bp['groups']['slug'], 'forum', __('Forum', 'buddypress'), $group_link , 'groups_screen_group_forum', 'group-forum', $is_visible); 250 } 251 252 if ( function_exists('bp_wire_install') && $group_obj->enable_wire ) { 250 253 bp_core_add_subnav_item( $bp['groups']['slug'], 'wire', __('Wire', 'buddypress'), $group_link, 'groups_screen_group_wire', 'group-wire', $is_visible ); 251 254 } … … 353 356 if ( $create_group_step == 4 ) 354 357 bp_core_redirect( bp_group_permalink( $group_obj, false ) ); 355 358 356 359 if ( !$group_id = groups_manage_group( $create_group_step, $_SESSION['group_obj_id'] ) ) { 357 360 bp_core_add_message( __('There was an error saving group details. Please try again.', 'buddypress'), 'error' ); … … 388 391 389 392 function groups_screen_group_forum() { 390 global $is_single_group; 391 392 if ( $is_single_group ) { 393 // Not implemented yet. 394 bp_catch_uri( 'groups/forum' ); 393 global $is_single_group, $bp, $group_obj; 394 395 if ( $is_single_group ) { 396 $topic_id = $bp['action_variables'][1]; 397 $forum_id = groups_get_groupmeta( $group_obj->id, 'forum_id' ); 398 399 if ( $topic_id ) { 400 401 /* Posting a reply */ 402 if ( isset( $_POST['submit_reply'] ) && function_exists( 'bp_forums_new_post') ) { 403 groups_new_group_forum_post( $_POST['reply_text'], $topic_id ); 404 bp_core_redirect( bp_group_permalink( $group_obj, false ) . '/forum/topic/' . $topic_id ); 405 } 406 407 // If we are viewing a topic, load it. 408 bp_catch_uri( 'groups/forum/topic' ); 409 } else { 410 411 /* Posting a topic */ 412 if ( isset( $_POST['submit_topic'] ) && function_exists( 'bp_forums_new_topic') ) { 413 groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ); 414 bp_core_redirect( bp_group_permalink( $group_obj, false ) . '/forum/' ); 415 } 416 417 // Load the forum home. 418 bp_catch_uri( 'groups/forum/index' ); 419 } 395 420 } 396 421 } … … 410 435 bp_core_add_message( __('Wire message successfully posted.', 'buddypress') ); 411 436 } 412 437 413 438 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp['wire']['slug'] ) ) { 414 439 bp_core_redirect( bp_group_permalink( $group_obj, false ) ); … … 800 825 extract($args); 801 826 802 if ( !isset($group_id) ) 803 $group_id = $item_id; 804 805 $group = new BP_Groups_Group( $group_id, false, false ); 806 827 $group = new BP_Groups_Group( $item_id, false, false ); 828 807 829 if ( $group->status == 'public' ) 808 bp_activity_record( $item_id, $component_name, $component_action, $is_private );830 bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_item_id ); 809 831 } 810 832 } … … 812 834 add_action( 'activity_groups_created_group', 'groups_record_activity' ); 813 835 add_action( 'activity_groups_new_wire_post', 'groups_record_activity' ); 836 add_action( 'activity_groups_new_forum_topic_post', 'groups_record_activity' ); 837 add_action( 'activity_groups_new_forum_topic', 'groups_record_activity' ); 814 838 815 839 /************************************************************************** … … 821 845 **************************************************************************/ 822 846 823 function groups_format_activity( $item_id, $user_id, $action, $ for_secondary_user = false ) {847 function groups_format_activity( $item_id, $user_id, $action, $secondary_item_id = false, $for_secondary_user = false ) { 824 848 global $bp; 825 849 … … 862 886 ); 863 887 break; 888 case 'new_forum_post': 889 if ( function_exists('bp_forums_setup') ) { 890 $group = new BP_Groups_Group( $item_id ); 891 $forum_post = bp_forums_get_post( $secondary_item_id ); 892 $forum_topic = bp_forums_get_topic_details( $forum_post['topic_id'] ); 893 894 if ( !$group || !$forum_post || !$forum_topic ) 895 return false; 896 897 $content = sprintf ( __('%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '/forum/topic/' . $forum_topic['topic_id'] . '">' . $forum_topic['topic_title'] . '</a>', '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 898 $content .= '<blockquote>' . apply_filters( 'bp_the_topic_post_content', stripslashes( $forum_post['post_text'] ) ) . '</blockquote>'; 899 900 return array( 901 'primary_link' => bp_group_permalink( $group, false ), 902 'content' => $content 903 ); 904 } 905 break; 906 case 'new_forum_topic': 907 if ( function_exists('bp_forums_setup') ) { 908 $group = new BP_Groups_Group( $item_id ); 909 $forum_topic = bp_forums_get_topic_details( $secondary_item_id ); 910 $forum_post = bp_forums_get_post( $forum_topic['topic_last_post_id'] ); 911 912 var_dump($group, $forum_topic, $forum_post); 913 914 if ( !$group || !$forum_post || !$forum_topic ) 915 return false; 916 917 $content = sprintf ( __('%s created the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '/forum/topic/' . $forum_topic['topic_id'] . '">' . $forum_topic['topic_title'] . '</a>', '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 918 $content .= '<blockquote>' . apply_filters( 'bp_the_topic_post_content', stripslashes( $forum_post['post_text'] ) ) . '</blockquote>'; 919 920 return array( 921 'primary_link' => bp_group_permalink( $group, false ), 922 'content' => $content 923 ); 924 } 925 break; 864 926 } 865 927 … … 967 1029 add_action( 'groups_leave_group', 'groups_update_last_activity' ); 968 1030 add_action( 'groups_created_group', 'groups_update_last_activity' ); 1031 add_action( 'bp_groups_new_forum_topic_post', 'groups_update_last_activity' ); 1032 add_action( 'bp_groups_new_forum_topic_post', 'groups_update_last_activity' ); 1033 969 1034 970 1035 … … 1101 1166 1102 1167 function groups_manage_group( $step, $group_id ) { 1103 global $bp, $create_group_step, $group_obj ;1104 1168 global $bp, $create_group_step, $group_obj, $bbpress_live; 1169 1105 1170 if ( is_numeric( $step ) && ( $step == '1' || $step == '2' || $step == '3' || $step == '4' ) ) { 1106 1171 … … 1166 1231 $group_obj->enable_wire = 0; 1167 1232 1168 if ( !isset($_POST['group-show-forum']) ) 1233 if ( !isset($_POST['group-show-forum']) ) { 1169 1234 $group_obj->enable_forum = 0; 1235 } else { 1236 /* Create the forum if enable_forum = 1 */ 1237 if ( function_exists( 'bp_forums_setup' ) && groups_get_groupmeta( $group_obj->id, 'forum_id' ) == '' ) { 1238 groups_new_group_forum(); 1239 } 1240 } 1170 1241 1171 1242 if ( !isset($_POST['group-show-photos']) ) … … 1264 1335 } 1265 1336 1337 function groups_new_group_forum() { 1338 global $group_obj; 1339 1340 $forum = bp_forums_new_forum( $group_obj->name . ' - Forum ', $group_obj->description ); 1341 groups_update_groupmeta( $group_obj->id, 'forum_id', $forum['forum_id'] ); 1342 1343 do_action( 'groups_new_group_forum', $forum, $group_obj->id ); 1344 } 1345 1346 function groups_new_group_forum_post( $post_text, $topic_id ) { 1347 global $group_obj; 1348 1349 if ( $forum_post = bp_forums_new_post( $post_text, $topic_id ) ) { 1350 bp_core_add_message( __( 'Reply posted successfully!', 'buddypress') ); 1351 1352 /* Activity recording action */ 1353 do_action( 'activity_groups_new_forum_topic_post', array( 'item_id' => $group_obj->id, 'component_name' => 'groups', 'component_action' => 'new_forum_post', 'is_private' => 0, 'secondary_item_id' => $forum_post['post_id'] ) ); 1354 1355 do_action( 'bp_groups_new_forum_topic_post', $group_obj->id, $forum_post ); 1356 1357 return $forum_post; 1358 } 1359 1360 bp_core_add_message( __( 'There was an error posting that reply.', 'buddypress'), 'error' ); 1361 return false; 1362 } 1363 1364 function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) { 1365 global $group_obj; 1366 1367 if ( $topic = bp_forums_new_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) ) { 1368 bp_core_add_message( __( 'Topic posted successfully!', 'buddypress') ); 1369 1370 /* Activity recording action */ 1371 do_action( 'activity_groups_new_forum_topic', array( 'item_id' => $group_obj->id, 'component_name' => 'groups', 'component_action' => 'new_forum_topic', 'is_private' => 0, 'secondary_item_id' => $topic['topic_id'] ) ); 1372 1373 do_action( 'bp_groups_new_forum_topic', $group_obj->id, $topic ); 1374 1375 return $topic; 1376 } 1377 1378 bp_core_add_message( __( 'There was an error posting that topic.', 'buddypress'), 'error' ); 1379 return false; 1380 } 1381 1266 1382 function groups_invite_user( $user_id, $group_id ) { 1267 1383 global $bp; … … 1458 1574 if ( !$group->save() ) 1459 1575 return false; 1576 1577 /* If forums have been enabled, and a forum does not yet exist, we need to create one. */ 1578 if ( $group->enable_forum ) { 1579 if ( function_exists( 'bp_forums_setup' ) && groups_get_groupmeta( $group->id, 'forum_id' ) == '' ) { 1580 $forum = bp_forums_new_forum( $group->name . ' - Forum ', $group->description ); 1581 groups_update_groupmeta( $group->id, 'forum_id', $forum['forum_id'] ); 1582 } 1583 } 1460 1584 1461 1585 do_action( 'bp_groups_settings_updated', $group->id ); … … 1706 1830 1707 1831 $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key ); 1832 $meta_value = (string)$meta_value; 1708 1833 1709 1834 if ( is_string($meta_value) ) 1710 1835 $meta_value = stripslashes($wpdb->escape($meta_value)); 1711 1836 1712 1837 $meta_value = maybe_serialize($meta_value); 1713 1838 1714 1839 if (empty($meta_value)) { 1715 1840 return groups_delete_groupmeta( $group_id, $meta_key ); … … 1717 1842 1718 1843 $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp['groups']['table_name_groupmeta'] . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); 1719 1844 1720 1845 if ( !$cur ) { 1721 1846 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['groups']['table_name_groupmeta'] . " ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) ); -
trunk/bp-groups/bp-groups-ajax.php
r612 r641 1 <?php1 A<?php 2 2 function groups_ajax_invite_user() { 3 3 global $bp; -
trunk/bp-groups/bp-groups-templatetags.php
r612 r641 203 203 204 204 if ( $echo ) 205 echo $groups_template->group->id;205 echo apply_filters( 'bp_group_id', $groups_template->group->id ); 206 206 else 207 return $groups_template->group->id;207 return apply_filters( 'bp_group_id', $groups_template->group->id ); 208 208 } 209 209 … … 212 212 213 213 if ( $echo ) 214 echo $groups_template->group->name;214 echo apply_filters( 'bp_group_name', $groups_template->group->name ); 215 215 else 216 return $groups_template->group->name;216 return apply_filters( 'bp_group_name', $groups_template->group->name ); 217 217 } 218 218 219 219 function bp_group_type() { 220 220 global $groups_template; 221 echo ucwords($groups_template->group->status) . ' ' . __('Group', 'buddypress');221 echo apply_filters( 'bp_group_type', ucwords($groups_template->group->status) . ' ' . __('Group', 'buddypress') ); 222 222 } 223 223 … … 248 248 _e( 'not yet active', 'buddypress' ); 249 249 else 250 echo bp_core_time_since( $last_active);250 echo apply_filters( 'bp_group_last_active', bp_core_time_since( $last_active ) ); 251 251 } 252 252 … … 258 258 259 259 if ( $echo ) 260 echo $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug;260 echo apply_filters( 'bp_group_permalink', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug ); 261 261 else 262 return $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug;262 return apply_filters( 'bp_group_permalink', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug ); 263 263 } 264 264 … … 270 270 271 271 if ( $echo ) 272 echo $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug . '/admin';272 echo apply_filters( 'bp_group_admin_permalink', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug . '/admin' ); 273 273 else 274 return $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug . '/admin';274 return apply_filters( 'bp_group_admin_permalink', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug . '/admin' ); 275 275 } 276 276 277 277 function bp_group_slug() { 278 278 global $groups_template; 279 echo $groups_template->group->slug;279 echo apply_filters( 'bp_group_slug', $groups_template->group->slug ); 280 280 } 281 281 282 282 function bp_group_description() { 283 283 global $groups_template; 284 285 $content = $groups_template->group->description; 286 $content = apply_filters('the_content', $content); 287 $content = str_replace(']]>', ']]>', $content); 288 echo stripslashes($content); 284 285 echo apply_filters( 'bp_group_description', stripslashes($groups_template->group->description) ); 289 286 } 290 287 … … 292 289 global $groups_template; 293 290 294 echo $groups_template->group->description;291 echo apply_filters( 'bp_group_description_editable', $groups_template->group->description ); 295 292 } 296 293 297 294 function bp_group_description_excerpt() { 298 295 global $groups_template; 299 echo bp_create_excerpt( $groups_template->group->description, 20 ); 296 297 echo apply_filters( 'bp_group_description_excerpt', bp_create_excerpt( $groups_template->group->description, 20 ) ); 300 298 } 301 299 … … 303 301 global $groups_template; 304 302 305 $content = $groups_template->group->news; 306 $content = apply_filters('the_content', $content); 307 $content = str_replace(']]>', ']]>', $content); 308 echo stripslashes($content); 303 echo apply_filters( 'bp_group_news', stripslashes($groups_template->group->news) ); 309 304 } 310 305 … … 312 307 global $groups_template; 313 308 314 echo $groups_template->group->news;309 echo apply_filters( 'bp_group_news_editable', $groups_template->group->news ); 315 310 } 316 311 … … 326 321 function bp_group_is_public() { 327 322 global $groups_template; 328 return $groups_template->group->is_public;323 return apply_filters( 'bp_group_is_public', $groups_template->group->is_public ); 329 324 } 330 325 … … 333 328 global $groups_template; 334 329 335 echo date( get_option( 'date_format' ), $groups_template->group->date_created);330 echo apply_filters( 'bp_group_date_created', date( get_option( 'date_format' ), $groups_template->group->date_created ) ); 336 331 } 337 332 … … 397 392 398 393 if ( $echo ) 399 echo bp_group_permalink( false, true ) . '/' . MEMBERS_SLUG;394 echo apply_filters( 'bp_group_all_members_permalink', bp_group_permalink( false, true ) . '/' . MEMBERS_SLUG ); 400 395 else 401 return bp_group_permalink( false, false ) . '/' . MEMBERS_SLUG;396 return apply_filters( 'bp_group_all_members_permalink', bp_group_permalink( false, false ) . '/' . MEMBERS_SLUG ); 402 397 } 403 398 … … 419 414 } 420 415 416 function bp_group_active_forum_topics( $total_topics = 3 ) { 417 global $groups_template, $forum_template; 418 419 $forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ); 420 421 if ( $forum_id && $forum_id != '' ) { 422 if ( function_exists( 'bp_forums_setup' ) ) { 423 $latest_topics = bp_forums_get_topics( $forum_id, $total_topics, 1 ); 424 425 if ( $latest_topics ) { ?> 426 <ul class="item-list" id="recent-forum-topics"><?php 427 foreach( $latest_topics as $topic ) { 428 $forum_template->topic = (object)$topic; ?> 429 <li> 430 <div class="avatar"> 431 <?php bp_the_topic_poster_avatar() ?> 432 </div> 433 434 <a href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>"><?php bp_the_topic_title() ?></a> 435 <span class="small">- <?php bp_the_topic_total_post_count() ?> </span> 436 <p><span class="activity"><?php echo sprintf( __( 'updated %s ago', 'buddypress' ), bp_the_topic_time_since_last_post( false ) ) ?><span></p> 437 438 <div class="latest-post"> 439 <?php _e( 'Latest by', 'buddypress' ) ?> <?php bp_the_topic_last_poster_name() ?>: 440 <?php bp_the_topic_latest_post_excerpt() ?> 441 </div> 442 </li> 443 <?php } ?> 444 </ul> 445 <?php 446 } else { 447 ?> 448 <div id="message" class="info"> 449 <p><?php _e( 'There are no active forum topics for this group', 'buddypress' ) ?></p> 450 </div> 451 <?php 452 } 453 } 454 } 455 } 456 421 457 function bp_group_search_form() { 422 458 global $groups_template, $bp; … … 454 490 function bp_group_pagination() { 455 491 global $groups_template; 456 echo $groups_template->pag_links;492 echo apply_filters( 'bp_group_pagination', $groups_template->pag_links ); 457 493 } 458 494 … … 460 496 global $groups_template; 461 497 462 echo $groups_template->total_group_count;498 echo apply_filters( 'bp_total_group_count', $groups_template->total_group_count ); 463 499 } 464 500 … … 467 503 468 504 if ( $echo ) 469 echo $groups_template->group->total_member_count;505 echo apply_filters( 'groups_template', $groups_template->group->total_member_count ); 470 506 else 471 return $groups_template->group->total_member_count;472 } 473 474 function bp_group_ photos_enabled() {507 return apply_filters( 'groups_template', $groups_template->group->total_member_count ); 508 } 509 510 function bp_group_is_photos_enabled() { 475 511 global $groups_template; 476 512 … … 486 522 if ( $groups_template->group->enable_wire ) 487 523 echo ' checked="checked"'; 524 } 525 526 function bp_group_is_wire_enabled() { 527 global $groups_template; 528 529 if ( $groups_template->group->enable_wire ) 530 return true; 531 532 return false; 533 } 534 535 function bp_group_is_forum_enabled() { 536 global $groups_template; 537 538 if ( $groups_template->group->enable_forum ) 539 return true; 540 541 return false; 488 542 } 489 543 … … 589 643 function bp_group_has_moderators() { 590 644 global $group_mods, $groups_template; 591 592 $group_mods = groups_get_group_mods( $groups_template->group->id ); 593 return $group_mods; 645 646 return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $groups_template->group->id ) ); 594 647 } 595 648 … … 597 650 global $members_template, $groups_template, $bp; 598 651 599 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/promote/' . $members_template->member->user_id;652 echo apply_filters( 'bp_group_member_promote_link', bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/promote/' . $members_template->member->user_id ); 600 653 } 601 654 … … 606 659 $user_id = $members_template->member->user_id; 607 660 608 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/demote/' . $user_id;661 echo apply_filters( 'bp_group_member_demote_link', bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/demote/' . $user_id ); 609 662 } 610 663 … … 612 665 global $members_template, $groups_template, $bp; 613 666 614 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/ban/' . $members_template->member->user_id;667 echo apply_filters( 'bp_group_member_ban_link', bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/ban/' . $members_template->member->user_id ); 615 668 } 616 669 … … 618 671 global $members_template, $groups_template, $bp; 619 672 620 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/unban/' . $members_template->member->user_id;673 echo apply_filters( 'bp_group_member_unban_link', bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/unban/' . $members_template->member->user_id ); 621 674 } 622 675 … … 653 706 global $bp, $groups_template; 654 707 655 echo bp_group_permalink( $group, false ) . '/' . $page;708 echo apply_filters( 'bp_group_form_action', bp_group_permalink( $group, false ) . '/' . $page ); 656 709 } 657 710 … … 659 712 global $bp, $groups_template; 660 713 661 echo bp_group_permalink( $group, false ) . '/admin/' . $page;714 echo apply_filters( 'bp_group_admin_form_action', bp_group_permalink( $group, false ) . '/admin/' . $page ); 662 715 } 663 716 … … 735 788 <?php endif; ?> 736 789 737 <?php if ( function_exists('bp_forum _install') ) : ?>790 <?php if ( function_exists('bp_forums_setup') ) : ?> 738 791 <div class="checkbox"> 739 792 <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php if ( $group_obj->enable_forum ) { ?> checked="checked"<?php } ?> /> <?php _e('Enable discussion forum', 'buddypress') ?></label> … … 903 956 global $bp, $groups_template; 904 957 905 if ( BP_Groups_Member::check_is_member( $bp['loggedin_userid'], $groups_template->group->id ) )958 if ( groups_is_user_member( $bp['loggedin_userid'], $groups_template->group->id ) ) 906 959 return true; 907 960 … … 912 965 global $groups_template, $bp; 913 966 914 echo $bp['loggedin_domain'] . $bp['groups']['slug'] . '/invites/accept/' . $groups_template->group->id;967 echo apply_filters( 'bp_group_accept_invite_link', $bp['loggedin_domain'] . $bp['groups']['slug'] . '/invites/accept/' . $groups_template->group->id ); 915 968 } 916 969 … … 918 971 global $groups_template, $bp; 919 972 920 echo $bp['loggedin_domain'] . $bp['groups']['slug'] . '/invites/reject/' . $groups_template->group->id;973 echo apply_filters( 'bp_group_reject_invite_link', $bp['loggedin_domain'] . $bp['groups']['slug'] . '/invites/reject/' . $groups_template->group->id ); 921 974 } 922 975 … … 936 989 global $groups_template, $bp; 937 990 938 echo bp_group_permalink( false, true ) . '/leave-group/yes';991 echo apply_filters( 'bp_group_leave_confirm_link', bp_group_permalink( false, true ) . '/leave-group/yes' ); 939 992 } 940 993 … … 942 995 global $groups_template, $bp; 943 996 944 echo bp_group_permalink( false, true);997 echo apply_filters( 'bp_group_leave_reject_link', bp_group_permalink( false, true ) ); 945 998 } 946 999 … … 990 1043 global $groups_template, $bp; 991 1044 992 echo bp_group_permalink( false, true ) . '/send-invites/send';1045 echo apply_filters( 'bp_group_send_invite_form_action', bp_group_permalink( false, true ) . '/send-invites/send' ); 993 1046 } 994 1047 … … 1184 1237 global $members_template; 1185 1238 1186 echo bp_core_get_avatar( $members_template->member->user_id, 1);1239 echo apply_filters( 'bp_group_member_avatar', bp_core_get_avatar( $members_template->member->user_id, 1 ) ); 1187 1240 } 1188 1241 … … 1190 1243 global $members_template; 1191 1244 1192 echo bp_core_get_avatar( $members_template->member->user_id, 1, $width, $height);1245 echo apply_filters( 'bp_group_member_avatar_mini', bp_core_get_avatar( $members_template->member->user_id, 1, $width, $height ) ); 1193 1246 } 1194 1247 … … 1196 1249 global $members_template; 1197 1250 1198 echo bp_core_get_userlink( $members_template->member->user_id);1251 echo apply_filters( 'bp_group_member_link', bp_core_get_userlink( $members_template->member->user_id ) ); 1199 1252 } 1200 1253 … … 1202 1255 global $members_template, $groups_template; 1203 1256 1204 return groups_is_user_banned( $members_template->member->user_id, $groups_template->group->id);1257 return apply_filters( 'bp_group_member_is_banned', groups_is_user_banned( $members_template->member->user_id, $groups_template->group->id ) ); 1205 1258 } 1206 1259 … … 1208 1261 global $members_template; 1209 1262 1210 echo bp_core_get_last_activity( strtotime( $members_template->member->date_modified ), __( 'joined %s ago', 'buddypress') );1263 echo apply_filters( 'bp_group_member_joined_since', bp_core_get_last_activity( strtotime( $members_template->member->date_modified ), __( 'joined %s ago', 'buddypress') ) ); 1211 1264 } 1212 1265 1213 1266 function bp_group_member_id() { 1214 1267 global $members_template; 1215 return $members_template->member->user_id;1268 return apply_filters( 'bp_group_member_id', $members_template->member->user_id ); 1216 1269 } 1217 1270 … … 1229 1282 1230 1283 if ( $bp['current_action'] == 'group-finder' ) 1231 echo 'groupfinder-pag';1284 echo apply_filters( 'bp_group_reject_invite_link', 'groupfinder-pag' ); 1232 1285 else 1233 echo 'pag';1286 echo apply_filters( 'bp_group_reject_invite_link', 'pag' ); 1234 1287 } 1235 1288 … … 1247 1300 $to_num = ( $from_num + 4 > $members_template->total_member_count ) ? $members_template->total_member_count : $from_num + 4; 1248 1301 1249 echo sprintf( __( 'Viewing members %d to %d (%d total members)', 'buddypress' ), $from_num, $to_num, $members_template->total_member_count);1302 echo apply_filters( 'bp_group_reject_invite_link', sprintf( __( 'Viewing members %d to %d (%d total members)', 'buddypress' ), $from_num, $to_num, $members_template->total_member_count ) ); 1250 1303 } 1251 1304 … … 1366 1419 global $requests_template; 1367 1420 1368 echo bp_core_get_avatar( $requests_template->request->user_id, 1);1421 echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_get_avatar( $requests_template->request->user_id, 1 ) ); 1369 1422 } 1370 1423 … … 1372 1425 global $requests_template, $groups_template; 1373 1426 1374 echo bp_group_permalink( $groups_template->group, false ) . '/admin/membership-requests/reject/' . $requests_template->request->id;1427 echo apply_filters( 'bp_group_request_reject_link', bp_group_permalink( $groups_template->group, false ) . '/admin/membership-requests/reject/' . $requests_template->request->id ); 1375 1428 } 1376 1429 … … 1378 1431 global $requests_template, $groups_template; 1379 1432 1380 echo bp_group_permalink( $groups_template->group, false ) . '/admin/membership-requests/accept/' . $requests_template->request->id;1433 echo apply_filters( 'bp_group_request_accept_link', bp_group_permalink( $groups_template->group, false ) . '/admin/membership-requests/accept/' . $requests_template->request->id ); 1381 1434 } 1382 1435 … … 1384 1437 global $requests_template; 1385 1438 1386 echo sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $requests_template->request->date_modified) ) );1439 echo apply_filters( 'bp_group_request_time_since_requested', sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $requests_template->request->date_modified ) ) ) ); 1387 1440 } 1388 1441 … … 1390 1443 global $requests_template; 1391 1444 1392 echo strip_tags( stripslashes( $requests_template->request->comments) );1445 echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) ); 1393 1446 } 1394 1447 … … 1396 1449 global $requests_template; 1397 1450 1398 echo bp_core_get_userlink( $requests_template->request->user_id);1451 echo apply_filters( 'bp_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) ); 1399 1452 } 1400 1453 -
trunk/bp-messages.php
r637 r641 11 11 include_once( 'bp-messages/bp-messages-templatetags.php' ); 12 12 include_once( 'bp-messages/bp-messages-notifications.php' ); 13 include_once( 'bp-messages/bp-messages-filters.php' ); 13 14 14 15 /************************************************************************** … … 554 555 <div class="message-box"> 555 556 <div class="avatar-box"> 556 <?php if ( function_exists('bp_core_get_avatar') ) 557 echo bp_core_get_avatar($message->sender_id, 1); 558 ?> 559 560 <h3><?php echo bp_core_get_userlink($message->sender_id) ?></h3> 561 <small><?php echo bp_format_time(strtotime($message->date_sent)) ?></small> 557 <?php echo apply_filters( 'bp_message_sender_avatar', bp_core_get_avatar( $message->sender_id, 1 ) ) ?> 558 <h3><?php echo apply_filters( 'bp_message_sender_id', bp_core_get_userlink( $message->sender_id ) ) ?></h3> 559 <small><?php echo apply_filters( 'bp_message_date_sent', bp_format_time( strtotime($message->date_sent ) ) ) ?></small> 562 560 </div> 563 <?php echo stripslashes($message->message); ?>561 <?php echo apply_filters( 'bp_message_content', stripslashes($message->message) ); ?> 564 562 <div class="clear"></div> 565 563 </div> -
trunk/bp-messages/bp-messages-templatetags.php
r636 r641 123 123 function bp_message_thread_id() { 124 124 global $messages_template; 125 echo $messages_template->thread->thread_id;125 echo apply_filters( 'bp_message_thread_id', $messages_template->thread->thread_id ); 126 126 } 127 127 128 128 function bp_message_thread_subject() { 129 129 global $messages_template; 130 echo $messages_template->thread->last_message_subject;130 echo apply_filters( 'bp_message_thread_subject', $messages_template->thread->last_message_subject ); 131 131 } 132 132 133 133 function bp_message_thread_excerpt() { 134 134 global $messages_template; 135 echo bp_create_excerpt($messages_template->thread->last_message_message, 20);135 echo apply_filters( 'bp_message_thread_excerpt', bp_create_excerpt($messages_template->thread->last_message_message, 20) ); 136 136 } 137 137 138 138 function bp_message_thread_from() { 139 139 global $messages_template; 140 echo bp_core_get_userlink($messages_template->thread->last_sender_id);140 echo apply_filters( 'bp_message_thread_from', bp_core_get_userlink($messages_template->thread->last_sender_id) ); 141 141 } 142 142 143 143 function bp_message_thread_to() { 144 144 global $messages_template; 145 echo BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients);145 echo apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients) ); 146 146 } 147 147 148 148 function bp_message_thread_view_link() { 149 149 global $messages_template, $bp; 150 echo $bp['loggedin_domain'] . $bp['messages']['slug'] . '/view/' . $messages_template->thread->thread_id;150 echo apply_filters( 'bp_message_thread_view_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/view/' . $messages_template->thread->thread_id ); 151 151 } 152 152 153 153 function bp_message_thread_delete_link() { 154 154 global $messages_template, $bp; 155 echo $bp['loggedin_domain'] . $bp['messages']['slug'] . '/delete/' . $messages_template->thread->thread_id;155 echo apply_filters( 'bp_message_thread_delete_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/delete/' . $messages_template->thread->thread_id ); 156 156 } 157 157 … … 167 167 function bp_message_thread_unread_count() { 168 168 global $messages_template; 169 echo $messages_template->thread->unread_count;169 echo apply_filters( 'bp_message_thread_unread_count', $messages_template->thread->unread_count ); 170 170 } 171 171 172 172 function bp_message_thread_last_post_date() { 173 173 global $messages_template; 174 echo bp_format_time( strtotime($messages_template->thread->last_post_date) );174 echo apply_filters( 'bp_message_thread_last_post_date', bp_format_time( strtotime($messages_template->thread->last_post_date) ) ); 175 175 } 176 176 177 177 function bp_message_thread_avatar() { 178 178 global $messages_template; 179 echo bp_core_get_avatar($messages_template->thread->last_sender_id, 1);179 echo apply_filters( 'bp_message_thread_avatar', bp_core_get_avatar($messages_template->thread->last_sender_id, 1) ); 180 180 } 181 181 … … 192 192 function bp_messages_pagination() { 193 193 global $messages_template; 194 echo $messages_template->pag_links;194 echo apply_filters( 'bp_messages_pagination', $messages_template->pag_links ); 195 195 } 196 196 … … 198 198 global $bp; 199 199 200 echo $bp['loggedin_domain'] . $bp['messages']['slug'] . '/' . $bp['current_action'];200 echo apply_filters( 'bp_messages_form_action', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/' . $bp['current_action'] ); 201 201 } 202 202 203 203 function bp_messages_username_value() { 204 204 if ( isset( $_SESSION['send_to'] ) ) { 205 echo $_SESSION['send_to'];205 echo apply_filters( 'bp_messages_username_value', $_SESSION['send_to'] ); 206 206 } else if ( isset( $_GET['r'] ) && !isset( $_SESSION['send_to'] ) ) { 207 echo $_GET['r'];207 echo apply_filters( 'bp_messages_username_value', $_GET['r'] ); 208 208 } 209 209 } 210 210 211 211 function bp_messages_subject_value() { 212 echo $_SESSION['subject'];212 echo apply_filters( 'bp_messages_subject_value', $_SESSION['subject'] ); 213 213 } 214 214 215 215 function bp_messages_content_value() { 216 echo $_SESSION['content'];216 echo apply_filters( 'bp_messages_content_value', $_SESSION['content'] ); 217 217 } 218 218 … … 244 244 function bp_message_notice_post_date() { 245 245 global $messages_template; 246 echo bp_format_time( strtotime($messages_template->thread->post_date) );246 echo apply_filters( 'bp_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->post_date) ) ); 247 247 } 248 248 249 249 function bp_message_notice_subject() { 250 250 global $messages_template; 251 echo $messages_template->thread->subject;251 echo apply_filters( 'bp_message_notice_subject', $messages_template->thread->subject ); 252 252 } 253 253 254 254 function bp_message_notice_text() { 255 255 global $messages_template; 256 echo $messages_template->thread->message;256 echo apply_filters( 'bp_message_notice_text', $messages_template->thread->message ); 257 257 } 258 258 … … 260 260 global $messages_template, $bp; 261 261 262 echo $bp['loggedin_domain'] . $bp['messages']['slug'] . '/notices/delete/' . $messages_template->thread->id;262 echo apply_filters( 'bp_message_notice_delete_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/notices/delete/' . $messages_template->thread->id ); 263 263 } 264 264 … … 271 271 $link = $bp['loggedin_domain'] . $bp['bp_messages_slug'] . '/notices/activate/' . $messages_template->thread->id; 272 272 } 273 echo $link;273 echo apply_filters( 'bp_message_activate_deactivate_link', $link ); 274 274 } 275 275 … … 282 282 $text = __('Activate', 'buddypress'); 283 283 } 284 echo $text;284 echo apply_filters( 'bp_message_activate_deactivate_text', $text ); 285 285 } 286 286 -
trunk/bp-wire.php
r580 r641 9 9 include_once( 'bp-wire/bp-wire-templatetags.php' ); 10 10 include_once( 'bp-wire/bp-wire-cssjs.php' ); 11 include_once( 'bp-wire/bp-wire-filters.php' ); 11 12 //include_once( 'bp-wire/bp-wire-admin.php' ); 12 13 … … 94 95 do_action( 'bp_xprofile_new_wire_post', array( 'item_id' => $wire_post_id, 'component_name' => 'profile', 'component_action' => 'new_wire_post', 'is_private' => 0 ) ); 95 96 } 96 97 97 98 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp['wire']['slug'] ) ) { 98 99 bp_core_redirect( $bp['current_domain'] ); 99 100 } else { 100 bp_core_redirect( $bp['current_domain'] . $bp['wire']['slug'] );101 bp_core_redirect( $bp['current_domain'] . $bp['wire']['slug'] ); 101 102 } 102 103 } -
trunk/bp-wire/bp-wire-templatetags.php
r580 r641 148 148 function bp_wire_title() { 149 149 global $bp_wire_header; 150 echo $bp_wire_header;150 echo apply_filters( 'bp_group_reject_invite_link', $bp_wire_header ); 151 151 } 152 152 … … 155 155 156 156 if ( $echo ) 157 echo $bp_item_id;158 else 159 return $bp_item_id;157 echo apply_filters( 'bp_wire_item_id', $bp_item_id ); 158 else 159 return apply_filters( 'bp_wire_item_id', $bp_item_id ); 160 160 } 161 161 162 162 function bp_wire_no_posts_message() { 163 163 global $bp_wire_msg; 164 echo $bp_wire_msg;164 echo apply_filters( 'bp_wire_no_posts_message', $bp_wire_msg ); 165 165 } 166 166 167 167 function bp_wire_can_post() { 168 168 global $bp_wire_can_post; 169 return $bp_wire_can_post;169 return apply_filters( 'bp_wire_can_post', $bp_wire_can_post ); 170 170 } 171 171 172 172 function bp_wire_show_email_notify() { 173 173 global $bp_wire_show_email_notify; 174 return $bp_wire_show_email_notify;174 return apply_filters( 'bp_wire_show_email_notify', $bp_wire_show_email_notify ); 175 175 } 176 176 … … 179 179 180 180 if ( $echo ) 181 echo $wire_posts_template->wire_post->id;182 else 183 return $wire_posts_template->wire_post->id;181 echo apply_filters( 'bp_wire_post_id', $wire_posts_template->wire_post->id ); 182 else 183 return apply_filters( 'bp_wire_post_id', $wire_posts_template->wire_post->id ); 184 184 } 185 185 186 186 function bp_wire_post_content() { 187 187 global $wire_posts_template; 188 189 $content = $wire_posts_template->wire_post->content; 190 $content = apply_filters('the_content', $content); 191 $content = str_replace(']]>', ']]>', $content); 192 $content = stripslashes( $content ); 193 194 echo $content; 188 189 echo apply_filters( 'bp_wire_post_content', $wire_posts_template->wire_post->content ); 195 190 } 196 191 … … 216 211 $to_num = ( $from_num + 4 > $wire_posts_template->total_wire_post_count ) ? $wire_posts_template->total_wire_post_count : $from_num + 4; 217 212 218 echo sprintf( __( 'Viewing post %d to %d (%d total posts)', 'buddypress' ), $from_num, $to_num, $wire_posts_template->total_wire_post_count);213 echo apply_filters( 'bp_wire_pagination_count', sprintf( __( 'Viewing post %d to %d (%d total posts)', 'buddypress' ), $from_num, $to_num, $wire_posts_template->total_wire_post_count ) ); 219 214 } 220 215 … … 222 217 global $bp; 223 218 224 echo $bp['wire']['image_base'] . '/ajax-loader.gif';219 echo apply_filters( 'bp_wire_ajax_loader_src', $bp['wire']['image_base'] . '/ajax-loader.gif' ); 225 220 } 226 221 … … 232 227 233 228 if ( $echo ) 234 echo mysql2date( $date_format, $wire_posts_template->wire_post->date_posted);235 else 236 return mysql2date( $date_format, $wire_posts_template->wire_post->date_posted);229 echo apply_filters( 'bp_wire_post_date', mysql2date( $date_format, $wire_posts_template->wire_post->date_posted ) ); 230 else 231 return apply_filters( 'bp_wire_post_date', mysql2date( $date_format, $wire_posts_template->wire_post->date_posted ) ); 237 232 } 238 233 … … 241 236 242 237 if ( $echo ) 243 echo bp_core_get_userlink( $wire_posts_template->wire_post->user_id);244 else 245 return bp_core_get_userlink( $wire_posts_template->wire_post->user_id);238 echo apply_filters( 'bp_wire_post_author_name', bp_core_get_userlink( $wire_posts_template->wire_post->user_id ) ); 239 else 240 return apply_filters( 'bp_wire_post_author_name', bp_core_get_userlink( $wire_posts_template->wire_post->user_id ) ); 246 241 } 247 242 … … 249 244 global $wire_posts_template; 250 245 251 echo bp_core_get_avatar( $wire_posts_template->wire_post->user_id, 1);246 echo apply_filters( 'bp_wire_post_author_avatar', bp_core_get_avatar( $wire_posts_template->wire_post->user_id, 1 ) ); 252 247 } 253 248 … … 268 263 269 264 if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile' ) { 270 echo $bp['current_domain'] . $bp['wire']['slug'] . '/post/';265 echo apply_filters( 'bp_wire_get_action', $bp['current_domain'] . $bp['wire']['slug'] . '/post/' ); 271 266 } else { 272 echo site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/post/';267 echo apply_filters( 'bp_wire_get_action', site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/post/' ); 273 268 } 274 269 } … … 277 272 global $bp; 278 273 279 echo bp_core_get_avatar( $bp['loggedin_userid'], 1);274 echo apply_filters( 'bp_wire_poster_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 1 ) ); 280 275 } 281 276 … … 284 279 285 280 if ( $echo ) 286 echo '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>';287 else 288 return '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>';281 echo apply_filters( 'bp_wire_poster_name', '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>' ); 282 else 283 return apply_filters( 'bp_wire_poster_name', '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>' ); 289 284 } 290 285 … … 294 289 295 290 if ( $echo ) 296 echo mysql2date( $date_format, date("Y-m-d H:i:s") );297 else 298 return mysql2date( $date_format, date("Y-m-d H:i:s") );291 echo apply_filters( 'bp_wire_poster_date', mysql2date( $date_format, date("Y-m-d H:i:s") ) ); 292 else 293 return apply_filters( 'bp_wire_poster_date', mysql2date( $date_format, date("Y-m-d H:i:s") ) ); 299 294 } 300 295 … … 309 304 if ( ( $wire_posts_template->wire_post->user_id == $bp['loggedin_userid'] ) || $bp['is_item_admin'] ) { 310 305 if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile' ) { 311 echo '<a href="' . $bp['current_domain'] . $bp['wire']['slug'] . '/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>';306 echo apply_filters( 'bp_wire_delete_link', '<a href="' . $bp['current_domain'] . $bp['wire']['slug'] . '/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' ); 312 307 } else { 313 echo '<a href="' . site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>';308 echo apply_filters( 'bp_wire_delete_link', '<a href="' . site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' ); 314 309 } 315 310 } … … 325 320 326 321 if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile') { 327 echo $bp['current_domain'] . $bp['wire']['slug'];322 echo apply_filters( 'bp_wire_see_all_link', $bp['current_domain'] . $bp['wire']['slug'] ); 328 323 } else { 329 echo $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $uri . '/wire';324 echo apply_filters( 'bp_wire_see_all_link', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $uri . '/wire' ); 330 325 } 331 326 } -
trunk/bp-xprofile.php
r601 r641 413 413 * @return The readable activity item 414 414 */ 415 function xprofile_format_activity( $item_id, $user_id, $action ) {415 function xprofile_format_activity( $item_id, $user_id, $action, $secondary_item_id = false, $for_secondary_user = false ) { 416 416 global $bp; 417 417 -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r633 r641 164 164 165 165 if ( $profile_template->current_field % 2 ) 166 echo ' class="alt"';166 echo apply_filters( 'bp_field_css_class', ' class="alt"' ); 167 167 } 168 168 … … 183 183 function bp_the_profile_group_name() { 184 184 global $group; 185 echo $group->name;185 echo apply_filters( 'bp_the_profile_group_name', $group->name ); 186 186 } 187 187 188 188 function bp_the_profile_group_description() { 189 189 global $group; 190 echo $group->description;190 echo apply_filters( 'bp_the_profile_group_description', $group->description ); 191 191 } 192 192 … … 285 285 _e('Profile not recently updated', 'buddypress') . '.'; 286 286 } else { 287 echo __('Profile updated ', 'buddypress') . bp_core_time_since( strtotime( $last_updated ) ) . __(' ago', 'buddypress');287 echo apply_filters( 'bp_wire_poster_date', sprintf( __('Profile updated %s ago', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) ); 288 288 } 289 289 }
Note:
See TracChangeset
for help on using the changeset viewer.