Skip to:
Content

BuddyPress.org

Changeset 2822 for trunk/bp-activity.php


Ignore:
Timestamp:
03/08/2010 04:20:25 PM (16 years ago)
Author:
apeatling
Message:

Merge 1.2 branch with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2761 r2822  
    248248        if ( !$has_access ) {
    249249                bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' );
    250                 bp_core_redirect( $bp->loggedin_user->domain );
     250
     251                if ( is_user_logged_in() )
     252                        bp_core_redirect( $bp->loggedin_user->domain );
     253                else
     254                        bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . clean_url( $bp->root_domain . '/' . $bp->activity->slug . '/p/' . $bp->current_action ) ) );
    251255        }
    252256
     
    312316        if ( $activity->component == $bp->groups->id ) {
    313317                if ( $activity->user_id )
    314                         $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id;
     318                        $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id . '/';
    315319                else {
    316320                        if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) )
    317                                 $redirect = bp_get_group_permalink( $group ) . $bp->activity->slug . '/' . $activity->id;
     321                                $redirect = bp_get_group_permalink( $group ) . $bp->activity->slug . '/' . $activity->id . '/';
    318322                }
    319323        } else
    320324                $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id;
    321325
     326        $redirect = apply_filters( 'bp_activity_permalink_redirect_url', $redirect, &$activity );
     327
    322328        if ( !$redirect )
    323329                bp_core_redirect( $bp->root_domain );
    324330
    325331        /* Redirect to the actual activity permalink page */
    326         bp_core_redirect( apply_filters( 'bp_activity_action_permalink_url', $redirect . '/', &$activity ) );
     332        bp_core_redirect( $redirect );
    327333}
    328334add_action( 'wp', 'bp_activity_action_permalink_router', 3 );
     
    715721
    716722        $defaults = array(
     723                'id' => false,
    717724                'content' => false,
    718725                'user_id' => $bp->loggedin_user->id,
     
    736743        /* Insert the activity comment */
    737744        $comment_id = bp_activity_add( array(
     745                'id' => $id,
    738746                'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
    739747                'content' => apply_filters( 'bp_activity_comment_content', $content ),
     
    773781                'secondary_item_id' => false,
    774782                'action' => false,
    775                 'content' => false
     783                'content' => false,
     784                'date_recorded' => false,
    776785        );
    777786
     
    779788        extract( $r, EXTR_SKIP );
    780789
    781         return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content ) );
     790        return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) );
    782791}
    783792
Note: See TracChangeset for help on using the changeset viewer.