Changeset 236 for trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
- Timestamp:
- May 26, 2009, 3:19:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
r232 r236 235 235 } 236 236 237 function xpress_set_author_cookie() 238 { 237 function xpress_set_author_cookie($query_vars) 238 { 239 global $wp , $wpdb; 239 240 $author_cookie = get_xpress_dir_name() . "_select_author" ; 240 241 if(xpress_is_multi_user()){ 241 if (empty($_GET)){ 242 // $GLOBALS["wp_xoops_author"] = null; 243 setcookie($author_cookie, 0); 244 $_COOKIE[$author_cookie] = 0; 245 246 } else { 242 if (!empty($_GET)){ 247 243 $auth = intval( @$_GET["author"] ); 248 244 if ($auth > 0){ 249 setcookie($author_cookie, $auth );245 setcookie($author_cookie, $auth, time()+3600, COOKIEPATH); 250 246 $_COOKIE[$author_cookie] = $auth; 251 247 } 248 } else { 249 if (!empty($wp->query_vars) ){ 250 if (!empty($wp->query_vars['author_name']) ){ 251 $author_name = $wp->query_vars['author_name']; 252 $auth = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_login = '$author_name'"); 253 254 setcookie($author_cookie, $auth, time()+3600, COOKIEPATH); 255 $_COOKIE[$author_cookie] = $auth; 256 } 257 } else { 258 setcookie($author_cookie, 0, time()+3600, COOKIEPATH); 259 $_COOKIE[$author_cookie] = 0; 260 } 252 261 } 253 262 }else{ 254 263 // $GLOBALS["wp_xoops_author"] = null; 255 setcookie($author_cookie, 0 );264 setcookie($author_cookie, 0, time()+3600, COOKIEPATH); 256 265 $_COOKIE[$author_cookie] = 0; 257 266 } 267 return $query_vars; 258 268 } 259 269
Note: See TracChangeset
for help on using the changeset viewer.