Skip to:
Content

BuddyPress.org

Changeset 3216


Ignore:
Timestamp:
08/25/2010 03:53:28 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2354 props Paul Gibbs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-forums/bp-forums-templatetags.php

    r3192 r3216  
    714714    var $order;
    715715
    716     function BP_Forums_Template_Topic( $topic_id, $per_page, $max ) {
     716    function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) {
    717717        global $bp, $current_user, $forum_template;
    718718
    719         $this->pag_page = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
    720         $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    721 
    722         $this->topic_id = $topic_id;
     719        $this->pag_page        = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
     720        $this->pag_num         = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
     721
     722        $this->order           = $order;
     723        $this->topic_id        = $topic_id;
    723724        $forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id );
    724         $this->forum_id = $forum_template->topic->forum_id;
    725 
    726         $this->posts = bp_forums_get_topic_posts( array( 'topic_id' => $this->topic_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num ) );
     725        $this->forum_id        = $forum_template->topic->forum_id;
     726
     727        $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 ) );
    727728
    728729        if ( !$this->posts ) {
     
    809810        'topic_id' => false,
    810811        'per_page' => 15,
    811         'max' => false
     812        'max'      => false,
     813        'order'    => 'ASC'
    812814    );
    813815
     
    819821
    820822    if ( is_numeric( $topic_id ) ) {
    821         $topic_template = new BP_Forums_Template_Topic( $topic_id, $per_page, $max );
     823        $topic_template = new BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order );
    822824
    823825        // Current topic forum_id needs to match current_group forum_id
Note: See TracChangeset for help on using the changeset viewer.