Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/02/2008 09:04:12 PM (16 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.