XPressME Integration Kit

Trac

Changeset 360


Ignore:
Timestamp:
Aug 11, 2009, 4:31:35 PM (15 years ago)
Author:
toemon
Message:

WP2.1.3MEへの対応 fixed #199
但しWP2.1.3ME自体のバグ(MySQL4.1以上でEUC-JPを使用したときの文字化け)があるので注意

Location:
trunk/xpressme_integration_kit
Files:
1 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/class/config_from_xoops.class.php

    r357 r360  
    4141        var $mu_path_current_site; 
    4242        var $wp_db_version; 
    43         var $is_wp20; 
     43        var $wp_version; 
     44        var $is_wp_me; 
    4445         
    4546        function __constructor()        //for PHP5 
     
    291292         
    292293        $this->wp_db_version = $wp_db_version; 
    293         if ($wp_db_version == 3441) 
    294                         $this->is_wp20 = true; 
    295                 else 
    296                         $this->is_wp20 = false; 
    297                  
     294                 
     295                $this->wp_version = str_replace("ME", "", $wp_version); 
     296                 
     297                $pattern = 'ME.*'; 
     298        if (preg_match('/' . $pattern . '/' ,$wp_version)){ 
     299                        $this->is_wp_me = true; 
     300                } else { 
     301                        $this->is_wp_me = true; 
     302                } 
    298303    } 
    299304     
  • trunk/xpressme_integration_kit/include/add_xpress_process.php

    r358 r360  
    22require_once( dirname( __FILE__ ).'/request_url.php'); 
    33if (is_xpress_index_page_call()){ 
    4         //When notifying by a private message,  
     4        //When notifying by a private message, Notification_reserve_send(); 
    55        //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method.  
    66        $_SERVER['REQUEST_METHOD'] = 'POST'; 
     
    2727        Notification_reserve_send(); 
    2828        ob_start();      
    29                 if($xoops_config->is_wp20 ) 
     29                if (version_compare($xoops_config->wp_version,'2.2', '<')) 
    3030                        require_once dirname( __FILE__ ).'/old_template-loader.php' ; 
    3131                else 
     
    4949        exit();         // The return to wp-blog-header.php is stolen here 
    5050} 
    51 if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path; 
    52 if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path; 
     51if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path;              // for Notification_triggerEvent 
     52if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path;    // for Notification_triggerEvent 
    5353?> 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php

    r350 r360  
    1616} 
    1717 
    18 function xpress_is_wp20() { 
     18function xpress_is_wp_version($operator='==',$comp_version){ 
    1919        global $xoops_config; 
    20          
    21         return $xoops_config->is_wp20; 
     20        return version_compare($xoops_config->wp_version, $comp_version, $operator); 
    2221} 
    2322 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php

    r286 r360  
    250250                        } 
    251251                } else { 
    252                         if(xpress_is_wp20()){ 
     252                        if(xpress_is_wp_version('<','2.1')){  // Maybe, I think that it is ver2.1 or less. 
    253253                                if (!empty($wp->matched_query) ){ 
    254254                                        if (strpos($wp->matched_query,'author_name') !== false ){ 
     
    303303        $query = preg_replace('/\s\s+/', ' ', $query); 
    304304        if (!empty($_COOKIE[$author_cookie])){ 
    305                 if(xpress_is_wp20()){ 
     305                if(xpress_is_wp_version('<','2.1')){ 
    306306                        $pattern = "WHERE.*AND\s?\(*post_author\s*="; 
    307307                        if ( preg_match ( "/".$pattern."/i", $query, $match ) ){ 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php

    r349 r360  
    2020 
    2121require_once dirname( __FILE__ ).'/include/pluggable-override.php' ; 
    22 if ($xoops_config->is_wp20) 
    23         require_once dirname( __FILE__ ).'/include/functions_for_wp20.php' ; 
     22require_once dirname( __FILE__ ).'/include/functions_for_wp_old.php' ; 
    2423 
    2524function my_plugin_menu() 
     
    9897add_filter('query','xpress_query_filter'); 
    9998//add_action("init", "xpress_set_author_cookie"); 
    100 if(xpress_is_wp20()){ 
     99if(xpress_is_wp_version('<','2.1')){ 
    101100        // It is called before parse_request() makes $GET.  
    102101        add_action("query_vars", "xpress_set_author_cookie"); 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/authors_block_theme.php

    r292 r360  
    1010        $mydirpath = get_xpress_dir_path(); 
    1111         
    12         if(xpress_is_wp20() ){ 
     12        if(xpress_is_wp_version('<','2.3') ){ 
    1313                $param_str = 'optioncount='. $optioncount . '&exclude_admin=' . $exclude_admin .'&show_fullname='. $show_fullname . '&hide_empty=' . $hide_empty; 
    1414                ob_start(); 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php

    r270 r360  
    3535                if ($post_new){ 
    3636                        if($Now_user_level > 0){ 
    37                                 if (xpress_is_wp20()){ 
     37                                if (xpress_is_wp_version('<','2.1') ){ 
    3838                                        $output .= 
    3939                                        '<li>'. 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php

    r262 r360  
    2222        if ($show_date == 'none' ) $show_date = ''; 
    2323         
    24         if (!xpress_is_wp20()){ 
     24        if (xpress_is_wp_version('>=','2.2')){ 
    2525                $parm = array( 
    2626                'sort_column'   => $sort_column,  
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php

    r269 r360  
    4646                $comment_sql  = "SELECT comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_content, comment_type,UNIX_TIMESTAMP(comment_date) as comment_unix_time "; 
    4747                $comment_sql .= "FROM $wpdb->comments LEFT JOIN $wpdb->posts ON  $wpdb->posts.ID = $wpdb->comments.comment_post_ID "; 
    48                 if (xpress_is_wp20()){ 
     48                if (xpress_is_wp_version('<','2.1')){ 
    4949                        $comment_sql .= "WHERE comment_approved = '1' AND post_status = 'publish' $type_select "; 
    5050                } else { 
     
    6060                                $comment_content = $comment->comment_content; 
    6161                                $comment_excerpt = ($disp_length>0 ? xpress_substr($comment_content, 0, $disp_length): $comment->comment_content); 
    62                                 if (xpress_is_wp20()){ 
    63                                         $comment_link = get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID ; 
    64                                 } else { 
    65                                         $comment_link = get_comment_link($comment->comment_ID); 
    66                                 } 
     62                                $comment_link = get_comment_link($comment->comment_ID); 
    6763                                $comment_title = $comment_excerpt; 
    6864                                $comment_title_link = "<a href='$comment_link' rel='external nofollow' class='url'>$comment_title</a>"; 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/comments.php

    r253 r360  
    1212 
    1313<!-- You can start editing here. --> 
    14 <?php if (! xpress_is_wp20() ) : ?> 
     14<?php if ( xpress_is_wp_version('>=','2.7')) : ?> 
    1515        <?php if ( have_comments() ) : ?> 
    1616                <?php if ( ! empty($comments_by_type['comment']) ) : ?> 
     
    3434                <?php endif; ?> 
    3535        <?php endif; ?> 
    36 <?php else : // is WordPress2.0 ?> 
     36<?php else : // is version 2.7 under?> 
    3737        <?php if ( $comments ) : ?> 
    3838                <h3 id="xpress_comments"><?php comments_number(__('No Responses', 'xpress'), __('One Response', 'xpress'), __('% Responses', 'xpress'));?> <?php printf(__('to &#8220;%s&#8221;', 'xpress'), the_title('', '', false)); ?></h3> 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/single.php

    r272 r360  
    6666                                        <div id ="xpress-comments-block"> 
    6767                                                <?php 
    68                                                         if (xpress_is_wp20() ) 
     68                                                        if ( xpress_is_wp_version('<','2.7') ) 
    6969                                                                comments_template(); 
    7070                                                        else 
Note: See TracChangeset for help on using the changeset viewer.