XPressME Integration Kit

Trac


Ignore:
Timestamp:
Apr 6, 2009, 6:29:42 PM (15 years ago)
Author:
toemon
Message:

#91 マルチユーザモードでユーザ指定時人気記事リストブロックが表示されないバグ修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php

    r155 r158  
    270270        $query = preg_replace('/\s\s+/', ' ', $query); 
    271271        if (!empty($_COOKIE[$author_cookie])){ 
    272                 $pattern = "WHERE(.*)post_type(.*)=(.*)'post'"; 
     272                $pattern = "WHERE.*post_type\s*=\s*'post'\s*\)?"; 
    273273                if ( preg_match ( "/".$pattern."/i", $query, $match ) ){ 
    274274                        $where_str = "$match[0]"; 
     
    278278                                if ( preg_match ( "/post_type/", $p, $match3 ) ){ 
    279279                                        $post_prefix = preg_replace("/post_type/", "", $p); 
     280                                        $post_prefix = preg_replace("/\(/", "", $post_prefix); 
    280281                                        break; 
    281282                                } 
     
    283284                        preg_match ( "/post_type(.*)/", $where_str, $p_match ); 
    284285                        $patern = $p_match[0]; 
     286                        $patern = preg_replace('/\)/', '\)', $patern); 
     287                         
    285288                        $replace = $patern . " AND {$post_prefix}post_author = " . intval($_COOKIE[$author_cookie]) . " "; 
     289 
    286290                        $query = preg_replace("/$patern/", $replace, $query); 
    287291                } 
Note: See TracChangeset for help on using the changeset viewer.