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-blogs/bp-blogs-templatetags.php

    r2389 r2488  
    127127    global $blogs_template;
    128128
     129    /***
     130     * Set the defaults based on the current page. Any of these will be overridden
     131     * if arguments are directly passed into the loop. Custom plugins should always
     132     * pass their parameters directly to the loop.
     133     */
     134    $type = 'active';
     135    $user_id = false;
     136    $page = 1;
     137
     138    /* User filtering */
     139    if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-blogs-scope'] )
     140        $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
     141
     142    /* Action filtering */
     143    if ( !empty( $_COOKIE['bp-blogs-filter'] ) && '-1' != $_COOKIE['bp-blogs-filter'] )
     144        $type = $_COOKIE['bp-blogs-filter'];
     145
     146    if ( !empty( $_COOKIE['bp-blogs-page'] ) && '-1' != $_COOKIE['bp-blogs-page'] )
     147        $page = $_COOKIE['bp-blogs-page'];
     148
    129149    $defaults = array(
    130         'type' => 'active',
    131         'page' => 1,
     150        'type' => $type,
     151        'page' => $page,
    132152        'per_page' => 20,
    133153        'max' => false,
    134154
    135         'user_id' => false, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
     155        'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
    136156        'search_terms' => false // Pass search terms to filter on the blog title or description.
    137157    );
Note: See TracChangeset for help on using the changeset viewer.