XPressME Integration Kit

Trac

Changeset 200


Ignore:
Timestamp:
May 1, 2009, 2:21:05 PM (15 years ago)
Author:
toemon
Message:

Bump RC1(r200) #115 システム情報にユーザーメタ情報の表示実装

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/index.php

    r199 r200  
    3030//include_once 'cp_functions.php'; 
    3131 
     32function admin_check_user_meta_prefix($is_report = false){ 
     33        global $xoopsModule; 
     34        $xoopsDB =& Database::getInstance(); 
     35         
     36        $mydirname = basename(dirname(dirname(__FILE__))); 
     37        $my_dirpath = dirname(dirname(__FILE__)); 
     38        $wp_prefix_only = $mydirname; 
     39        if ($wp_prefix_only == 'wordpress') $wp_prefix_only ='wp'; 
     40        $db_prefix = $xoopsDB->prefix($wp_prefix_only); 
     41 
     42        $usermeta_tbl = $db_prefix . '_usermeta';        
     43        $meta_key_pattern = '_' . $wp_prefix_only . '_'; 
     44 
     45        $sql = "SELECT count(umeta_id) as data_count ,meta_key FROM $usermeta_tbl GROUP BY meta_key HAVING meta_key LIKE '%" . $meta_key_pattern ."%'" ; 
     46        $res =  $xoopsDB->query($sql, 0, 0); 
     47         
     48        if ($res === false){ 
     49                $check_str = _AM_XP2_USER_META_NONE . "<br />\n"; 
     50        } else { 
     51                $error =false; 
     52                $check_str = ''; 
     53                while($row = $xoopsDB->fetchArray($res)){ 
     54                        $data_count  = $row['data_count']; 
     55                        $meta_key = $row['meta_key']; 
     56                        if ( !preg_match('/^'.$db_prefix. '_.*/',$meta_key , $maches)){ 
     57                                $check_str .= sprintf(_AM_XP2_USER_META_ERR , $meta_key,$data_count) ."<br /> \n"; 
     58                                $error = true; 
     59                        } 
     60                } 
     61                if (!$error) 
     62                        $check_str = _AM_XP2_USER_META_OK ; 
     63        } 
     64        if ($is_report) { 
     65                echo "******** "  . _AM_XP2_USER_META_KEY . "********" . "<br />\n"; 
     66                echo $check_str . "<br />\n<br />\n"; 
     67        } else { 
     68                echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_USER_META_KEY . "</legend>"; 
     69                echo "<div style='padding: 8px;'>"; 
     70                echo $check_str; 
     71                echo "</div>"; 
     72                echo "</fieldset>"; 
     73        } 
     74 
     75} 
    3276 
    3377function get_xpress_plugin_data( $plugin_file, $markup = true, $translate = true ) { 
     
    565609xpress_active_plugin_list($report); 
    566610xpress_block_state($report); 
     611admin_check_user_meta_prefix($report); 
    567612xpress_state($report); 
    568613echo '<form method="POST">'."\n"; 
  • trunk/language/english/admin.php

    r199 r200  
    3333        define("_AM_XP2_BLOCK_ADMIN_SETTING","The arrangement setting of the block and the access authority of the block are set again. "); 
    3434        define("_AM_XP2_BLOCK_TO_SETTING","to blocks/permissions"); 
    35          
    36          
     35        define("_AM_XP2_USER_META_KEY","User meta information"); 
     36        define("_AM_XP2_USER_META_NONE","There is no meta key necessary for the user level."); 
     37        define("_AM_XP2_USER_META_ERR","There is a meta key named %s that the prefix is different in %d piece."); 
     38        define("_AM_XP2_USER_META_OK","The user meta key is normal.");           
    3739} 
    3840?> 
  • trunk/language/ja_utf8/admin.php

    r199 r200  
    3333        define("_AM_XP2_BLOCK_ADMIN_SETTING","ブロックの配置とアクセス権限を再設定します。"); 
    3434        define("_AM_XP2_BLOCK_TO_SETTING","ブロック権限の設定へ"); 
    35          
    36          
     35        define("_AM_XP2_USER_META_KEY","ユーザーメタ情報"); 
     36        define("_AM_XP2_USER_META_NONE","ユーザーレベルに必要なメタキーがありません"); 
     37        define("_AM_XP2_USER_META_ERR","プレフィックスの異なる %s というメタキーが %d つあります。"); 
     38        define("_AM_XP2_USER_META_OK","ユーザーメタキーは正常です");  
    3739} 
    3840?> 
  • trunk/xoops_version.php

    r199 r200  
    4040 
    4141// status 
    42 $modversion['codename'] = "Bata3(r199)"; 
     42$modversion['codename'] = "RC1(r200)"; 
    4343 
    4444// onInstall, onUpdate, onUninstall 
Note: See TracChangeset for help on using the changeset viewer.