XPressME Integration Kit

Trac

Changeset 88


Ignore:
Timestamp:
Feb 4, 2009, 5:58:57 PM (15 years ago)
Author:
toemon
Message:

SQLデバッグ用表示機能実装 #58

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

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/plugins/xpressme/language/xpressme-ja.po

    r81 r88  
    33"Project-Id-Version: XPressME Plugin\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2009-01-31 22:42+0900\n" 
     5"PO-Revision-Date: 2009-02-04 16:00+0900\n" 
    66"Last-Translator: toemon <toychee@toemon.com>\n" 
    77"Language-Team: \n" 
     
    2020 
    2121#: xpressme_class.php:47 
    22 #: xpressme_class.php:139 
     22#: xpressme_class.php:141 
    2323msgid "to Old Post" 
    2424msgstr "前の投稿へ" 
    2525 
    2626#: xpressme_class.php:48 
    27 #: xpressme_class.php:141 
     27#: xpressme_class.php:143 
    2828msgid "to Newer Post" 
    2929msgstr "次の投稿へ" 
    3030 
    31 #: xpressme_class.php:167 
    32 #: xpressme_class.php:280 
    33 #: xpressme_class.php:285 
    34 #: xpressme_class.php:306 
     31#: xpressme_class.php:170 
     32#: xpressme_class.php:283 
     33#: xpressme_class.php:288 
     34#: xpressme_class.php:309 
     35#: xpressme_class.php:314 
    3536msgid "YES" 
    3637msgstr "はい" 
    3738 
    38 #: xpressme_class.php:168 
    39 #: xpressme_class.php:281 
    40 #: xpressme_class.php:286 
    41 #: xpressme_class.php:307 
     39#: xpressme_class.php:171 
     40#: xpressme_class.php:284 
     41#: xpressme_class.php:289 
     42#: xpressme_class.php:310 
     43#: xpressme_class.php:315 
    4244msgid "NO" 
    4345msgstr "いいえ" 
    4446 
    45 #: xpressme_class.php:208 
     47#: xpressme_class.php:211 
    4648msgid "Role Setting at Login" 
    4749msgstr "ログイン時の権限設定" 
    4850 
    49 #: xpressme_class.php:211 
     51#: xpressme_class.php:214 
    5052msgid "XOOPS Groupe" 
    5153msgstr "XOOPSグループ名" 
    5254 
    53 #: xpressme_class.php:211 
     55#: xpressme_class.php:214 
    5456msgid "WordPress Role" 
    5557msgstr "WordPressでの権限" 
    5658 
    57 #: xpressme_class.php:211 
     59#: xpressme_class.php:214 
    5860msgid "Role is set at each login" 
    5961msgstr "ログイン時、常に権限を更新する" 
    6062 
    61 #: xpressme_class.php:232 
    62 #: xpressme_class.php:236 
     63#: xpressme_class.php:235 
    6364#: xpressme_class.php:239 
     65#: xpressme_class.php:242 
    6466msgid "Default Role of WordPress" 
    6567msgstr "WordPressのデフォルト権限" 
    6668 
    67 #: xpressme_class.php:233 
    68 #: xpressme_class.php:237 
     69#: xpressme_class.php:236 
    6970#: xpressme_class.php:240 
     71#: xpressme_class.php:243 
    7072msgid "Group User Doesn't Register" 
    7173msgstr "ユーザ登録しない" 
    7274 
    73 #: xpressme_class.php:270 
     75#: xpressme_class.php:273 
    7476msgid "XPressME Configuration Page" 
    7577msgstr "XPressMEの設定ページ" 
    7678 
    77 #: xpressme_class.php:274 
     79#: xpressme_class.php:277 
    7880msgid "Media Upload Base Path" 
    7981msgstr "メディアアップロードのベースパス設定" 
    8082 
    81 #: xpressme_class.php:275 
     83#: xpressme_class.php:278 
    8284msgid "Use XOOPS UPLOAD PATH" 
    8385msgstr "XOOPSのアップロードパスを使用する。" 
    8486 
    85 #: xpressme_class.php:276 
     87#: xpressme_class.php:279 
    8688msgid "USE WordPress BASE_PATH" 
    8789msgstr "WordPressのベースパスを使用する。" 
    8890 
    89 #: xpressme_class.php:279 
     91#: xpressme_class.php:282 
    9092msgid "Thema Sidebar Display" 
    9193msgstr "テーマ表示時にサイドバー表示する。" 
    9294 
    93 #: xpressme_class.php:284 
     95#: xpressme_class.php:287 
    9496msgid "The change tracking of the post is preserved" 
    9597msgstr "投稿の変更履歴を有効にする。" 
    9698 
    97 #: xpressme_class.php:289 
     99#: xpressme_class.php:292 
    98100msgid "Display Navi Title of Old Post Link" 
    99101msgstr "古い記事へのナビタイトルを設定" 
    100102 
    101 #: xpressme_class.php:292 
     103#: xpressme_class.php:295 
    102104msgid "Display Navi Title of Newer Post Link" 
    103105msgstr "新しい記事へのナビタイトルを設定" 
    104106 
    105 #: xpressme_class.php:295 
     107#: xpressme_class.php:298 
    106108msgid "Select Display name of PostNavi Link" 
    107109msgstr "投稿記事リンクナビのタイトル設定" 
    108110 
    109 #: xpressme_class.php:296 
     111#: xpressme_class.php:299 
    110112msgid "Title of post" 
    111113msgstr "投稿記事のタイトルを表示" 
    112114 
    113 #: xpressme_class.php:297 
     115#: xpressme_class.php:300 
    114116msgid "Title of Navi" 
    115117msgstr "ナビタイトルを表示" 
    116118 
    117 #: xpressme_class.php:300 
     119#: xpressme_class.php:303 
    118120msgid "Adjustment of Navi link display position" 
    119121msgstr "投稿記事ナビリンクの表示位置設定" 
    120122 
    121 #: xpressme_class.php:301 
     123#: xpressme_class.php:304 
    122124msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right" 
    123125msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示" 
    124126 
    125 #: xpressme_class.php:302 
     127#: xpressme_class.php:305 
    126128msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right" 
    127129msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示" 
    128130 
    129 #: xpressme_class.php:305 
     131#: xpressme_class.php:308 
    130132msgid "Is the posts author views counted?" 
    131133msgstr "投稿者の閲覧をカウントしますか?" 
    132134 
    133 #: xpressme_class.php:314 
     135#: xpressme_class.php:313 
     136msgid "Is SQL debugging window displayed?" 
     137msgstr "SQLデバッグウィンドを表示しますか?" 
     138 
     139#: xpressme_class.php:323 
    134140msgid "Update Config" 
    135141msgstr "更新" 
    136142 
    137 #: xpressme_class.php:315 
     143#: xpressme_class.php:324 
    138144msgid "Preset Config" 
    139145msgstr "プリセット" 
  • trunk/wp-content/plugins/xpressme/xpressme.php

    r83 r88  
    5050add_action('user_register', 'user_sync_to_xoops'); 
    5151//require_once('../include/custom_functions.php'); 
     52 
     53// SQL debug windows 
     54add_filter('query', array(&$XPressME, 'xpress_sql_debug')); 
     55add_action('admin_footer', array(&$XPressME, 'displayDebugLog')); 
     56add_action('get_footer', array(&$XPressME, 'displayDebugLog')); 
     57 
    5258?> 
  • trunk/wp-content/plugins/xpressme/xpressme_class.php

    r81 r88  
    1313        var $newer_post_link_text; 
    1414        var $is_author_view_count; 
    15         var $groupe_role_serial; 
     15        var $is_sql_debug; 
    1616        var $groupe_role; 
    1717 
     
    4848                $this->newer_post_link_text = __('to Newer Post', 'xpressme'); 
    4949                $this->is_author_view_count = false; 
     50                $this->is_sql_debug = false; 
    5051        } 
    5152         
     
    7778                        'old_post_link_text' => $this->old_post_link_text , 
    7879                        'newer_post_link_text' => $this->newer_post_link_text, 
    79                         'is_author_view_count' => $this->is_author_view_count 
     80                        'is_author_view_count' => $this->is_author_view_count, 
     81                        'is_sql_debug' => $this->is_sql_debug 
    8082                ); 
    8183                if ($mode == 'add_new') { 
     
    141143                if(empty($this->newer_post_link_text)) $this->newer_post_link_text = __('to Newer Post', 'xpressme'); 
    142144                $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); 
     145                $this->is_sql_debug = stripslashes(trim($_POST['ch_is_sql_debug'])); 
    143146                 
    144147                global $xoops_db; 
     
    307310                                                                                                __('NO','xpressme')              
    308311                                                                                                ); 
     312                echo                            $this->yes_no_radio_option('is_sql_debug', 
     313                                                                                                __('Is SQL debugging window displayed?','xpressme'), 
     314                                                                                                __('YES','xpressme'), 
     315                                                                                                __('NO','xpressme')              
     316                                                                                                ); 
     317                 
    309318                echo                            $this->groupe_role_option();                             
    310319//              $this->is_use_xoops_upload_path_html(); 
     
    339348                } 
    340349                return $uploads; 
     350        } 
     351 
     352        // SQL DEBUG TEST 
     353        function is_sql_debug_permission() 
     354        { 
     355                global $current_user; 
     356 
     357                if ($this->is_sql_debug && ($current_user->user_level >= 10)) 
     358                        return true; 
     359                else 
     360                        return false; 
     361        } 
     362         
     363        function xpress_sql_debug($query_strings) 
     364        { 
     365                if ($this->is_sql_debug_permission()){ 
     366                        if (empty($GLOBALS['XPress_SQL_Query'])) $GLOBALS['XPress_SQL_Query'] = ''; 
     367                        $GLOBALS['XPress_SQL_Query'] .= $query_strings . '<br />'; 
     368                } 
     369                return $query_strings; 
     370        } 
     371         
     372        function displayDebugLog() 
     373        { 
     374                if ($this->is_sql_debug_permission()){ 
     375                        $content = ''; 
     376                        $content .= '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />'; 
     377                        $content .= '<meta http-equiv="content-language" content="'._LANGCODE.'" />' ; 
     378                        $content .= '<title>XPressME SQL DEBUG</title>' ; 
     379                        $content .= '<link rel="stylesheet" type="text/css" media="all" href="'.getcss($GLOBALS['xoopsConfig']['theme_set']).'" />'; 
     380                        $content .= '</head><body>'; 
     381                        $content .= $GLOBALS['XPress_SQL_Query']; 
     382                        $content .= '<div style="text-align:center;"><input class="formButton" value="CLOSE" type="button" onclick="javascript:window.close();" /></div></body></html>'; 
     383 
     384                        echo '<script type="text/javascript"> 
     385                                <!--// 
     386                                xpress_debug_window = window.open("", "xpress_debug", "width=680 , height=600 ,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no"); 
     387                                xpress_debug_window.document.clear(); 
     388                                xpress_debug_window.focus(); 
     389                                '; 
     390                        $lines = preg_split("/(\r\n|\r|\n)( *)/", $content); 
     391                        foreach ($lines as $line) { 
     392                                echo 'xpress_debug_window.document.writeln("'.str_replace('"', '\"', $line).'");'; 
     393                        } 
     394                        echo ' 
     395                                xpress_debug_window.document.close(); 
     396                                //--> 
     397                        </script>'; 
     398                } 
    341399        }        
    342400 
Note: See TracChangeset for help on using the changeset viewer.