Skip to:
Content

BuddyPress.org

Changeset 601


Ignore:
Timestamp:
12/02/2008 09:04:12 PM (13 years ago)
Author:
apeatling
Message:

Added profile field filters
Added RSS feeds to site wide, personal and friend feeds
Small fixes on blog, member and group directories

Location:
trunk
Files:
7 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r591 r601  
    33
    44define ( 'BP_ACTIVITY_IS_INSTALLED', 1 );
    5 define ( 'BP_ACTIVITY_VERSION', '0.2.4' );
     5define ( 'BP_ACTIVITY_VERSION', '0.2.6' );
    66
    77/* How long before activity items in streams are re-cached? */
     
    4444                id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    4545                content longtext NOT NULL,
     46                primary_link varchar(150) NOT NULL,
    4647                component_name varchar(75) NOT NULL,
    4748                date_cached datetime NOT NULL,
     
    5859                user_id int(11) NOT NULL,
    5960                content longtext NOT NULL,
     61                primary_link varchar(150) NOT NULL,
    6062                component_name varchar(75) NOT NULL,
    6163                date_cached datetime NOT NULL,
     
    8991                user_id int(11) NOT NULL,
    9092                content longtext NOT NULL,
     93                primary_link varchar(150) NOT NULL,
    9194                component_name varchar(75) NOT NULL,
    9295                date_cached datetime NOT NULL,
     
    229232}
    230233
     234function 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}
     243add_action( 'wp', 'bp_activity_action_sitewide_feed', 3 );
     244
     245function 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}
     254add_action( 'wp', 'bp_activity_action_personal_feed', 3 );
     255
     256function 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}
     265add_action( 'wp', 'bp_activity_action_friends_feed', 3 );
     266
     267function bp_activity_get_last_updated() {
     268    return BP_Activity_Activity::get_last_updated();
     269}
     270
     271function bp_activity_get_sitewide_activity( $max_items ) {
     272    return BP_Activity_Activity::get_sitewide_activity( $max_items );
     273}
     274
    231275function bp_activity_delete( $item_id, $user_id, $component_name ) {
    232276    return BP_Activity_Activity::delete( $item_id, $user_id, $component_name );
  • trunk/bp-activity/bp-activity-classes.php

    r591 r601  
    55    var $item_id;
    66    var $user_id;
     7    var $primary_link;
    78    var $component_name;
    89    var $component_action;
     
    5960           
    6061            // 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 ) );
    6263       
    6364            // 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 ) );
    6566           
    6667            if ( $activity && $activity_cached )
     
    110111            for ( $i = 0; $i < count( $activities ); $i++ ) {
    111112                $activities_formatted[$i]['content'] = $activities[$i]->content;
     113                $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link;
    112114                $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
    113115                $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
     
    127129                        continue;
    128130                       
    129                     $activities_formatted[$i]['content'] = $content;
     131                    $activities_formatted[$i]['content'] = $content['content'];
     132                    $activities_formatted[$i]['primary_link'] = $content['primary_link'];
    130133                    $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
    131134                    $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
     
    145148    }
    146149   
    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' ) {
    148151        global $wpdb, $bp;
    149152       
     
    168171            for ( $i = 0; $i < count( $activities ); $i++ ) {
    169172                $activities_formatted[$i]['content'] = $activities[$i]->content;
     173                $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link;
    170174                $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
    171175                $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
     
    191195                for ( $j = 0; $j < count( $activities[$i]['activity']); $j++ ) {
    192196                    $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 );
    194198                }
    195199            }
     
    211215            $limit_sql = $wpdb->prepare( " LIMIT %d", $limit );
    212216       
    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()" ) );
    215219       
    216220        $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $bp['activity']['table_name_sitewide'] . " ORDER BY date_recorded DESC $limit_sql" ) );
     
    218222        for ( $i = 0; $i < count( $activities ); $i++ ) {
    219223            $activities_formatted[$i]['content'] = $activities[$i]->content;
     224            $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link;
    220225            $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
    221226            $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
     
    225230    }
    226231   
     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   
    227248    function cache_friends_activities( $activity_array ) {
    228249        global $wpdb, $bp;
     
    233254        for ( $i = 0; $i < count($activity_array); $i++ ) {
    234255            // 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'] ) );
    236257        }
    237258       
     
    252273           
    253274            // 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'] ) );
    255276           
    256277            // Add to the sitewide activity stream
    257278            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'] ) );
    259280        }
    260281       
     
    262283    }
    263284   
     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   
    264291
    265292}
  • trunk/bp-activity/bp-activity-templatetags.php

    r547 r601  
    2525        if ( !$user_id )
    2626            $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' ) ) {
    2929            $this->activities = BP_Activity_Activity::get_activity_for_user( $user_id, $limit );
    3030        } else {
     
    104104        $filter_content = true;
    105105   
     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       
    106112    $activities_template = new BP_Activity_Template( $bp_activity_user_id, $bp_activity_limit, $filter_content );       
    107113    return $activities_template->has_activities();
     
    185191}
    186192
     193function bp_sitewide_activity_feed_link() {
     194    global $bp;
     195   
     196    echo site_url() . '/' . $bp['activity']['slug'] . '/feed';
     197}
     198
     199function 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
     210function 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
     217function bp_activity_feed_item_link() {
     218    global $activities_template;
     219
     220    echo $activities_template->activity['primary_link'];
     221}
     222
     223function bp_activity_feed_item_date() {
     224    global $activities_template;
     225
     226    echo $activities_template->activity['date_recorded'];
     227}
     228
     229function bp_activity_feed_item_description() {
     230    global $activities_template;
     231
     232    echo sprintf( $activities_template->activity['content'], '' ); 
     233}
     234
    187235
    188236
  • trunk/bp-activity/bp-activity-widgets.php

    r436 r601  
    1818
    1919function bp_activity_widget_sitewide_activity($args) {
    20     global $current_blog;
     20    global $bp, $current_blog;
    2121   
    2222    extract($args);
     
    2929
    3030    <?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'] ) ?>
    3232       
    3333        <?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>
    3437            <ul id="site-wide-stream" class="activity-list">
    3538            <?php foreach( $activity as $item ) : ?>
  • trunk/bp-blogs.php

    r592 r601  
    249249                return false;
    250250               
    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            ); 
    252255        break;
    253256        case 'new_blog_post':
     
    262265                return false;
    263266
    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>';     
    265269            $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            );
    267275        break;
    268276        case 'new_blog_comment':
     
    277285
    278286            $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>';       
    280289            $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            );
    282295        break;
    283296    }
  • trunk/bp-core/directories/bp-core-directory-members.php

    r574 r601  
    2424    $pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 10;
    2525   
    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 );
    2730
    2831    $pag_links = paginate_links( array(
     
    129132        <h2 class="widgettitle"><?php _e( 'Find Members', 'buddypress' ) ?></h2>
    130133        <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>
    132135            <input type="submit" id="members_search_submit" name="members_search_submit" value="Search" />
    133136        </form>
  • trunk/bp-core/js/directory-members.js

    r574 r601  
    66            jQuery("div#members-list-options a").removeClass("selected");
    77            jQuery(this).addClass('selected');
    8 
     8           
    99            var letter = jQuery(this).attr('id')
    1010            letter = letter.split('-');
  • trunk/bp-friends.php

    r580 r601  
    221221           
    222222            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                );             
    224227            } 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                );             
    226232            }
    227 
     233           
    228234        break;
    229235    }
  • trunk/bp-groups.php

    r590 r601  
    831831            if ( !$group )
    832832                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            );             
    835838        break;
    836839        case 'created_group':
     
    839842            if ( !$group )
    840843                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            );
    843849        break;
    844850        case 'new_wire_post':
     
    851857            $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>';         
    852858            $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            );
    854864        break;
    855865    }
  • trunk/bp-groups/bp-groups-templatetags.php

    r595 r601  
    358358            <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?>
    359359                <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 ) ?>
    361361                    <h5><?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) ?></h5>
    362362                    <span class="activity"><?php _e( 'Group Mod', 'buddypress' ) ?></span>
  • trunk/bp-xprofile.php

    r574 r601  
    1515/* Functions for handling the admin area tabs for administrators */
    1616require_once( 'bp-xprofile/bp-xprofile-admin.php' );
     17
     18/* Functions for applying filters to Xprofile specfic output */
     19require_once( 'bp-xprofile/bp-xprofile-filters.php' );
    1720
    1821/* Functions to handle the modification and saving of signup pages */
     
    421424
    422425            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               
    423427                $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           
    424430            } 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           
    426435            }
    427436           
    428437            $content .= '<blockquote>' . bp_create_excerpt($wire_post->content) . '</blockquote>';
    429             return $content;
     438            $return_values['content'] = $content;
     439           
     440            return $return_values;
    430441        break;
    431442        case 'updated_profile':
     
    434445            if ( !$profile_group )
    435446                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            );
    438452        break;
    439453    }
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r574 r601  
    203203function bp_the_profile_field_name() {
    204204    global $field;
    205     echo stripslashes($field->name);
     205    echo apply_filters( 'bp_the_profile_field_name', $field->name );
    206206}
    207207
     
    214214        $field->data->value = $field_value;
    215215    }
    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 );
    220218}
    221219
     
    241239        echo '<li' . $selected . '><a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '/edit/group/' . $groups[$i]->id . '">' . $groups[$i]->name . '</a></li>';
    242240    }
     241   
     242    do_action( 'bp_xprofile_profile_group_tabs' );
    243243}
    244244
     
    254254   
    255255    if ( $echo ) {
    256         echo $group->name;
     256        echo apply_filters( 'bp_xprofile_profile_group_name', $group->name );
    257257    } else {
    258         return $group->name;
     258        return apply_filters( 'bp_xprofile_profile_group_name', $group->name );
    259259    }
    260260}
Note: See TracChangeset for help on using the changeset viewer.