Ticket #2354: patch-2354.patch
File patch-2354.patch, 1.7 KB (added by , 15 years ago) |
---|
-
bp-forums/bp-forums-templatetags.php
708 708 var $sort_by; 709 709 var $order; 710 710 711 function BP_Forums_Template_Topic( $topic_id, $per_page, $max ) {711 function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) { 712 712 global $bp, $current_user, $forum_template; 713 713 714 714 $this->pag_page = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1; 715 715 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 716 716 717 $this->order = $order; 717 718 $this->topic_id = $topic_id; 718 719 $forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id ); 719 720 720 $this->posts = bp_forums_get_topic_posts( array( 'topic_id' => $this->topic_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num ) );721 $this->posts = bp_forums_get_topic_posts( array( 'topic_id' => $this->topic_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'order' => $this->order ) ); 721 722 722 723 if ( !$this->posts ) { 723 724 $this->post_count = 0; … … 802 803 $defaults = array( 803 804 'topic_id' => false, 804 805 'per_page' => 15, 805 'max' => false 806 'max' => false, 807 'order' => 'ASC' 806 808 ); 807 809 808 810 $r = wp_parse_args( $args, $defaults ); … … 812 814 $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[1] ); 813 815 814 816 if ( is_numeric( $topic_id ) ) 815 $topic_template = new BP_Forums_Template_Topic( $topic_id, $per_page, $max );817 $topic_template = new BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ); 816 818 else 817 819 return false; 818 820