Changeset 601
- Timestamp:
- 12/02/2008 09:04:12 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r591 r601 3 3 4 4 define ( 'BP_ACTIVITY_IS_INSTALLED', 1 ); 5 define ( 'BP_ACTIVITY_VERSION', '0.2. 4' );5 define ( 'BP_ACTIVITY_VERSION', '0.2.6' ); 6 6 7 7 /* How long before activity items in streams are re-cached? */ … … 44 44 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 45 45 content longtext NOT NULL, 46 primary_link varchar(150) NOT NULL, 46 47 component_name varchar(75) NOT NULL, 47 48 date_cached datetime NOT NULL, … … 58 59 user_id int(11) NOT NULL, 59 60 content longtext NOT NULL, 61 primary_link varchar(150) NOT NULL, 60 62 component_name varchar(75) NOT NULL, 61 63 date_cached datetime NOT NULL, … … 89 91 user_id int(11) NOT NULL, 90 92 content longtext NOT NULL, 93 primary_link varchar(150) NOT NULL, 91 94 component_name varchar(75) NOT NULL, 92 95 date_cached datetime NOT NULL, … … 229 232 } 230 233 234 function bp_activity_action_sitewide_feed() { 235 global $bp; 236 237 if ( $bp['current_component'] != $bp['activity']['slug'] || $bp['current_action'] != 'feed' || $bp['current_userid'] ) 238 return false; 239 240 include_once( 'bp-activity/feeds/bp-activity-sitewide-feed.php' ); 241 die; 242 } 243 add_action( 'wp', 'bp_activity_action_sitewide_feed', 3 ); 244 245 function bp_activity_action_personal_feed() { 246 global $bp; 247 248 if ( $bp['current_component'] != $bp['activity']['slug'] || !$bp['current_userid'] || $bp['current_action'] != 'feed' ) 249 return false; 250 251 include_once( 'bp-activity/feeds/bp-activity-personal-feed.php' ); 252 die; 253 } 254 add_action( 'wp', 'bp_activity_action_personal_feed', 3 ); 255 256 function bp_activity_action_friends_feed() { 257 global $bp; 258 259 if ( $bp['current_component'] != $bp['activity']['slug'] || !$bp['current_userid'] || $bp['current_action'] != 'my-friends' || $bp['action_variables'][0] != 'feed' ) 260 return false; 261 262 include_once( 'bp-activity/feeds/bp-activity-friends-feed.php' ); 263 die; 264 } 265 add_action( 'wp', 'bp_activity_action_friends_feed', 3 ); 266 267 function bp_activity_get_last_updated() { 268 return BP_Activity_Activity::get_last_updated(); 269 } 270 271 function bp_activity_get_sitewide_activity( $max_items ) { 272 return BP_Activity_Activity::get_sitewide_activity( $max_items ); 273 } 274 231 275 function bp_activity_delete( $item_id, $user_id, $component_name ) { 232 276 return BP_Activity_Activity::delete( $item_id, $user_id, $component_name ); -
trunk/bp-activity/bp-activity-classes.php
r591 r601 5 5 var $item_id; 6 6 var $user_id; 7 var $primary_link; 7 8 var $component_name; 8 9 var $component_action; … … 59 60 60 61 // Add the cached version of the activity to the cached activity table. 61 $activity_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $this->table_name_cached . " ( content, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d), %d )", $activity_content, $this->component_name, time(), $this->date_recorded, $this->is_private ) );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 ) ); 62 63 63 64 // Add the cached version of the activity to the cached activity table. 64 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $bp['loggedin_userid'], $activity_content, $this->component_name, time(), $this->date_recorded ) );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 ) ); 65 66 66 67 if ( $activity && $activity_cached ) … … 110 111 for ( $i = 0; $i < count( $activities ); $i++ ) { 111 112 $activities_formatted[$i]['content'] = $activities[$i]->content; 113 $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link; 112 114 $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded; 113 115 $activities_formatted[$i]['component_name'] = $activities[$i]->component_name; … … 127 129 continue; 128 130 129 $activities_formatted[$i]['content'] = $content; 131 $activities_formatted[$i]['content'] = $content['content']; 132 $activities_formatted[$i]['primary_link'] = $content['primary_link']; 130 133 $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded; 131 134 $activities_formatted[$i]['component_name'] = $activities[$i]->component_name; … … 145 148 } 146 149 147 function get_activity_for_friends( $user_id = null, $limit = 30, $since = '- 1 week' ) {150 function get_activity_for_friends( $user_id = null, $limit = 30, $since = '-3 days' ) { 148 151 global $wpdb, $bp; 149 152 … … 168 171 for ( $i = 0; $i < count( $activities ); $i++ ) { 169 172 $activities_formatted[$i]['content'] = $activities[$i]->content; 173 $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link; 170 174 $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded; 171 175 $activities_formatted[$i]['component_name'] = $activities[$i]->component_name; … … 191 195 for ( $j = 0; $j < count( $activities[$i]['activity']); $j++ ) { 192 196 $activities[$i]['activity'][$j]->content = bp_activity_content_filter( $activities[$i]['activity'][$j]->content, $activities[$i]['activity'][$j]->date_recorded, $activities[$i]['full_name'], false, false, false ); 193 $activities_formatted[] = array( 'user_id' => $friend_ids[$i], 'content' => $activities[$i]['activity'][$j]->content, ' date_recorded' => $activities[$i]['activity'][$j]->date_recorded, 'component_name' => $activities[$i]['activity'][$j]->component_name );197 $activities_formatted[] = array( 'user_id' => $friend_ids[$i], 'content' => $activities[$i]['activity'][$j]->content, 'primary_link' => $activities[$i]['activity'][$j]->primary_link, 'date_recorded' => $activities[$i]['activity'][$j]->date_recorded, 'component_name' => $activities[$i]['activity'][$j]->component_name ); 194 198 } 195 199 } … … 211 215 $limit_sql = $wpdb->prepare( " LIMIT %d", $limit ); 212 216 213 /* Remove entries that are older than 1 week*/214 $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_sitewide'] . " WHERE DATE_ADD(date_recorded, INTERVAL 1 WEEK) <= NOW()" ) );217 /* Remove entries that are older than 6 months */ 218 $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_sitewide'] . " WHERE DATE_ADD(date_recorded, INTERVAL 6 MONTHS) <= NOW()" ) ); 215 219 216 220 $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $bp['activity']['table_name_sitewide'] . " ORDER BY date_recorded DESC $limit_sql" ) ); … … 218 222 for ( $i = 0; $i < count( $activities ); $i++ ) { 219 223 $activities_formatted[$i]['content'] = $activities[$i]->content; 224 $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link; 220 225 $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded; 221 226 $activities_formatted[$i]['component_name'] = $activities[$i]->component_name; … … 225 230 } 226 231 232 function get_sitewide_items_for_feed( $limit = 35 ) { 233 global $wpdb, $bp; 234 235 $activities = BP_Activity_Activity::get_sitewide_activity( $limit ); 236 for ( $i = 0; $i < count($activities); $i++ ) { 237 $title = explode( '<span', $activities[$i]['content'] ); 238 239 $activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) ); 240 $activity_feed[$i]['link'] = $activities[$i]['primary_link']; 241 $activity_feed[$i]['description'] = sprintf ( $activities[$i]['content'], '' ); 242 $activity_feed[$i]['pubdate'] = $activities[$i]['date_recorded']; 243 } 244 245 return $activity_feed; 246 } 247 227 248 function cache_friends_activities( $activity_array ) { 228 249 global $wpdb, $bp; … … 233 254 for ( $i = 0; $i < count($activity_array); $i++ ) { 234 255 // Cache that sucka... 235 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_loggedin_user_friends_cached'] . " ( user_id, content, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, FROM_UNIXTIME(%d), %s )", $activity_array[$i]['user_id'], $activity_array[$i]['content'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'] ) );256 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_loggedin_user_friends_cached'] . " ( user_id, content, primary_link, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, %s, FROM_UNIXTIME(%d), %s )", $activity_array[$i]['user_id'], $activity_array[$i]['content'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'] ) ); 236 257 } 237 258 … … 252 273 253 274 // Cache that sucka... 254 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_current_user_cached'] . " ( content, component_name, date_cached, date_recorded, is_private ) VALUES ( %s, %s, FROM_UNIXTIME(%d), %s, %d )", $activity_array[$i]['content'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'], $activity_array[$i]['is_private'] ) );275 $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, 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'] ) ); 255 276 256 277 // Add to the sitewide activity stream 257 278 if ( !$activity_array[$i]['is_private'] ) 258 $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, content, component_name, date_cached, date_recorded ) VALUES ( %d, %s, %s, FROM_UNIXTIME(%d), %s )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['component_name'], time(), $activity_array[$i]['date_recorded'] ) );279 $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, 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'] ) ); 259 280 } 260 281 … … 262 283 } 263 284 285 function get_last_updated() { 286 global $bp, $wpdb; 287 288 return $wpdb->get_var( $wpdb->prepare( "SELECT date_recorded FROM " . $bp['activity']['table_name_sitewide'] . " ORDER BY date_recorded ASC LIMIT 1" ) ); 289 } 290 264 291 265 292 } -
trunk/bp-activity/bp-activity-templatetags.php
r547 r601 25 25 if ( !$user_id ) 26 26 $user_id = $bp['current_userid']; 27 28 if ( $bp['current_component'] != $bp['activity']['slug'] || ( $bp['current_component'] == $bp['activity']['slug'] && $bp['current_action'] == 'just-me' ) ) {27 28 if ( $bp['current_component'] != $bp['activity']['slug'] || ( $bp['current_component'] == $bp['activity']['slug'] && $bp['current_action'] == 'just-me' || $bp['current_action'] == 'feed' ) ) { 29 29 $this->activities = BP_Activity_Activity::get_activity_for_user( $user_id, $limit ); 30 30 } else { … … 104 104 $filter_content = true; 105 105 106 if ( !$bp_activity_user_id ) 107 $bp_activity_user_id = $bp['current_userid']; 108 109 if ( !$bp_activity_limit ) 110 $bp_activity_limit = 35; 111 106 112 $activities_template = new BP_Activity_Template( $bp_activity_user_id, $bp_activity_limit, $filter_content ); 107 113 return $activities_template->has_activities(); … … 185 191 } 186 192 193 function bp_sitewide_activity_feed_link() { 194 global $bp; 195 196 echo site_url() . '/' . $bp['activity']['slug'] . '/feed'; 197 } 198 199 function bp_activities_member_rss_link() { 200 global $bp; 201 202 if ( ( $bp['current_component'] == $bp['profile']['slug'] ) || $bp['current_action'] == 'just-me' ) 203 echo $bp['current_domain'] . $bp['activity']['slug'] . '/feed'; 204 else 205 echo $bp['current_domain'] . $bp['activity']['slug'] . '/my-friends/feed'; 206 } 207 208 /* Template tags for RSS feed output */ 209 210 function bp_activity_feed_item_title() { 211 global $activities_template; 212 213 $title = explode( '<span', $activities_template->activity['content'] ); 214 echo trim( strip_tags( $title[0] ) ); 215 } 216 217 function bp_activity_feed_item_link() { 218 global $activities_template; 219 220 echo $activities_template->activity['primary_link']; 221 } 222 223 function bp_activity_feed_item_date() { 224 global $activities_template; 225 226 echo $activities_template->activity['date_recorded']; 227 } 228 229 function bp_activity_feed_item_description() { 230 global $activities_template; 231 232 echo sprintf( $activities_template->activity['content'], '' ); 233 } 234 187 235 188 236 -
trunk/bp-activity/bp-activity-widgets.php
r436 r601 18 18 19 19 function bp_activity_widget_sitewide_activity($args) { 20 global $ current_blog;20 global $bp, $current_blog; 21 21 22 22 extract($args); … … 29 29 30 30 <?php if ( (int)$current_blog->blog_id == 1 ) : ?> 31 <?php $activity = BP_Activity_Activity::get_sitewide_activity( $options['max_items'] ) ?>31 <?php $activity = bp_activity_get_sitewide_activity( $options['max_items'] ) ?> 32 32 33 33 <?php if ( $activity ) : ?> 34 <div class="item-options" id="activity-list-options"> 35 <img src="<?php echo $bp['activity']['image_base'] ?>/rss.png" alt="<?php _e( 'RSS Feed', 'buddypress' ) ?>" /> <a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a> 36 </div> 34 37 <ul id="site-wide-stream" class="activity-list"> 35 38 <?php foreach( $activity as $item ) : ?> -
trunk/bp-blogs.php
r592 r601 249 249 return false; 250 250 251 return sprintf( __( '%s created a new blog: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . get_blog_option( $blog->blog_id, 'siteurl' ) . '">' . get_blog_option( $blog->blog_id, 'blogname' ) . '</a>' ) . ' <span class="time-since">%s</span>'; 251 return array( 252 'primary_link' => get_blog_option( $blog->blog_id, 'siteurl' ), 253 'content' => sprintf( __( '%s created a new blog: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . get_blog_option( $blog->blog_id, 'siteurl' ) . '">' . get_blog_option( $blog->blog_id, 'blogname' ) . '</a>' ) . ' <span class="time-since">%s</span>' 254 ); 252 255 break; 253 256 case 'new_blog_post': … … 262 265 return false; 263 266 264 $content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . bp_post_get_permalink( $post, $post->blog_id ) . '">' . $post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 267 $post_link = bp_post_get_permalink( $post, $post->blog_id ); 268 $content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '">' . $post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 265 269 $content .= '<blockquote>' . bp_create_excerpt($post->post_content) . '</blockquote>'; 266 return $content; 270 271 return array( 272 'primary_link' => $post_link, 273 'content' => $content 274 ); 267 275 break; 268 276 case 'new_blog_comment': … … 277 285 278 286 $comment = BP_Blogs_Comment::fetch_comment_content($comment); 279 $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . bp_post_get_permalink( $comment->post, $comment->blog_id ) . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 287 $post_link = bp_post_get_permalink( $comment->post, $comment->blog_id ); 288 $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 280 289 $content .= '<blockquote>' . bp_create_excerpt($comment->comment_content) . '</blockquote>'; 281 return $content; 290 291 return array( 292 'primary_link' => $post_link . '#comment-' . $comment->comment_ID, 293 'content' => $content 294 ); 282 295 break; 283 296 } -
trunk/bp-core/directories/bp-core-directory-members.php
r574 r601 24 24 $pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 10; 25 25 26 $users = BP_Core_User::get_active_users( $pag_num, $pag_page ); 26 if ( isset( $_GET['s'] ) ) 27 $users = BP_Core_User::search_users( $_GET['s'], $pag_num, $pag_page ); 28 else 29 $users = BP_Core_User::get_active_users( $pag_num, $pag_page ); 27 30 28 31 $pag_links = paginate_links( array( … … 129 132 <h2 class="widgettitle"><?php _e( 'Find Members', 'buddypress' ) ?></h2> 130 133 <form action="<?php echo site_url() . '/' . MEMBERS_SLUG . '/search/' ?>" method="post" id="search-members-form"> 131 <label><input type="text" name="members_search" id="members_search" value="<?php _e('Search anything...', 'buddypress' )?>" onfocus="if (this.value == '<?php _e('Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Search anything...', 'buddypress' ) ?>';}" /></label>134 <label><input type="text" name="members_search" id="members_search" value="<?php if ( isset( $_GET['s'] ) ) { echo $_GET['s']; } else { _e('Search anything...', 'buddypress' ); } ?>" onfocus="if (this.value == '<?php _e('Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Search anything...', 'buddypress' ) ?>';}" /></label> 132 135 <input type="submit" id="members_search_submit" name="members_search_submit" value="Search" /> 133 136 </form> -
trunk/bp-core/js/directory-members.js
r574 r601 6 6 jQuery("div#members-list-options a").removeClass("selected"); 7 7 jQuery(this).addClass('selected'); 8 8 9 9 var letter = jQuery(this).attr('id') 10 10 letter = letter.split('-'); -
trunk/bp-friends.php
r580 r601 221 221 222 222 if ( $for_secondary_user ) { 223 return sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->initiator_user_id ), bp_core_get_userlink($friendship->friend_user_id, false, false, true) ) . ' <span class="time-since">%s</span>'; 223 return array( 224 'primary_link' => bp_core_get_userlink( $friendship->friend_user_id, false, true ), 225 'content' => sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->initiator_user_id ), bp_core_get_userlink($friendship->friend_user_id, false, false, true) ) . ' <span class="time-since">%s</span>' 226 ); 224 227 } else { 225 return sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->friend_user_id ), bp_core_get_userlink($friendship->initiator_user_id) ) . ' <span class="time-since">%s</span>'; 228 return array( 229 'primary_link' => bp_core_get_userlink( $friendship->friend_user_id, false, true ), 230 'content' => sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->friend_user_id ), bp_core_get_userlink($friendship->initiator_user_id) ) . ' <span class="time-since">%s</span>' 231 ); 226 232 } 227 233 228 234 break; 229 235 } -
trunk/bp-groups.php
r590 r601 831 831 if ( !$group ) 832 832 return false; 833 834 return sprintf( __('%s joined the group %s', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 833 834 return array( 835 'primary_link' => bp_group_permalink( $group, false ), 836 'content' => sprintf( __('%s joined the group %s', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>' 837 ); 835 838 break; 836 839 case 'created_group': … … 839 842 if ( !$group ) 840 843 return false; 841 842 return sprintf( __('%s created the group %s', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>') . ' <span class="time-since">%s</span>'; 844 845 return array( 846 'primary_link' => bp_group_permalink( $group, false ), 847 'content' => sprintf( __('%s created the group %s', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>') . ' <span class="time-since">%s</span>' 848 ); 843 849 break; 844 850 case 'new_wire_post': … … 851 857 $content = sprintf ( __('%s wrote on the wire of the group %s', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . bp_group_permalink( $group, false ) . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 852 858 $content .= '<blockquote>' . bp_create_excerpt($wire_post->content) . '</blockquote>'; 853 return $content; 859 860 return array( 861 'primary_link' => bp_group_permalink( $group, false ), 862 'content' => $content 863 ); 854 864 break; 855 865 } -
trunk/bp-groups/bp-groups-templatetags.php
r595 r601 358 358 <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?> 359 359 <li> 360 <?php echo bp_core_get_avatar( $group_mods[$i]->user_id, 1, false,36, 36 ) ?>360 <?php echo bp_core_get_avatar( $group_mods[$i]->user_id, 1, 36, 36 ) ?> 361 361 <h5><?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) ?></h5> 362 362 <span class="activity"><?php _e( 'Group Mod', 'buddypress' ) ?></span> -
trunk/bp-xprofile.php
r574 r601 15 15 /* Functions for handling the admin area tabs for administrators */ 16 16 require_once( 'bp-xprofile/bp-xprofile-admin.php' ); 17 18 /* Functions for applying filters to Xprofile specfic output */ 19 require_once( 'bp-xprofile/bp-xprofile-filters.php' ); 17 20 18 21 /* Functions to handle the modification and saving of signup pages */ … … 421 424 422 425 if ( ( $wire_post->item_id == $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id == $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) { 426 423 427 $content = sprintf( __('%s wrote on their own wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id) ) . ': <span class="time-since">%s</span>'; 428 $return_values['primary_link'] = bp_core_get_userlink( $wire_post->user_id, false, true ); 429 424 430 } else if ( ( $wire_post->item_id != $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id != $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) { 425 $content = sprintf( __('%s wrote on %s wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id), bp_core_get_userlink( $wire_post->item_id, false, false, true, true ) ) . ': <span class="time-since">%s</span>'; 431 432 $content = sprintf( __('%s wrote on %s wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id), bp_core_get_userlink( $wire_post->item_id, false, false, true, true ) ) . ': <span class="time-since">%s</span>'; 433 $return_values['primary_link'] = bp_core_get_userlink( $wire_post->item_id, false, true ); 434 426 435 } 427 436 428 437 $content .= '<blockquote>' . bp_create_excerpt($wire_post->content) . '</blockquote>'; 429 return $content; 438 $return_values['content'] = $content; 439 440 return $return_values; 430 441 break; 431 442 case 'updated_profile': … … 434 445 if ( !$profile_group ) 435 446 return false; 436 437 return sprintf( __('%s updated the "%s" information on their profile', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 447 448 return array( 449 'primary_link' => bp_core_get_userlink( $user_id, false, true ), 450 'content' => sprintf( __('%s updated the "%s" information on their profile', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>' ) . ' <span class="time-since">%s</span>' 451 ); 438 452 break; 439 453 } -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r574 r601 203 203 function bp_the_profile_field_name() { 204 204 global $field; 205 echo stripslashes($field->name);205 echo apply_filters( 'bp_the_profile_field_name', $field->name ); 206 206 } 207 207 … … 214 214 $field->data->value = $field_value; 215 215 } 216 217 $field->data->value = xprofile_format_profile_field( $field->type, $field->data->value ); 218 219 echo stripslashes($field->data->value); 216 217 echo apply_filters( 'bp_the_profile_field_value', $field->data->value, $field->type, $field->id ); 220 218 } 221 219 … … 241 239 echo '<li' . $selected . '><a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '/edit/group/' . $groups[$i]->id . '">' . $groups[$i]->name . '</a></li>'; 242 240 } 241 242 do_action( 'bp_xprofile_profile_group_tabs' ); 243 243 } 244 244 … … 254 254 255 255 if ( $echo ) { 256 echo $group->name;256 echo apply_filters( 'bp_xprofile_profile_group_name', $group->name ); 257 257 } else { 258 return $group->name;258 return apply_filters( 'bp_xprofile_profile_group_name', $group->name ); 259 259 } 260 260 }
Note: See TracChangeset
for help on using the changeset viewer.