Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/10/2014 03:54:41 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Bracketize extensions, and missed a spot in the admin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/activity.php

    r4995 r5441  
    271271
    272272        // Bail if no activity ID is in post meta
    273         if ( empty( $activity_id ) )
     273        if ( empty( $activity_id ) ) {
    274274            return null;
     275        }
    275276
    276277        // Get the activity stream item, bail if it doesn't exist
    277278        $existing = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) );
    278         if ( empty( $existing['total'] ) || ( 1 !== (int) $existing['total'] ) )
     279        if ( empty( $existing['total'] ) || ( 1 !== (int) $existing['total'] ) ) {
    279280            return null;
     281        }
    280282
    281283        // Return the activity ID since we've verified the connection
     
    296298
    297299        // Already forced off, so comply
    298         if ( false === $can_comment )
     300        if ( false === $can_comment ) {
    299301            return $can_comment;
     302        }
    300303
    301304        // Check if blog & forum activity stream commenting is off
     
    383386
    384387        // Bail early if topic is by anonymous user
    385         if ( !empty( $anonymous_data ) )
    386             return;
     388        if ( !empty( $anonymous_data ) ) {
     389            return;
     390        }
    387391
    388392        // Bail if site is private
    389         if ( !bbp_is_site_public() )
    390             return;
     393        if ( !bbp_is_site_public() ) {
     394            return;
     395        }
    391396
    392397        // Validate activity data
     
    396401
    397402        // Bail if user is not active
    398         if ( bbp_is_user_inactive( $user_id ) )
    399             return;
     403        if ( bbp_is_user_inactive( $user_id ) ) {
     404            return;
     405        }
    400406
    401407        // Bail if topic is not published
    402         if ( !bbp_is_topic_published( $topic_id ) )
    403             return;
     408        if ( !bbp_is_topic_published( $topic_id ) ) {
     409            return;
     410        }
    404411
    405412        // User link for topic author
     
    451458
    452459        // Get activity ID, bail if it doesn't exist
    453         if ( $activity_id = $this->get_activity_id( $topic_id ) )
     460        $activity_id = $this->get_activity_id( $topic_id );
     461        if ( !empty( $activity_id ) ) {
    454462            return bp_activity_delete( array( 'id' => $activity_id ) );
     463        }
    455464
    456465        return false;
     
    460469     * Update the activity stream entry when a topic status changes
    461470     *
    462      * @param int $post_id
     471     * @param int $topic_id
    463472     * @param obj $post
    464473     * @uses get_post_type()
     
    475484
    476485        // Bail early if not a topic
    477         if ( get_post_type( $post ) !== bbp_get_topic_post_type() )
    478             return;
     486        if ( get_post_type( $post ) !== bbp_get_topic_post_type() ) {
     487            return;
     488        }
    479489
    480490        $topic_id = bbp_get_topic_id( $topic_id );
    481491
    482492        // Bail early if topic is by anonymous user
    483         if ( bbp_is_topic_anonymous( $topic_id ) )
    484             return;
     493        if ( bbp_is_topic_anonymous( $topic_id ) ) {
     494            return;
     495        }
    485496
    486497        // Action based on new status
     
    524535
    525536        // Do not log activity of anonymous users
    526         if ( !empty( $anonymous_data ) )
    527             return;
     537        if ( !empty( $anonymous_data ) ) {
     538            return;
     539        }
    528540
    529541        // Bail if site is private
    530         if ( !bbp_is_site_public() )
    531             return;
     542        if ( !bbp_is_site_public() ) {
     543            return;
     544        }
    532545
    533546        // Validate activity data
     
    538551
    539552        // Bail if user is not active
    540         if ( bbp_is_user_inactive( $user_id ) )
    541             return;
     553        if ( bbp_is_user_inactive( $user_id ) ) {
     554            return;
     555        }
    542556
    543557        // Bail if reply is not published
    544         if ( !bbp_is_reply_published( $reply_id ) )
    545             return;
     558        if ( !bbp_is_reply_published( $reply_id ) ) {
     559            return;
     560        }
    546561
    547562        // Setup links for activity stream
     
    597612
    598613        // Get activity ID, bail if it doesn't exist
    599         if ( $activity_id = $this->get_activity_id( $reply_id ) )
     614        $activity_id = $this->get_activity_id( $reply_id );
     615        if ( !empty( $activity_id ) ) {
    600616            return bp_activity_delete( array( 'id' => $activity_id ) );
     617        }
    601618
    602619        return false;
     
    606623     * Update the activity stream entry when a reply status changes
    607624     *
    608      * @param int $post_id
     625     * @param int $reply_id
    609626     * @param obj $post
    610627     * @uses get_post_type()
     
    622639
    623640        // Bail early if not a reply
    624         if ( get_post_type( $post ) !== bbp_get_reply_post_type() )
    625             return;
     641        if ( get_post_type( $post ) !== bbp_get_reply_post_type() ) {
     642            return;
     643        }
    626644
    627645        $reply_id = bbp_get_reply_id( $reply_id );
    628646
    629647        // Bail early if reply is by anonymous user
    630         if ( bbp_is_reply_anonymous( $reply_id ) )
    631             return;
     648        if ( bbp_is_reply_anonymous( $reply_id ) ) {
     649            return;
     650        }
    632651
    633652        // Action based on new status
Note: See TracChangeset for help on using the changeset viewer.