Skip to:
Content

BuddyPress.org

Changeset 1750 for trunk/bp-blogs.php


Ignore:
Timestamp:
09/01/2009 02:12:35 AM (17 years ago)
Author:
apeatling
Message:

Further activity action revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r1749 r1750  
    118118        $bp->blogs->slug = BP_BLOGS_SLUG;
    119119       
    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' ) );
    124 
    125120        /* Register this in the active components array */
    126121        $bp->active_components[$bp->blogs->slug] = $bp->blogs->id;
     
    225220 */
    226221
     222function bp_blogs_register_activity_actions() {
     223        global $bp;
     224       
     225        if ( !function_exists( 'bp_activity_set_action' ) )
     226                return false;
     227
     228        bp_activity_set_action( $bp->blogs->id, 'new_blog', __( 'New blog created', 'buddypress' ) );
     229        bp_activity_set_action( $bp->blogs->id, 'new_blog_post', __( 'New blog post published', 'buddypress' ) );
     230        bp_activity_set_action( $bp->blogs->id, 'new_blog_comment', __( 'New blog post comment posted', 'buddypress' ) );
     231
     232        do_action( 'bp_blogs_register_activity_actions' );
     233}
     234add_action( 'plugins_loaded', 'bp_blogs_register_activity_actions' );
     235
    227236function bp_blogs_record_activity( $args = '' ) {
    228237        global $bp;
     
    261270}
    262271
    263 function 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 
    272272/********************************************************************************
    273273 * Business Functions
     
    329329                '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>' ),
    330330                'primary_link' => get_blog_option( $recorded_blog->blog_id, 'siteurl' ),
    331                 'component_action' => $bp->activity->actions->blogs['new_blog'],
     331                'component_action' => 'new_blog',
    332332                'item_id' => $recorded_blog_id
    333333        ) );
     
    377377                                '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>' ),
    378378                                'primary_link' => $post_permalink,
    379                                 'component_action' => $bp->activity->actions->blogs['new_blog_post'],
     379                                'component_action' => 'new_blog_post',
    380380                                'item_id' => $recorded_post->id,
    381381                                'recorded_time' => $recorded_post->date_created
     
    412412                        '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>' ),
    413413                        'primary_link' => $post_permalink,
    414                         'component_action' => $bp->activity->actions->blogs['new_blog_post'],
     414                        'component_action' => 'new_blog_post',
    415415                        'item_id' => $existing_post->id,
    416416                        'recorded_time' => $existing_post->date_created
     
    458458                'content' => $content,
    459459                'primary_link' => $comment_link,
    460                 'component_action' => $bp->activity->actions->blogs['new_blog_comment'],
     460                'component_action' => 'new_blog_comment',
    461461                'item_id' => $recorded_comment->blog_id,
    462462                'recorded_time' =>  $recorded_comment->date_created
     
    482482                'content' => $content,
    483483                'primary_link' => $comment_link,
    484                 'component_action' => $bp->activity->actions->blogs['new_blog_comment'],
     484                'component_action' => 'new_blog_comment',
    485485                'item_id' => $recorded_comment->blog_id,
    486486                'recorded_time' =>  $recorded_comment->date_created
Note: See TracChangeset for help on using the changeset viewer.