Skip to:
Content

BuddyPress.org

Ticket #2354: patch-2354.patch

File patch-2354.patch, 1.7 KB (added by DJPaul, 15 years ago)

v1

  • bp-forums/bp-forums-templatetags.php

     
    708708        var $sort_by;
    709709        var $order;
    710710
    711         function BP_Forums_Template_Topic( $topic_id, $per_page, $max ) {
     711        function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) {
    712712                global $bp, $current_user, $forum_template;
    713713
    714714                $this->pag_page = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
    715715                $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    716716
     717                $this->order = $order;
    717718                $this->topic_id = $topic_id;
    718719                $forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id );
    719720
    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 ) );
    721722
    722723                if ( !$this->posts ) {
    723724                        $this->post_count = 0;
     
    802803        $defaults = array(
    803804                'topic_id' => false,
    804805                'per_page' => 15,
    805                 'max' => false
     806                'max' => false,
     807                'order' => 'ASC'
    806808        );
    807809
    808810        $r = wp_parse_args( $args, $defaults );
     
    812814                $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[1] );
    813815
    814816        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 );
    816818        else
    817819                return false;
    818820