Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/06/2009 03:07:48 AM (18 years ago)
Author:
apeatling
Message:

Converted $bp as an array to $bp as an object. See this post for more info: http://buddypress.org/forums/topic.php?id=1125

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-templatetags.php

    r920 r1021  
    9898        global $bp, $messages_template;
    9999
    100         if ( $bp['current_action'] == 'notices' && !is_site_admin() ) {
    101                 wp_redirect( $bp['current_userid'] );
     100        if ( $bp->current_action == 'notices' && !is_site_admin() ) {
     101                wp_redirect( $bp->displayed_user->id );
    102102        } else {
    103                 if ( $bp['current_action'] == 'inbox' )
    104                         bp_core_delete_notifications_for_user_by_type( $bp['loggedin_userid'], 'messages', 'new_message' );
    105        
    106                 $messages_template = new BP_Messages_Template( $bp['loggedin_userid'], $bp['current_action'] );
     103                if ( $bp->current_action == 'inbox' )
     104                        bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'messages', 'new_message' );
     105       
     106                $messages_template = new BP_Messages_Template( $bp->loggedin_user->id, $bp->current_action );
    107107        }
    108108       
    … …  
    147147function bp_message_thread_view_link() {
    148148        global $messages_template, $bp;
    149         echo apply_filters( 'bp_message_thread_view_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/view/' . $messages_template->thread->thread_id );
     149        echo apply_filters( 'bp_message_thread_view_link', $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id );
    150150}
    151151
    152152function bp_message_thread_delete_link() {
    153153        global $messages_template, $bp;
    154         echo apply_filters( 'bp_message_thread_delete_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/' . $bp['current_action'] . '/delete/' . $messages_template->thread->thread_id );
     154        echo apply_filters( 'bp_message_thread_delete_link', $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id );
    155155}
    156156
    … …  
    197197        global $bp;
    198198       
    199         echo apply_filters( 'bp_messages_form_action', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/' . $bp['current_action'] );
     199        echo apply_filters( 'bp_messages_form_action', $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action );
    200200}
    201201
    … …  
    219219        global $bp;
    220220       
    221         if ( $bp['current_action'] != 'sentbox' ) {
     221        if ( $bp->current_action != 'sentbox' ) {
    222222?>
    223223                <?php _e( 'Select:', 'buddypress' ) ?>
    … …  
    231231                <a href="#" id="mark_as_unread"><?php _e('Mark as Unread', 'buddypress') ?></a> &nbsp;
    232232        <?php } ?>
    233                 <a href="#" id="delete_<?php echo $bp['current_action'] ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
     233                <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
    234234<?php   
    235235}
    … …  
    263263        global $messages_template, $bp;
    264264       
    265         echo apply_filters( 'bp_message_notice_delete_link', $bp['loggedin_domain'] . $bp['messages']['slug'] . '/notices/delete/' . $messages_template->thread->id );
     265        echo apply_filters( 'bp_message_notice_delete_link', $bp->loggedin_user->domain . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id );
    266266}
    267267
    … …  
    270270
    271271        if ( $messages_template->thread->is_active == "1" ) {
    272                 $link = $bp['loggedin_domain'] . $bp['messages']['slug'] . '/notices/deactivate/' . $messages_template->thread->id;
     272                $link = $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id;
    273273        } else {
    274                 $link = $bp['loggedin_domain'] . $bp['messages']['slug'] . '/notices/activate/' . $messages_template->thread->id;               
     274                $link = $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id;               
    275275        }
    276276        echo apply_filters( 'bp_message_activate_deactivate_link', $link );
    … …  
    316316                return false;
    317317       
    318         $ud = get_userdata( $bp['current_userid'] );
     318        $ud = get_userdata( $bp->displayed_user->id );
    319319        ?>
    320320        <div class="generic-button">
    321                 <a class="send-message" title="<?php _e( 'Send Message', 'buddypress' ) ?>" href="<?php echo $bp['loggedin_domain'] . $bp['messages']['slug'] ?>/compose/?r=<?php echo $ud->user_login ?>"><?php _e( 'Send Message', 'buddypress' ) ?></a>
     321                <a class="send-message" title="<?php _e( 'Send Message', 'buddypress' ) ?>" href="<?php echo $bp->loggedin_user->domain . $bp->messages->slug ?>/compose/?r=<?php echo $ud->user_login ?>"><?php _e( 'Send Message', 'buddypress' ) ?></a>
    322322        </div>
    323323        <?php
    … …  
    326326function bp_message_loading_image_src() {
    327327        global $bp;
    328         echo $bp['messages']['image_base'] . '/ajax-loader.gif';
     328        echo $bp->messages->image_base . '/ajax-loader.gif';
    329329}
    330330
Note: See TracChangeset for help on using the changeset viewer.