XPressME Integration Kit

Trac


Ignore:
Timestamp:
Mar 15, 2009, 10:29:28 PM (16 years ago)
Author:
toemon
Message:

D3Forum コメント統合実装 (インポート・エクスポート)
D3Forumコメント統合時のオプション追加(表示順・表示タイプ・表示数)
これで #5 のチケットは完了

Location:
trunk/wp-content/plugins/xpressme/include
Files:
2 edited

Legend:

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

    r104 r108  
    1313                $forum_id = $XPressME->d3forum_forum_id; 
    1414                $external_link_format = $XPressME->d3forum_external_link_format; 
    15                 $db =& Database::getInstance() ; 
     15                if ($XPressME->is_d3forum_desc){ 
     16                        $order = 'desc'; 
     17                } else { 
     18                        $order = 'asc'; 
     19                } 
     20                if ($XPressME->is_d3forum_desc){ 
     21                        $order = 'desc'; 
     22                } else { 
     23                        $order = 'asc'; 
     24                } 
    1625 
     26                if ($XPressME->is_d3forum_flat){ 
     27                        $view = 'listposts_flat'; 
     28                } else { 
     29                        $view = 'listtopics'; 
     30                } 
     31                $posts_num = $XPressME->d3forum_views_num; 
     32                 
    1733        // force UPDATE forums.forum_external_link_format "(dirname)::(classname)::(trustdirname)" 
    1834                $xoops_db->query( "UPDATE ".get_xoops_prefix() . $dir_name."_forums SET forum_external_link_format='".$external_link_format."' WHERE forum_id= $forum_id" ) ; 
     
    3349        }        
    3450//              $params = array("dirname" => $dir_name, "forum_id" => $forum_id, "itemname" => "p", "id" => $post_id , "subject" => $post_title); 
    35                 $params = array("forum_id" => $forum_id,  "id" => $post_id , "subject" => $post_title); 
     51                $params = array("forum_id" => $forum_id,  "id" => $post_id , "subject" => $post_title , "order" => $order , "view" => $view , "posts_num" => $posts_num); 
    3652                if(file_exists($xoops_trust_path .'/modules/d3forum/')) { 
    3753                        if(file_exists($xoops_root_path .'/modules/' . $dir_name . '/')) { 
  • trunk/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php

    r106 r108  
    179179 
    180180// All comments of WordPress are exported to the D3Forum comment.  
    181 function wp_to_d3forum($forum_id = 1, $d3f_prefix = 'd3forum' ,$wp_prefix = 'wp'){ 
     181function wp_to_d3forum($forum_id = 1, $d3f_prefix = 'd3forum'){ 
    182182        global $XPressME,$xoops_db; 
    183183 
     
    185185         
    186186        $d3forum_prefix = get_xoops_prefix() . $d3f_prefix . '_'; 
    187         $xpress_prefix = get_xoops_prefix() . $wp_prefix . '_'; 
     187        $xpress_prefix = get_wp_prefix(); 
    188188         
    189189        $wp_comments = $xpress_prefix . 'comments'; 
     
    239239 
    240240        $comment_count = 0; 
    241         $comments = $xoops_db->get_results($post_sql); 
     241        $comments = $xoops_db->get_results($sql); 
    242242        foreach($comments as $comment){ 
    243243                $comment_ID = $comment->comment_ID; 
     
    253253 
    254254// All comments of D3Forum are import to the WordPress comment.  
    255 function d3forum_to_wp($forum_id = 1, $d3f_prefix = 'd3forum' ,$wp_prefix = 'wordpress'){ 
     255function d3forum_to_wp($forum_id = 1, $d3f_prefix = 'd3forum'){ 
    256256        global $XPressME,$xoops_db; 
    257257        if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); 
    258258         
    259259        $d3forum_prefix = get_xoops_prefix() . $d3f_prefix . '_'; 
    260         $xpress_prefix = get_xoops_prefix() . $wp_prefix . '_'; 
     260        $xpress_prefix = get_wp_prefix() ; 
    261261         
    262262        $wp_comments = $xpress_prefix . 'comments'; 
     
    297297 
    298298        $d3f_res = $xoops_db->get_results($d3f_sql); 
    299         if (empty($d3f_res )) die( '...Err. OPEN D3Forum Data (' .  $d3f_sql . ')'); 
    300299        $import_count = 0; 
    301300        foreach($d3f_res as $d3f_row){ 
     
    429428                                $wp_sql .=    "($comment_ID, $post_id)";                 
    430429                                $xoops_db->query($wp_sql);                               
    431                                 if ($comment_approved ==0)      do_CommentWaiting($commentID, $post_id); 
     430                                if ($comment_approved ==0)      do_CommentWaiting($comment_ID, $post_id); 
    432431                                break; 
    433432                        case 'edit': 
Note: See TracChangeset for help on using the changeset viewer.