Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/04/2010 10:09:40 AM (15 years ago)
Author:
apeatling
Message:

Fixes #1793 - remove querystring building from theme and querystring cookie management from core.

File:
1 edited

Legend:

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

    r2533 r2580  
    163163    $type = 'newest';
    164164    $user_id = false;
    165     $page = 1;
     165    $forum_id = false;
     166    $search_terms = false;
    166167
    167168    /* User filtering */
    168     if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-forums-scope'] )
    169         $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
    170 
    171     /* Action filtering */
    172     if ( !empty( $_COOKIE['bp-forums-filter'] ) && '-1' != $_COOKIE['bp-forums-filter'] )
    173         $type = $_COOKIE['bp-forums-filter'];
    174 
    175     if ( !empty( $_COOKIE['bp-forums-page'] ) && '-1' != $_COOKIE['bp-forums-page'] )
    176         $page = $_COOKIE['bp-forums-page'];
    177 
    178     $defaults = array(
    179         'type' => $type,
    180         'forum_id' => false,
    181         'user_id' => $user_id,
    182         'page' => $page,
    183         'per_page' => 20,
    184         'max' => false,
    185         'no_stickies' => false,
    186         'search_terms' => false
    187     );
    188 
    189     $r = wp_parse_args( $args, $defaults );
    190     extract( $r );
     169    if ( !empty( $bp->displayed_user->id ) )
     170        $user_id = $bp->displayed_user->id;
    191171
    192172    /* If we're in a single group, set this group's forum_id */
     
    211191        $search_terms = $_GET['fs'];
    212192
     193    $defaults = array(
     194        'type' => $type,
     195        'forum_id' => $forum_id,
     196        'user_id' => $user_id,
     197        'page' => 1,
     198        'per_page' => 20,
     199        'max' => false,
     200        'no_stickies' => false,
     201        'search_terms' => $search_terms
     202    );
     203
     204    $r = wp_parse_args( $args, $defaults );
     205    extract( $r );
     206
    213207    $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms );
    214 
    215208    return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template );
    216209}
Note: See TracChangeset for help on using the changeset viewer.