Index: trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 157)
+++ trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 158)
@@ -270,5 +270,5 @@
 	$query = preg_replace('/\s\s+/', ' ', $query);
 	if (!empty($_COOKIE[$author_cookie])){
-		$pattern = "WHERE(.*)post_type(.*)=(.*)'post'";
+		$pattern = "WHERE.*post_type\s*=\s*'post'\s*\)?";
 		if ( preg_match ( "/".$pattern."/i", $query, $match ) ){
 			$where_str = "$match[0]";
@@ -278,4 +278,5 @@
 				if ( preg_match ( "/post_type/", $p, $match3 ) ){
 					$post_prefix = preg_replace("/post_type/", "", $p);
+					$post_prefix = preg_replace("/\(/", "", $post_prefix);
 					break;
 				}
@@ -283,5 +284,8 @@
 			preg_match ( "/post_type(.*)/", $where_str, $p_match );
 			$patern = $p_match[0];
+			$patern = preg_replace('/\)/', '\)', $patern);
+			
 			$replace = $patern . " AND {$post_prefix}post_author = " . intval($_COOKIE[$author_cookie]) . " ";
+
 			$query = preg_replace("/$patern/", $replace, $query);
 		}
