XPressME Integration Kit

Trac

Changeset 616


Ignore:
Timestamp:
Jun 8, 2010, 9:37:06 AM (14 years ago)
Author:
toemon
Message:

D3Forumコメント統合一括インポート・エクスポート時の時間ずれバグ修正 Fixes#350 (thx bichico)

Location:
trunk/xpressme_integration_kit
Files:
2 edited

Legend:

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

    r614 r616  
    4545                { 
    4646                        global $xoops_config; 
     47                        if ( function_exists('date_default_timezone_set') ) 
     48                                date_default_timezone_set($xoops_config->xoops_time_zone); 
    4749                        $new_params = $this->restructParams( $params ) ; 
    4850                        if (!$this->canAddComment($params['id']) ) { 
     
    5759                                echo $d3comment; 
    5860                        } else { 
    59                                 if ( function_exists('date_default_timezone_set') ) 
    60                                 date_default_timezone_set($xoops_config->xoops_time_zone); 
    6161                                d3forum_render_comments( $this->d3forum_dirname , $new_params['forum_id'] , $new_params , $this->smarty ) ; 
    62                                 if ( function_exists('date_default_timezone_set') ) 
    63                                         date_default_timezone_set('UTC'); 
    64                         } 
     62                        } 
     63                        if ( function_exists('date_default_timezone_set') ) 
     64                                date_default_timezone_set('UTC'); 
    6565                } 
    6666 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php

    r597 r616  
    459459        } 
    460460        $comment_author_IP = "'" . $d3f_row->poster_ip . "'"; 
    461         $comment_date = "'" . date('Y-m-d H:i:s' , $d3f_row->post_time) . "'"; 
     461        $gmt_offset = get_option('gmt_offset'); 
     462        $local_timestamp = $d3f_row->post_time + ($gmt_offset * 3600); 
     463        $comment_date = "'" . date('Y-m-d H:i:s' , $local_timestamp) . "'"; 
    462464        $comment_content = "'" . addSlashes($d3f_row->post_text) . "'"; 
    463465        $comment_approved = "'" . $d3f_row->approval . "'"; 
     
    543545 
    544546        $sql  = "SELECT $wp_comments.comment_ID,$wp_comments.comment_post_ID, "; 
    545         $sql .=         "$wp_comments.comment_author, $wp_comments.comment_author_email,  $wp_comments.comment_date, "; 
     547        $sql .=         "$wp_comments.comment_author, $wp_comments.comment_author_email,  $wp_comments.comment_date, $wp_comments.comment_date_gmt, "; 
    546548        $sql .=         "$wp_comments.comment_author_url, $wp_comments.comment_author_IP, "; 
    547549        $sql .=         "$wp_comments.comment_content, $wp_comments.comment_karma, "; 
     
    561563        $topic_external_link_id = $row->comment_post_ID; //There is information on WP post_ID in topic_external_link_id of D3Forum 
    562564        $topic_title = 'Re.' . addSlashes($row->post_title); 
    563         $post_time = strtotime($row->comment_date);             // or   $row2['comment_date_gmt'] 
    564         $modified_time = strtotime($row->comment_date); // or   $row2['comment_date_gmt'] 
     565        $post_time = strtotime($row->comment_date_gmt);  
     566        $modified_time = strtotime($row->comment_date_gmt); 
    565567        require_once (get_xpress_dir_path() . 'include/general_functions.php'); 
    566568        if (empty($row->user_id)){ 
Note: See TracChangeset for help on using the changeset viewer.