XPressME Integration Kit

Trac

Changeset 158


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

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

Location:
trunk/wp-content
Files:
4 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                } 
  • trunk/wp-content/themes/xpress_default/blocks/popular_posts_block_theme.php

    r157 r158  
    2626        $selected_author_id = xpress_selected_author_id(false);  
    2727 
    28         global $wpdb,$wp_query; 
     28        global $wpdb,$wp_query,$xoops_db; 
    2929         
    3030        $db_prefix = get_wp_prefix(); 
     
    4343        include ($mydirpath . '/wp-includes/version.php'); 
    4444                 
    45         $select = "SELECT $view_tb.post_views, $post_tb.ID, $post_tb.post_title, $post_tb.post_date, $user_tb.display_name";                             
    46         if ($wp_db_version >= 6124){ 
    47                 $from  = " FROM (((("; 
     45        $select = "SELECT $view_tb.post_views, $post_tb.ID, $post_tb.post_title, $post_tb.post_date";                            
     46 
     47                $from  = " FROM ((("; 
    4848                $from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)"; 
    4949                $from .= " INNER JOIN $term_relationships_tb ON $post_tb.ID = $term_relationships_tb.object_id)"; 
    5050                $from .= " INNER JOIN $term_taxonomy ON $term_relationships_tb.term_taxonomy_id = $term_taxonomy.term_taxonomy_id)"; 
    51                 $from .= " INNER JOIN $terms_tb ON $term_taxonomy.term_id = $terms_tb.term_id)"; 
    52                 $from .= " INNER JOIN $user_tb ON $post_tb.post_author = $user_tb.ID"; 
     51                $from .= " INNER JOIN $terms_tb ON $term_taxonomy.term_id = $terms_tb.term_id "; 
    5352                 
    54                 $where = " WHERE ($post_tb.post_type = 'post') AND ($post_tb.post_status = 'publish')"; 
    55                 if (!empty($selected_author_id)){ 
    56                         $where  .= " AND $post_tb.post_author = $selected_author_id "; 
    57                 } 
     53                $where = " WHERE $post_tb.post_type = 'post' AND $post_tb.post_status = 'publish'"; 
     54//              if (!empty($selected_author_id)){ 
     55//                      $where  .= " AND ($post_tb.post_author = $selected_author_id) "; 
     56//                      $where  .= " AND ($post_tb.post_author = 2) "; 
     57//              } 
    5858 
    5959                if ($cat_select) { 
     
    6767                } 
    6868                 
    69         } else { 
    70                 $from  = " FROM (("; 
    71                 $from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)"; 
    72                 $from .= " LEFT JOIN $post2cat_tb ON $post_tb.ID = $post2cat_tb.post_id)"; 
    73                 $from .= " INNER JOIN $user_tb ON $post_tb.post_author = $user_tb.ID"; 
    74                  
    75                 $where = " WHERE ($post_tb.post_status = 'publish') AND  (UNIX_TIMESTAMP($post_tb.post_date) <= UNIX_TIMESTAMP())" ; 
    76                  
    77                 if ($cat_select) { 
    78                         $where .= " AND ($post2cat_tb.category_id IN ($cat_id))"; 
    79                 } 
    80                 if (!empty($selected_author_id)){ 
    81                         $where  .= " AND $post_tb.post_author = $selected_author_id "; 
    82                 } 
    83  
    84         } 
     69 
    8570        if ($show_month_range > 0) { 
    8671                        $where .= " AND (UNIX_TIMESTAMP($post_tb.post_date) >= UNIX_TIMESTAMP(DATE_ADD(CURRENT_DATE, INTERVAL -$show_month_range month)))"; 
    8772        } 
    8873        $order_limmit = " GROUP BY $post_tb.ID ORDER BY $view_tb.post_views DESC LIMIT 0, $disp_count"; 
    89          
    90         $populars = $wpdb->get_results($select . $from . $where . $order_limmit); 
     74        $sql = $select . $from . $where . $order_limmit; 
     75 
     76        $populars = $wpdb->get_results($sql); 
    9177         
    9278        foreach ($populars as $popular){ 
     
    156142                        $post_modified_date_time = $post_modified_date . ' ' . $post_modified_time ; 
    157143                        $trackback_url = trackback_url(false); 
    158                         $post_viwes = xpress_post_views_count($post_id,'views: %d' ,false); 
     144                        $post_viwes = xpress_post_views_count($post_id,__('views: %d','xpress') ,false); 
    159145//                      if (empty($tags)) $tags = __('Not Tag'); 
    160146 
  • trunk/wp-content/themes/xpress_default/ja.po

    r150 r158  
    1818"Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n" 
    1919"POT-Creation-Date: 2008-08-15 21:16+0900\n" 
    20 "PO-Revision-Date: 2009-04-02 18:19+0900\n" 
     20"PO-Revision-Date: 2009-04-06 00:50+0900\n" 
    2121"Last-Translator: toemon <toychee@toemon.com>\n" 
    2222"Language-Team: toemon <info@toemon.com>\n" 
     
    631631msgstr "テーマ選択" 
    632632 
    633 #: blocks/popular_posts_block_theme.php:114 
    634 #: blocks/recent_posts_content_block_theme.php:62 
    635 #: blocks/recent_posts_list_block_theme.php:60 
     633#: blocks/popular_posts_block_theme.php:125 
     634#: blocks/recent_posts_content_block_theme.php:68 
     635#: blocks/recent_posts_list_block_theme.php:67 
    636636msgid "Tags:" 
    637637msgstr "タグ:" 
    638638 
    639 #: blocks/popular_posts_block_theme.php:140 
    640 #: blocks/recent_posts_content_block_theme.php:97 
    641 #: blocks/recent_posts_list_block_theme.php:86 
     639#: blocks/popular_posts_block_theme.php:151 
     640#: blocks/recent_posts_content_block_theme.php:103 
     641#: blocks/recent_posts_list_block_theme.php:93 
    642642msgid "Comments (0)" 
    643643msgstr "コメントはありません" 
    644644 
    645 #: blocks/popular_posts_block_theme.php:140 
    646 #: blocks/recent_posts_content_block_theme.php:97 
    647 #: blocks/recent_posts_list_block_theme.php:86 
     645#: blocks/popular_posts_block_theme.php:151 
     646#: blocks/recent_posts_content_block_theme.php:103 
     647#: blocks/recent_posts_list_block_theme.php:93 
    648648msgid "Comments (1)" 
    649649msgstr "1件のコメント" 
    650650 
    651 #: blocks/popular_posts_block_theme.php:140 
    652 #: blocks/recent_posts_content_block_theme.php:97 
    653 #: blocks/recent_posts_list_block_theme.php:86 
     651#: blocks/popular_posts_block_theme.php:151 
     652#: blocks/recent_posts_content_block_theme.php:103 
     653#: blocks/recent_posts_list_block_theme.php:93 
    654654msgid "Comments (%)" 
    655655msgstr "Comments (%)" 
     656 
     657#: blocks/popular_posts_block_theme.php:160 
     658#, php-format 
     659msgid "views: %d" 
     660msgstr "閲覧 :%d回" 
    656661 
    657662#: blocks/recent_comments_block_theme.php:73 
     
    660665msgstr "%1$s と %2$s" 
    661666 
    662 #: blocks/recent_posts_content_block_theme.php:72 
     667#: blocks/recent_posts_content_block_theme.php:78 
    663668msgid "more" 
    664669msgstr "続きを読む" 
Note: See TracChangeset for help on using the changeset viewer.