Changeset 158 for trunk/wp-content/plugins/xpressme
- Timestamp:
- Apr 6, 2009, 6:29:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
r155 r158 270 270 $query = preg_replace('/\s\s+/', ' ', $query); 271 271 if (!empty($_COOKIE[$author_cookie])){ 272 $pattern = "WHERE (.*)post_type(.*)=(.*)'post'";272 $pattern = "WHERE.*post_type\s*=\s*'post'\s*\)?"; 273 273 if ( preg_match ( "/".$pattern."/i", $query, $match ) ){ 274 274 $where_str = "$match[0]"; … … 278 278 if ( preg_match ( "/post_type/", $p, $match3 ) ){ 279 279 $post_prefix = preg_replace("/post_type/", "", $p); 280 $post_prefix = preg_replace("/\(/", "", $post_prefix); 280 281 break; 281 282 } … … 283 284 preg_match ( "/post_type(.*)/", $where_str, $p_match ); 284 285 $patern = $p_match[0]; 286 $patern = preg_replace('/\)/', '\)', $patern); 287 285 288 $replace = $patern . " AND {$post_prefix}post_author = " . intval($_COOKIE[$author_cookie]) . " "; 289 286 290 $query = preg_replace("/$patern/", $replace, $query); 287 291 }
Note: See TracChangeset
for help on using the changeset viewer.