XPressME Integration Kit

Trac

Changeset 200 for trunk/admin/index.php


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

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

File:
1 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"; 
Note: See TracChangeset for help on using the changeset viewer.