Changeset 5696 for trunk/bp-messages/bp-messages-template.php
- Timestamp:
- 02/10/2012 09:02:53 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-messages/bp-messages-template.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-template.php
r5641 r5696 1 1 <?php 2 3 /** 4 * BuddyPress Messages Template Tags 5 * 6 * @package BuddyPress 7 * @subpackage MessagesTemplate 8 */ 9 2 10 // Exit if accessed directly 3 11 if ( !defined( 'ABSPATH' ) ) exit; 4 12 5 /** ***************************************************************************13 /** 6 14 * Message Box Template Class 7 * */8 Class BP_Messages_Box_Template {15 */ 16 class BP_Messages_Box_Template { 9 17 var $current_thread = -1; 10 18 var $current_thread_count; … … 211 219 } 212 220 function bp_get_message_thread_subject() { 213 global $messages_template , $message_template_subject;221 global $messages_template; 214 222 215 223 return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) ); … … 307 315 } 308 316 function bp_get_message_thread_avatar() { 309 global $messages_template , $bp;317 global $messages_template; 310 318 311 319 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) ); … … 397 405 398 406 function bp_messages_options() { 399 global $bp; 400 ?> 407 global $bp; ?> 408 401 409 <?php _e( 'Select:', 'buddypress' ) ?> 410 402 411 <select name="message-type-select" id="message-type-select"> 403 412 <option value=""></option> … … 406 415 <option value="all"><?php _e('All', 'buddypress') ?></option> 407 416 </select> 417 408 418 <?php if ( $bp->current_action != 'sentbox' && $bp->current_action != 'notices' ) : ?> 419 409 420 <a href="#" id="mark_as_read"><?php _e('Mark as Read', 'buddypress') ?></a> 410 421 <a href="#" id="mark_as_unread"><?php _e('Mark as Unread', 'buddypress') ?></a> 422 411 423 <?php endif; ?> 424 412 425 <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> 426 413 427 <?php 414 428 } … … 651 665 var $total_message_count; 652 666 653 function bp_messages_thread_template( $thread_id, $order ) {654 $this->__construct( $thread_id, $order );655 }656 657 667 function __construct( $thread_id, $order ) { 658 global $bp; 659 660 $this->thread = new BP_Messages_Thread( $thread_id, $order ); 668 $this->thread = new BP_Messages_Thread( $thread_id, $order ); 661 669 $this->message_count = count( $this->thread->messages ); 662 670 … … 704 712 705 713 function the_message() { 706 global $message;707 708 714 $this->in_the_loop = true; 709 $this->message = $this->next_message(); 710 711 if ( 0 == $this->current_message ) // loop has just started 715 $this->message = $this->next_message(); 716 717 // loop has just started 718 if ( 0 == $this->current_message ) 712 719 do_action('thread_loop_start'); 713 720 } … … 715 722 716 723 function bp_thread_has_messages( $args = '' ) { 717 global $ bp, $thread_template, $group_id;724 global $thread_template; 718 725 719 726 $defaults = array( 720 727 'thread_id' => false, 721 'order' => 'ASC'728 'order' => 'ASC' 722 729 ); 723 730 … … 725 732 extract( $r, EXTR_SKIP ); 726 733 727 if ( !$thread_id&& bp_is_messages_component() && bp_is_current_action( 'view' ) )728 $thread_id = (int) bp_action_variable( 0 );734 if ( empty( $thread_id ) && bp_is_messages_component() && bp_is_current_action( 'view' ) ) 735 $thread_id = (int) bp_action_variable( 0 ); 729 736 730 737 $thread_template = new BP_Messages_Thread_Template( $thread_id, $order ); … … 775 782 } 776 783 function bp_get_the_thread_recipients() { 777 global $thread_template , $bp;784 global $thread_template; 778 785 779 786 $recipient_links = array(); … … 811 818 812 819 $defaults = array( 813 'type' => 'thumb',814 'width' => false,820 'type' => 'thumb', 821 'width' => false, 815 822 'height' => false, 816 823 ); … … 882 889 } 883 890 add_action( 'messages_box_loop_start', 'bp_messages_embed' ); 891 884 892 ?>
Note: See TracChangeset
for help on using the changeset viewer.