Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/31/2010 12:05:08 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1701

File:
1 edited

Legend:

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

    r2460 r2488  
    153153    global $forum_template, $bp;
    154154
     155    /***
     156     * Set the defaults based on the current page. Any of these will be overridden
     157     * if arguments are directly passed into the loop. Custom plugins should always
     158     * pass their parameters directly to the loop.
     159     */
     160    $type = 'newest';
     161    $user_id = false;
     162    $page = 1;
     163
     164    /* User filtering */
     165    if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-forums-scope'] )
     166        $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
     167
     168    /* Action filtering */
     169    if ( !empty( $_COOKIE['bp-forums-filter'] ) && '-1' != $_COOKIE['bp-forums-filter'] )
     170        $type = $_COOKIE['bp-forums-filter'];
     171
     172    if ( !empty( $_COOKIE['bp-forums-page'] ) && '-1' != $_COOKIE['bp-forums-page'] )
     173        $page = $_COOKIE['bp-forums-page'];
     174
    155175    $defaults = array(
    156         'type' => 'newest',
     176        'type' => $type,
    157177        'forum_id' => false,
    158         'user_id' => false,
    159         'page' => 1,
    160         'per_page' => 15,
     178        'user_id' => $user_id,
     179        'page' => $page,
     180        'per_page' => 20,
    161181        'max' => false,
    162182        'no_stickies' => false,
     
    165185
    166186    $r = wp_parse_args( $args, $defaults );
    167     extract( $r, EXTR_SKIP );
     187    extract( $r );
    168188
    169189    /* If we're in a single group, set this group's forum_id */
Note: See TracChangeset for help on using the changeset viewer.