XPressME Integration Kit

Trac

Changeset 99


Ignore:
Timestamp:
Mar 7, 2009, 11:05:20 PM (15 years ago)
Author:
toemon
Message:

D3Forumのフォーラムリストボックスからコメント統合を選択するための設定画面を作成
設定値はXPressME_Classクラスの
is_use_d3forum;
d3forum_module_dir;
d3forum_forum_id;
d3forum_external_link_format;
プロパティーから取得できます。

Location:
trunk/wp-content/plugins/xpressme
Files:
4 edited

Legend:

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

    r96 r99  
    11<?php 
     2global $xoops_config; 
     3if (!is_object($xoops_config)){ // is call other modules 
     4        require_once dirname( __FILE__ ) .'/config_from_xoops.class.php' ; 
     5        $xoops_config = new ConfigFromXoops; 
     6} 
     7 
    28// xoops db 
    39function get_xpress_dir_path() 
     
    2733        return $ret; 
    2834} 
     35 
     36function get_xoops_root_path() 
     37{ 
     38        global $xoops_config; 
     39        $ret =$xoops_config->xoops_root_path; 
     40        return $ret; 
     41} 
     42 
    2943function get_wp_prefix() 
    3044{ 
     
    118132                $blockID = $block->bid; 
    119133                $options = explode("|", $block->options); 
    120                                          
     134 
    121135                $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
    122136                require_once $block_theme_file; 
  • trunk/wp-content/plugins/xpressme/language/xpressme-ja.po

    r88 r99  
    33"Project-Id-Version: XPressME Plugin\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2009-02-04 16:00+0900\n" 
     5"PO-Revision-Date: 2009-03-07 16:29+0900\n" 
    66"Last-Translator: toemon <toychee@toemon.com>\n" 
    77"Language-Team: \n" 
     
    1212"X-Poedit-Country: JAPAN\n" 
    1313"X-Poedit-KeywordsList: _e;__\n" 
    14 "X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2X\\wp-content\\plugins\\xpressme\n" 
     14"X-Poedit-Basepath: C:\\XPressME_Ver2_SVN\\trunk\\wp-content\\plugins\\xpressme\n" 
    1515"X-Poedit-SearchPath-0: .\n" 
    1616 
     
    3030 
    3131#: xpressme_class.php:170 
    32 #: xpressme_class.php:283 
    33 #: xpressme_class.php:288 
    34 #: xpressme_class.php:309 
    35 #: xpressme_class.php:314 
     32#: xpressme_class.php:337 
     33#: xpressme_class.php:342 
     34#: xpressme_class.php:363 
     35#: xpressme_class.php:368 
    3636msgid "YES" 
    3737msgstr "はい" 
    3838 
    3939#: xpressme_class.php:171 
    40 #: xpressme_class.php:284 
    41 #: xpressme_class.php:289 
    42 #: xpressme_class.php:310 
    43 #: xpressme_class.php:315 
     40#: xpressme_class.php:338 
     41#: xpressme_class.php:343 
     42#: xpressme_class.php:364 
     43#: xpressme_class.php:369 
    4444msgid "NO" 
    4545msgstr "いいえ" 
     
    7373msgstr "ユーザ登録しない" 
    7474 
    75 #: xpressme_class.php:273 
     75#: xpressme_class.php:266 
     76msgid "Do Not Comment Integration." 
     77msgstr "コメント統合しません。" 
     78 
     79#: xpressme_class.php:302 
     80msgid "Comment integration with D3Forum" 
     81msgstr "D3Forumとのコメント統合" 
     82 
     83#: xpressme_class.php:304 
     84msgid "Select the forum of D3Forum that does the comment integration from the following lists." 
     85msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。" 
     86 
     87#: xpressme_class.php:327 
    7688msgid "XPressME Configuration Page" 
    7789msgstr "XPressMEの設定ページ" 
    7890 
    79 #: xpressme_class.php:277 
     91#: xpressme_class.php:331 
    8092msgid "Media Upload Base Path" 
    8193msgstr "メディアアップロードのベースパス設定" 
    8294 
    83 #: xpressme_class.php:278 
     95#: xpressme_class.php:332 
    8496msgid "Use XOOPS UPLOAD PATH" 
    8597msgstr "XOOPSのアップロードパスを使用する。" 
    8698 
    87 #: xpressme_class.php:279 
     99#: xpressme_class.php:333 
    88100msgid "USE WordPress BASE_PATH" 
    89101msgstr "WordPressのベースパスを使用する。" 
    90102 
    91 #: xpressme_class.php:282 
     103#: xpressme_class.php:336 
    92104msgid "Thema Sidebar Display" 
    93105msgstr "テーマ表示時にサイドバー表示する。" 
    94106 
    95 #: xpressme_class.php:287 
     107#: xpressme_class.php:341 
    96108msgid "The change tracking of the post is preserved" 
    97109msgstr "投稿の変更履歴を有効にする。" 
    98110 
    99 #: xpressme_class.php:292 
     111#: xpressme_class.php:346 
    100112msgid "Display Navi Title of Old Post Link" 
    101113msgstr "古い記事へのナビタイトルを設定" 
    102114 
    103 #: xpressme_class.php:295 
     115#: xpressme_class.php:349 
    104116msgid "Display Navi Title of Newer Post Link" 
    105117msgstr "新しい記事へのナビタイトルを設定" 
    106118 
    107 #: xpressme_class.php:298 
     119#: xpressme_class.php:352 
    108120msgid "Select Display name of PostNavi Link" 
    109121msgstr "投稿記事リンクナビのタイトル設定" 
    110122 
    111 #: xpressme_class.php:299 
     123#: xpressme_class.php:353 
    112124msgid "Title of post" 
    113125msgstr "投稿記事のタイトルを表示" 
    114126 
    115 #: xpressme_class.php:300 
     127#: xpressme_class.php:354 
    116128msgid "Title of Navi" 
    117129msgstr "ナビタイトルを表示" 
    118130 
    119 #: xpressme_class.php:303 
     131#: xpressme_class.php:357 
    120132msgid "Adjustment of Navi link display position" 
    121133msgstr "投稿記事ナビリンクの表示位置設定" 
    122134 
    123 #: xpressme_class.php:304 
     135#: xpressme_class.php:358 
    124136msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right" 
    125137msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示" 
    126138 
    127 #: xpressme_class.php:305 
     139#: xpressme_class.php:359 
    128140msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right" 
    129141msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示" 
    130142 
    131 #: xpressme_class.php:308 
     143#: xpressme_class.php:362 
    132144msgid "Is the posts author views counted?" 
    133145msgstr "投稿者の閲覧をカウントしますか?" 
    134146 
    135 #: xpressme_class.php:313 
     147#: xpressme_class.php:367 
    136148msgid "Is SQL debugging window displayed?" 
    137149msgstr "SQLデバッグウィンドを表示しますか?" 
    138150 
    139 #: xpressme_class.php:323 
     151#: xpressme_class.php:379 
    140152msgid "Update Config" 
    141153msgstr "更新" 
    142154 
    143 #: xpressme_class.php:324 
     155#: xpressme_class.php:380 
    144156msgid "Preset Config" 
    145157msgstr "プリセット" 
    146158 
    147 #: include/custom_functions.php:244 
     159#: include/custom_functions.php:180 
    148160#, php-format 
    149161msgid "views :%d" 
  • trunk/wp-content/plugins/xpressme/xpressme_class.php

    r95 r99  
    1515        var $is_sql_debug; 
    1616        var $groupe_role; 
    17  
     17        var $is_use_d3forum; 
     18        var $d3forum_module_dir; 
     19        var $d3forum_forum_id; 
     20        var $d3forum_external_link_format; 
    1821        //constructor 
    1922        function XPressME_Class() 
     
    4952                $this->is_author_view_count = false; 
    5053                $this->is_sql_debug = false; 
     54                $this->is_use_d3forum = false; 
     55                $this->d3forum_module_dir = ''; 
     56                $this->d3forum_forum_id = ''; 
     57                $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
    5158        } 
    5259         
     
    7986                        'newer_post_link_text' => $this->newer_post_link_text, 
    8087                        'is_author_view_count' => $this->is_author_view_count, 
    81                         'is_sql_debug' => $this->is_sql_debug 
     88                        'is_sql_debug' => $this->is_sql_debug, 
     89                        'is_use_d3forum' =>     $this->is_use_d3forum, 
     90                        'd3forum_module_dir' => $this->d3forum_module_dir, 
     91                        'd3forum_forum_id' => $this->d3forum_forum_id, 
     92                        'd3forum_external_link_format' => $this->d3forum_external_link_format 
    8293                ); 
    8394                if ($mode == 'add_new') { 
     
    144155                $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); 
    145156                $this->is_sql_debug = stripslashes(trim($_POST['ch_is_sql_debug'])); 
     157                //d3forum 
     158                $d3forum_select = stripslashes(trim($_POST['ch_d3forum'])); 
     159                if ($d3forum_select == 'none') { 
     160                        $this->is_use_d3forum = false; 
     161                        $this->d3forum_module_dir = ''; 
     162                        $this->d3forum_forum_id = ''; 
     163                        $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
     164                } else { 
     165                        $d3f_set = explode('|', $d3forum_select); 
     166                        $this->is_use_d3forum = true; 
     167                        $this->d3forum_module_dir = $d3f_set[1]; 
     168                        $this->d3forum_forum_id = $d3f_set[2]; 
     169                        $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
     170                } 
    146171                 
    147172                global $xoops_db; 
     
    256281 
    257282        } 
    258                  
     283         
     284        function d3forum_option(){ 
     285                global $xoops_db; 
     286                 
     287                $d3frum_list = array(); 
     288                $module_dir_path = get_xoops_root_path(); 
     289                 
     290                $forum_list  = '<select name="ch_d3forum">' . "\n"; 
     291                 
     292                if ($this->is_use_d3forum != true) 
     293                        $selected = ' selected="selected"'; 
     294                else 
     295                        $selected = ''; 
     296                $forum_list .= '<option value="none"' . $selected . '>' . __('Do Not Comment Integration.', 'xpressme') . "</option>\n"; 
     297 
     298                // Form making for forum selection of D3forum 
     299                $modules_table = get_xoops_prefix() .'modules'; 
     300                $sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1"; 
     301                $modules = $xoops_db->get_results($sql); 
     302                foreach ($modules as $module) { 
     303                        $file_path = $module_dir_path . '/modules/' . $module->dirname . '/mytrustdirname.php';                  
     304                        if (! file_exists($file_path)) continue; 
     305                        $array_files = file($file_path); 
     306                        // It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file. 
     307                        foreach ($array_files as $aeey_file){ 
     308                                if( preg_match( "/\s*($mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) { 
     309                                        $forums_tb = get_xoops_prefix() . $module->dirname . '_forums'; 
     310                                        $cat_tb = get_xoops_prefix() . $module->dirname . '_categories'; 
     311                                        $sql= "SELECT * FROM $forums_tb LEFT JOIN $cat_tb ON $forums_tb.cat_id = $cat_tb.cat_id"; 
     312                                        $forums = $xoops_db->get_results($sql); 
     313                                        foreach ($forums as $forum) { 
     314                                                if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id)) 
     315                                                        $selected = ' selected="selected"'; 
     316                                                else 
     317                                                        $selected = ''; 
     318                                                $forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id; 
     319                                                $forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)"; 
     320                                                $forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n"; 
     321                                        } 
     322                                        break; 
     323                                } 
     324                        } 
     325                        $form .= '<br>';                         
     326                } 
     327                $forum_list .= '</select>' . "\n"; 
     328 
     329                $form  = '<tr>' . "\n"; 
     330                $form .= '<th><label for="d3forum">' .__('Comment integration with D3Forum', 'xpressme') . '</label></th>' . "\n"; 
     331                $form .=  "<td>\n"; 
     332                $form .=  __('Select the forum of D3Forum that does the comment integration from the following lists.', 'xpressme') ."<br />\n"; 
     333                $form .=  $forum_list."\n"; 
     334                $form .= '<br /><br /><br /><br /><br /><br /><br />'; 
     335                $form .=  "</td>\n"; 
     336                $form .=  "</tr><tr>\n"; 
     337                return $form; 
     338        } 
     339 
    259340        function option_page() 
    260341        { 
     
    316397                                                                                                ); 
    317398                 
    318                 echo                            $this->groupe_role_option();                             
     399                echo                            $this->groupe_role_option();             
     400                 
     401                echo                            $this->d3forum_option();                 
    319402//              $this->is_use_xoops_upload_path_html(); 
    320403                echo                    "</table>\n"; 
Note: See TracChangeset for help on using the changeset viewer.