Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/04/2010 04:32:35 PM (16 years ago)
Author:
apeatling
Message:

Fixes #1803

File:
1 edited

Legend:

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

    r2587 r2594  
    2727        $this->search_terms = $search_terms;
    2828
    29         /* Only show stickies if we are viewing a single group forum, otherwise we could end up with hundreds globally */
    30         if ( $no_stickies )
    31             $show_stickies = 'all'; // bbPress needs str 'no'
    32 
    3329        switch ( $type ) {
    3430            case 'newest': default:
    35                 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $show_stickies ) );
     31                $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
    3632                break;
    3733
    3834            case 'popular':
    39                 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'popular', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $show_stickies ) );
     35                $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'popular', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
    4036                break;
    4137
    4238            case 'unreplied':
    43                 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'unreplied', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $show_stickies ) );
     39                $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'unreplied', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
    4440                break;
    4541
    4642            case 'tag':
    47                 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'tag', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $show_stickies ) );
     43                $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'tag', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
    4844                break;
    4945        }
     
    165161    $forum_id = false;
    166162    $search_terms = false;
    167     $no_stickies = false;
     163    $no_stickies = 'all';
    168164
    169165    /* User filtering */
     
    192188        $search_terms = $_GET['fs'];
    193189
    194     /* Don't show stickies on the directory page, otherwise we might end up with 100's */
    195     if ( $bp->is_directory )
    196         $no_stickies = true;
     190    /* Show stickies on a group forum */
     191    if ( $bp->groups->current_group )
     192        $no_stickies = null;
    197193
    198194    $defaults = array(
Note: See TracChangeset for help on using the changeset viewer.