Changeset 2488 for trunk/bp-blogs/bp-blogs-templatetags.php
- Timestamp:
- 01/31/2010 12:05:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-templatetags.php
r2389 r2488 127 127 global $blogs_template; 128 128 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 129 149 $defaults = array( 130 'type' => 'active',131 'page' => 1,150 'type' => $type, 151 'page' => $page, 132 152 'per_page' => 20, 133 153 'max' => false, 134 154 135 'user_id' => false, // Pass a user_id to limit to only blogs this user has higher than subscriber access to155 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 136 156 'search_terms' => false // Pass search terms to filter on the blog title or description. 137 157 );
Note: See TracChangeset
for help on using the changeset viewer.