XPressME Integration Kit

Trac

Changeset 108 for trunk/wp-content


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

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

Location:
trunk/wp-content/plugins/xpressme
Files:
5 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': 
  • trunk/wp-content/plugins/xpressme/language/xpressme-ja.po

    r99 r108  
    33"Project-Id-Version: XPressME Plugin\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2009-03-07 16:29+0900\n" 
     5"PO-Revision-Date: 2009-03-15 18:39+0900\n" 
    66"Last-Translator: toemon <toychee@toemon.com>\n" 
    77"Language-Team: \n" 
     
    1515"X-Poedit-SearchPath-0: .\n" 
    1616 
    17 #: xpressme_class.php:30 
     17#: xpressme_class.php:33 
    1818msgid "XPressME Settings" 
    1919msgstr "XPressME設定" 
    2020 
    21 #: xpressme_class.php:47 
    22 #: xpressme_class.php:141 
     21#: xpressme_class.php:50 
     22#: xpressme_class.php:152 
    2323msgid "to Old Post" 
    2424msgstr "前の投稿へ" 
    2525 
    26 #: xpressme_class.php:48 
    27 #: xpressme_class.php:143 
     26#: xpressme_class.php:51 
     27#: xpressme_class.php:154 
    2828msgid "to Newer Post" 
    2929msgstr "次の投稿へ" 
    3030 
    31 #: xpressme_class.php:170 
    32 #: xpressme_class.php:337 
    33 #: xpressme_class.php:342 
    34 #: xpressme_class.php:363 
    35 #: xpressme_class.php:368 
     31#: xpressme_class.php:195 
     32#: xpressme_class.php:390 
     33#: xpressme_class.php:395 
     34#: xpressme_class.php:416 
     35#: xpressme_class.php:421 
    3636msgid "YES" 
    3737msgstr "はい" 
    3838 
    39 #: xpressme_class.php:171 
    40 #: xpressme_class.php:338 
    41 #: xpressme_class.php:343 
    42 #: xpressme_class.php:364 
    43 #: xpressme_class.php:369 
     39#: xpressme_class.php:196 
     40#: xpressme_class.php:391 
     41#: xpressme_class.php:396 
     42#: xpressme_class.php:417 
     43#: xpressme_class.php:422 
    4444msgid "NO" 
    4545msgstr "いいえ" 
    4646 
    47 #: xpressme_class.php:211 
     47#: xpressme_class.php:236 
    4848msgid "Role Setting at Login" 
    4949msgstr "ログイン時の権限設定" 
    5050 
    51 #: xpressme_class.php:214 
     51#: xpressme_class.php:239 
    5252msgid "XOOPS Groupe" 
    5353msgstr "XOOPSグループ名" 
    5454 
    55 #: xpressme_class.php:214 
     55#: xpressme_class.php:239 
    5656msgid "WordPress Role" 
    5757msgstr "WordPressでの権限" 
    5858 
    59 #: xpressme_class.php:214 
     59#: xpressme_class.php:239 
    6060msgid "Role is set at each login" 
    6161msgstr "ログイン時、常に権限を更新する" 
    6262 
    63 #: xpressme_class.php:235 
    64 #: xpressme_class.php:239 
    65 #: xpressme_class.php:242 
     63#: xpressme_class.php:260 
     64#: xpressme_class.php:264 
     65#: xpressme_class.php:267 
    6666msgid "Default Role of WordPress" 
    6767msgstr "WordPressのデフォルト権限" 
    6868 
    69 #: xpressme_class.php:236 
    70 #: xpressme_class.php:240 
    71 #: xpressme_class.php:243 
     69#: xpressme_class.php:261 
     70#: xpressme_class.php:265 
     71#: xpressme_class.php:268 
    7272msgid "Group User Doesn't Register" 
    7373msgstr "ユーザ登録しない" 
    7474 
    75 #: xpressme_class.php:266 
     75#: xpressme_class.php:296 
    7676msgid "Do Not Comment Integration." 
    7777msgstr "コメント統合しません。" 
    7878 
    79 #: xpressme_class.php:302 
     79#: xpressme_class.php:330 
    8080msgid "Comment integration with D3Forum" 
    8181msgstr "D3Forumとのコメント統合" 
    8282 
    83 #: xpressme_class.php:304 
     83#: xpressme_class.php:332 
    8484msgid "Select the forum of D3Forum that does the comment integration from the following lists." 
    8585msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。" 
    8686 
    87 #: xpressme_class.php:327 
     87#: xpressme_class.php:335 
     88msgid "Select the Type of display of D3Forum comment." 
     89msgstr "D3Forumの表示タイプを選択" 
     90 
     91#: xpressme_class.php:337 
     92#: xpressme_class.php:340 
     93msgid "Flat" 
     94msgstr "フラット" 
     95 
     96#: xpressme_class.php:338 
     97#: xpressme_class.php:341 
     98msgid "Threaded" 
     99msgstr "スレッド" 
     100 
     101#: xpressme_class.php:344 
     102msgid "Select the order of display of D3Forum comment." 
     103msgstr "D3Forumコメントの表示順を選択" 
     104 
     105#: xpressme_class.php:346 
     106#: xpressme_class.php:349 
     107msgid "DESC" 
     108msgstr "降順" 
     109 
     110#: xpressme_class.php:347 
     111#: xpressme_class.php:350 
     112msgid "ASC" 
     113msgstr "昇順" 
     114 
     115#: xpressme_class.php:353 
     116msgid "Number of displays of D3Forum comments." 
     117msgstr "D3Forumのコメント表示数" 
     118 
     119#: xpressme_class.php:357 
     120msgid "The import and the export between Wordpress Comments and the D3Forum Posts can be done. " 
     121msgstr "WordPressコメントとD3Forumポスト間の一括転送(エクスポート・インポート)" 
     122 
     123#: xpressme_class.php:358 
     124msgid "Export to D3Forum" 
     125msgstr "D3Forumへ一括エクスポート" 
     126 
     127#: xpressme_class.php:359 
     128msgid "Import from D3Forum" 
     129msgstr "D3Forumから一括インポート" 
     130 
     131#: xpressme_class.php:380 
    88132msgid "XPressME Configuration Page" 
    89133msgstr "XPressMEの設定ページ" 
    90134 
    91 #: xpressme_class.php:331 
     135#: xpressme_class.php:384 
    92136msgid "Media Upload Base Path" 
    93137msgstr "メディアアップロードのベースパス設定" 
    94138 
    95 #: xpressme_class.php:332 
     139#: xpressme_class.php:385 
    96140msgid "Use XOOPS UPLOAD PATH" 
    97141msgstr "XOOPSのアップロードパスを使用する。" 
    98142 
    99 #: xpressme_class.php:333 
     143#: xpressme_class.php:386 
    100144msgid "USE WordPress BASE_PATH" 
    101145msgstr "WordPressのベースパスを使用する。" 
    102146 
    103 #: xpressme_class.php:336 
     147#: xpressme_class.php:389 
    104148msgid "Thema Sidebar Display" 
    105149msgstr "テーマ表示時にサイドバー表示する。" 
    106150 
    107 #: xpressme_class.php:341 
     151#: xpressme_class.php:394 
    108152msgid "The change tracking of the post is preserved" 
    109153msgstr "投稿の変更履歴を有効にする。" 
    110154 
    111 #: xpressme_class.php:346 
     155#: xpressme_class.php:399 
    112156msgid "Display Navi Title of Old Post Link" 
    113157msgstr "古い記事へのナビタイトルを設定" 
    114158 
    115 #: xpressme_class.php:349 
     159#: xpressme_class.php:402 
    116160msgid "Display Navi Title of Newer Post Link" 
    117161msgstr "新しい記事へのナビタイトルを設定" 
    118162 
    119 #: xpressme_class.php:352 
     163#: xpressme_class.php:405 
    120164msgid "Select Display name of PostNavi Link" 
    121165msgstr "投稿記事リンクナビのタイトル設定" 
    122166 
    123 #: xpressme_class.php:353 
     167#: xpressme_class.php:406 
    124168msgid "Title of post" 
    125169msgstr "投稿記事のタイトルを表示" 
    126170 
    127 #: xpressme_class.php:354 
     171#: xpressme_class.php:407 
    128172msgid "Title of Navi" 
    129173msgstr "ナビタイトルを表示" 
    130174 
    131 #: xpressme_class.php:357 
     175#: xpressme_class.php:410 
    132176msgid "Adjustment of Navi link display position" 
    133177msgstr "投稿記事ナビリンクの表示位置設定" 
    134178 
    135 #: xpressme_class.php:358 
     179#: xpressme_class.php:411 
    136180msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right" 
    137181msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示" 
    138182 
    139 #: xpressme_class.php:359 
     183#: xpressme_class.php:412 
    140184msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right" 
    141185msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示" 
    142186 
    143 #: xpressme_class.php:362 
     187#: xpressme_class.php:415 
    144188msgid "Is the posts author views counted?" 
    145189msgstr "投稿者の閲覧をカウントしますか?" 
    146190 
    147 #: xpressme_class.php:367 
     191#: xpressme_class.php:420 
    148192msgid "Is SQL debugging window displayed?" 
    149193msgstr "SQLデバッグウィンドを表示しますか?" 
    150194 
    151 #: xpressme_class.php:379 
     195#: xpressme_class.php:432 
    152196msgid "Update Config" 
    153197msgstr "更新" 
    154198 
    155 #: xpressme_class.php:380 
     199#: xpressme_class.php:433 
    156200msgid "Preset Config" 
    157201msgstr "プリセット" 
  • trunk/wp-content/plugins/xpressme/xpressme_class.php

    r104 r108  
    5656                $this->d3forum_forum_id = ''; 
    5757                $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
     58                $this->is_d3forum_flat = true; 
     59                $this->is_d3forum_desc = true; 
     60                $this->d3forum_views_num = 10; 
    5861        } 
    5962         
     
    9093                        'd3forum_module_dir' => $this->d3forum_module_dir, 
    9194                        'd3forum_forum_id' => $this->d3forum_forum_id, 
    92                         'd3forum_external_link_format' => $this->d3forum_external_link_format 
     95                        'd3forum_external_link_format' => $this->d3forum_external_link_format, 
     96                        'is_d3forum_flat' => $this->is_d3forum_flat, 
     97                        'is_d3forum_desc' => $this->is_d3forum_desc, 
     98                        'd3forum_views_num' =>$this->d3forum_views_num 
    9399                ); 
    94100                if ($mode == 'add_new') { 
     
    169175                        $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
    170176                } 
     177                $this->is_d3forum_flat = stripslashes(trim($_POST['ch_d3forum_type'])); 
     178                $this->is_d3forum_desc = stripslashes(trim($_POST['ch_d3forum_order'])); 
     179                $this->d3forum_views_num = stripslashes(trim($_POST['ch_d3forum_view_num'])); 
    171180                 
    172181                global $xoops_db; 
     
    282291        } 
    283292         
    284         function d3forum_option(){ 
     293        function d3forum_option($do_message = ''){ 
    285294                global $xoops_db; 
    286295                 
     
    306315                        // It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file. 
    307316                        foreach ($array_files as $aeey_file){ 
    308                                 if( preg_match( "/\s*($mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) { 
     317                                if( preg_match( "/\s*(mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) { 
    309318                                        $forums_tb = get_xoops_prefix() . $module->dirname . '_forums'; 
    310319                                        $cat_tb = get_xoops_prefix() . $module->dirname . '_categories'; 
     
    323332                                } 
    324333                        } 
    325                         $form .= '<br>';                         
     334                        $forum_list .= '<br>';                   
    326335                } 
    327336                $forum_list .= '</select>' . "\n"; 
     
    332341                $form .=  __('Select the forum of D3Forum that does the comment integration from the following lists.', 'xpressme') ."<br />\n"; 
    333342                $form .=  $forum_list."\n"; 
    334                 $form .= '<br /><br /><br /><br /><br /><br /><br />'; 
     343                $form .= '<br /><br />'; 
     344                if ($this->is_use_d3forum)  $disible = ''; else $disible = 'disabled'; 
     345                $form .=  __('Select the Type of display of D3Forum comment.', 'xpressme') . " \n&emsp"; 
     346                if ($this->is_d3forum_flat){ 
     347                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_type' value='1' checked='checked' />" . __('Flat','xpressme') ."</label>\n"; 
     348                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_type' value='0' />". __('Threaded','xpressme') . "</label>\n"; 
     349                }else{ 
     350                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_type' value='1' />" . __('Flat','xpressme') . "</label>\n"; 
     351                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_type' value='0' checked='checked' />". __('Threaded','xpressme') ."</label>\n"; 
     352                } 
     353                $form .= '<br />'; 
     354                $form .=  __('Select the order of display of D3Forum comment.', 'xpressme') . " \n&emsp"; 
     355                if ($this->is_d3forum_desc){ 
     356                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_order' value='1' checked='checked' />" . __('DESC','xpressme') ."</label>\n"; 
     357                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_order' value='0' />". __('ASC','xpressme') . "</label>\n"; 
     358                }else{ 
     359                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_order' value='1' />" . __('DESC','xpressme') . "</label>\n"; 
     360                        $form .= "&ensp<label><input type='radio' name='ch_d3forum_order' value='0' checked='checked' />". __('ASC','xpressme') ."</label>\n"; 
     361                } 
     362                $form .= '<br />'; 
     363                $form .=  __('Number of displays of D3Forum comments.', 'xpressme') ." \n"; 
     364                $form .= '&emsp<label> <input name="ch_d3forum_view_num" type="text" size="3" maxlength="3" value="'  . $this->d3forum_views_num . '" /></label>'."\n"; 
     365 
     366                $form .= '<div class="submit">'."\n";            
     367                $form .=  __('The import and the export between Wordpress Comments and the D3Forum Posts can be done. ', 'xpressme') ."<br />\n"; 
     368                $form .= '<input type="submit" value= "' . __('Export to D3Forum', 'xpressme') . '" name="export_d3f" ' . $disible . ' >' ."\n"; 
     369                $form .= '<input type="submit" value= "' . __('Import from D3Forum', 'xpressme') . '" name="inport_d3f" ' . $disible . ' >' ."<br />\n"; 
     370                $form .= '</div>'."\n"; 
     371                if (!empty($do_message)){ 
     372                        $form .= '<div>' . $do_message . '</div>'; 
     373                } 
    335374                $form .=  "</td>\n"; 
    336375                $form .=  "</tr><tr>\n"; 
     
    340379        function option_page() 
    341380        { 
    342  
     381                $do_message =''; 
    343382                if (!empty($_POST['submit_update'])) { 
    344383                        $this->ReadPostData(); 
     
    347386                        $this->fck_setDefault(); 
    348387                        $this->SettingValueWrite('update'); 
    349                 }  
    350  
     388                } else if (isset($_POST['export_d3f'])) { 
     389                        $do_message  = 'export(' . $this->d3forum_module_dir . '--ID=' . $this->d3forum_forum_id . ')................'; 
     390                        $do_message .= wp_to_d3forum($this->d3forum_forum_id, $this->d3forum_module_dir); 
     391                        $do_message .= '....END'; 
     392                } else if (isset($_POST['inport_d3f'])) { 
     393                        $do_message  = 'Import(' . $this->d3forum_module_dir . '--ID=' . $this->d3forum_forum_id . ')................'; 
     394                        $do_message .= d3forum_to_wp($this->d3forum_forum_id, $this->d3forum_module_dir); 
     395                        $do_message .= '....END'; 
     396                }                
    351397                 
    352398                echo    '<div class="wrap">'."\n"; 
     
    399445                echo                            $this->groupe_role_option();             
    400446                 
    401                 echo                            $this->d3forum_option();                 
     447                echo                            $this->d3forum_option($do_message);              
    402448//              $this->is_use_xoops_upload_path_html(); 
    403449                echo                    "</table>\n"; 
Note: See TracChangeset for help on using the changeset viewer.