Skip to:
Content

BuddyPress.org

Changeset 1749 for trunk/bp-blogs.php


Ignore:
Timestamp:
09/01/2009 01:45:37 AM (17 years ago)
Author:
apeatling
Message:

Centrally registered activity actions in $bp->activity->actions. This will be used to add privacy support to activity feeds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r1723 r1749  
    117117        $bp->blogs->format_notification_function = 'bp_blogs_format_notifications';
    118118        $bp->blogs->slug = BP_BLOGS_SLUG;
     119       
     120        /* Register the activity stream actions for this component */
     121        bp_blogs_register_activity_action( 'new_blog', __( 'New blog created', 'buddypress' ) );
     122        bp_blogs_register_activity_action( 'new_blog_post', __( 'New blog post published', 'buddypress' ) );
     123        bp_blogs_register_activity_action( 'new_blog_comment', __( 'New blog post comment posted', 'buddypress' ) );
    119124
    120125        /* Register this in the active components array */
    … …  
    256261}
    257262
     263function bp_blogs_register_activity_action( $key, $value ) {
     264        global $bp;
     265       
     266        if ( !function_exists( 'bp_activity_set_action' ) )
     267                return false;
     268       
     269        return apply_filters( 'bp_blogs_register_activity_action', bp_activity_set_action( $bp->blogs->id, $key, $value ), $key, $value );
     270}
     271
    258272/********************************************************************************
    259273 * Business Functions
    … …  
    315329                'content' => sprintf( __( '%s created the blog %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_blog_option( $recorded_blog->blog_id, 'siteurl' ) . '">' . attribute_escape( $name ) . '</a>' ),
    316330                'primary_link' => get_blog_option( $recorded_blog->blog_id, 'siteurl' ),
    317                 'component_action' => 'new_blog',
     331                'component_action' => $bp->activity->actions->blogs['new_blog'],
    318332                'item_id' => $recorded_blog_id
    319333        ) );
    … …  
    363377                                'content' => sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ),
    364378                                'primary_link' => $post_permalink,
    365                                 'component_action' => 'new_blog_post',
     379                                'component_action' => $bp->activity->actions->blogs['new_blog_post'],
    366380                                'item_id' => $recorded_post->id,
    367381                                'recorded_time' => $recorded_post->date_created
    … …  
    398412                        'content' => sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ),
    399413                        'primary_link' => $post_permalink,
    400                         'component_action' => 'new_blog_post',
     414                        'component_action' => $bp->activity->actions->blogs['new_blog_post'],
    401415                        'item_id' => $existing_post->id,
    402416                        'recorded_time' => $existing_post->date_created
    … …  
    444458                'content' => $content,
    445459                'primary_link' => $comment_link,
    446                 'component_action' => 'new_blog_comment',
     460                'component_action' => $bp->activity->actions->blogs['new_blog_comment'],
    447461                'item_id' => $recorded_comment->blog_id,
    448462                'recorded_time' =>  $recorded_comment->date_created
    … …  
    468482                'content' => $content,
    469483                'primary_link' => $comment_link,
    470                 'component_action' => 'new_blog_comment',
     484                'component_action' => $bp->activity->actions->blogs['new_blog_comment'],
    471485                'item_id' => $recorded_comment->blog_id,
    472486                'recorded_time' =>  $recorded_comment->date_created
Note: See TracChangeset for help on using the changeset viewer.