XPressME Integration Kit

Trac

Changeset 757


Ignore:
Timestamp:
May 23, 2011, 3:03:57 PM (13 years ago)
Author:
toemon
Message:

ConfigFromXoopsクラスを廃止し、modInfoクラスを使用するように変更
WP2.2以下で使用するテンプレートold_templateの廃止

Location:
branches/Ver3.0
Files:
1 added
6 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • branches/Ver3.0/xpressme_integration_kit/admin/help/wp_install_help.php

    r744 r757  
    11<?php 
     2        function text_indent($text,$num = 1,$css_option='') 
     3        { 
     4                $ret = ''; 
     5                $px = 24 * $num; 
     6                $ret = '<div style="padding-left:' .$px .'px;'.$css_option.'">'; 
     7                $ret .= $text . '</div>'; 
     8                return $ret; 
     9        } 
     10 
     11        function get_download_info($locale='') 
     12        { 
     13                global $modInfo; 
     14                $local_package = ''; 
     15                $mysql_version = preg_replace('/[^0-9.].*/', '', $modInfo->get_mysql_version()); 
     16                $php_version = $modInfo->get_php_version(); 
     17 
     18                if (empty($locale)) $locale = $modInfo->get_wpLang(); 
     19 
     20/* test          
     21                $mysql_version='4.0.27'; 
     22                $php_version = '4.1.1'; 
     23*/ 
     24                // wprdpress original option 
     25                // ?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; 
     26                $option = "?php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; 
     27                $url = "http://api.wordpress.org/core/version-check/1.5/" .$option; 
     28                $handle = @fopen($url,'r'); 
     29                if ($handle) { 
     30                        $ans = array(); 
     31                        $num = 0; 
     32                        $pos = 0; 
     33                while (($buffer = fgets($handle, 4096)) !== false) { 
     34                        $buffer = trim($buffer); 
     35                        if (strlen($buffer) == 0) { 
     36                                $num++; 
     37                                $pos=0; 
     38                        } else { 
     39                                $ans[$num][$pos] = $buffer; 
     40                                $pos++; 
     41                        } 
     42                } 
     43                if (!feof($handle)) { 
     44                        echo "Error: unexpected fgets() fail\n"; 
     45                } 
     46                fclose($handle); 
     47                } 
     48                $ressponce = $ans[0][0]; 
     49                $site_url = $ans[0][1]; 
     50                $download_url = $ans[0][2]; 
     51                $wp_version = $ans[0][3]; 
     52                $download_lang = $ans[0][4]; 
     53//              print_r($ans); 
     54                if (isset($ans[1])){ 
     55                        $en_download_url = $ans[1][2]; 
     56                } 
     57                $ret = text_indent('(Check URL: '.$url.')',3); 
     58                if ($locale == $download_lang){ 
     59                        $ret .= text_indent(sprintf(_AM_XP2_WP_INFO_1,$locale),2); 
     60                        $ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3); 
     61                        if (!empty($en_download_url)){ 
     62                                $ret .= text_indent(_AM_XP2_WP_INFO_4,2); 
     63                                $ret .= text_indent('<a href="'.$en_download_url .'">' . $en_download_url .'</a>' ,3); 
     64                        } 
     65                } else { 
     66                        $ret .= text_indent(sprintf(_AM_XP2_WP_INFO_2,$locale)); 
     67                        $ret .= text_indent(_AM_XP2_WP_INFO_3,2); 
     68                        $ret .= text_indent('<a href="http://codex.wordpress.org/WordPress_in_Your_Language" target="   _blank">WordPress_in_Your_Language</a>' ,3); 
     69                        $ret .= text_indent(_AM_XP2_WP_INFO_4,2); 
     70                        $ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3); 
     71                } 
     72                echo $ret; 
     73        } 
     74} 
     75         
    276        function wp_install_guide(){ 
     77                global $modInfo; 
    378                $mydirpath = dirname( dirname( dirname( __FILE__ ) ) ) ; 
    479                $mydirname = basename(dirname( dirname( dirname( __FILE__ ) ) )) ; 
    5                 include_once $mydirpath . '/class/wpInfo_class.php'; 
    680                $xoops_lang = @$GLOBALS["xoopsConfig"]['language']; 
    7                 $wp_info = new wpInfo; 
    8                 $wp_lang = $wp_info->get_wpLang($xoops_lang); 
    9                 if (!$wp_info->is_wp_file_found()){ 
     81                if (!$modInfo->is_wp_file_found()){ 
    1082                        //Download 
    11                         echo $wp_info->get_mod_image_link('check_bad_s.png'); 
     83                        echo $modInfo->get_mod_image_link('check_bad_s.png'); 
    1284                        echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />'; 
    1385                        echo '<br />'; 
    14                         echo $wp_info->text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2); 
     86                        echo text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2); 
    1587                        echo '<br />'; 
    16                         echo $wp_info->text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;'); 
    17                         echo $wp_info->get_download_info('ja'); 
     88                        echo text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;'); 
     89                        echo get_download_info('ja'); 
    1890                        echo '<br />'; 
    1991                        // Uncompress 
    20                         echo $wp_info->text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;'); 
    21                         echo $wp_info->text_indent(_AM_XP2_WP_INFO_5,2);                         
     92                        echo text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;'); 
     93                        echo text_indent(_AM_XP2_WP_INFO_5,2);                   
    2294                        echo '<br />'; 
    23                         echo '<div style="padding-left:60px;">'.$wp_info->get_mod_image_link('wp_uncompless.png') . '</div>'; 
     95                        echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_uncompless.png') . '</div>'; 
    2496                        echo '<br />'; 
    2597                        // Upload Wordpress 
    26                         echo $wp_info->text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;'); 
    27                         printf($wp_info->text_indent(_AM_XP2_WP_INFO_6,2),$mydirname);                   
    28                         printf($wp_info->text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath);                   
    29                         echo $wp_info->text_indent(_AM_XP2_WP_INFO_8,2); 
     98                        echo text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;'); 
     99                        printf(text_indent(_AM_XP2_WP_INFO_6,2),$mydirname);                     
     100                        printf(text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath);                     
     101                        echo text_indent(_AM_XP2_WP_INFO_8,2); 
    30102                        echo '<br />'; 
    31                         echo '<div style="padding-left:60px;">'.$wp_info->get_mod_image_link('wp_upload.png') . '</div>'; 
     103                        echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_upload.png') . '</div>'; 
    32104                        echo '<br />'; 
    33105                        //Install 
    34                         echo $wp_info->text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;'); 
    35                         echo $wp_info->text_indent(_AM_XP2_WP_INFO_9,2);                         
     106                        echo text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;'); 
     107                        echo text_indent(_AM_XP2_WP_INFO_9,2);                   
    36108 
    37109                } else { 
    38                         echo $wp_info->get_mod_image_link('check_good_s.png'); 
     110                        echo $modInfo->get_mod_image_link('check_good_s.png'); 
    39111                        echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />'; 
    40112                        echo '<br />'; 
  • branches/Ver3.0/xpressme_integration_kit/admin/index.php

    r749 r757  
    319319 
    320320 
    321 function xpress_config_report_view() 
    322 { 
    323         require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 
    324         $xoops_config = new ConfigFromXoops; 
    325         echo 'XOOPS_ROOT_PATH:  ' ;  
    326         if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path) 
    327                 echo 'ERROR '; 
    328         else 
    329                 echo 'OK ';      
    330         echo "<br />\n"; 
    331  
    332         echo 'XOOPS_TRUST_PATH:  ' ;  
    333         if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path) 
    334                 echo 'ERROR '; 
    335         else 
    336                 echo 'OK ';      
    337         echo "<br />\n"; 
    338  
    339         echo 'XOOPS_URL:  ' ;  
    340         if(XOOPS_URL !== $xoops_config->xoops_url) 
    341                 echo 'ERROR '; 
    342         else 
    343                 echo 'OK ';      
    344         echo "<br />\n"; 
    345  
    346         if (defined('XOOPS_SALT')){ 
    347                 echo 'XOOPS_SALT:  ' ;  
    348                 if(XOOPS_SALT !== $xoops_config->xoops_salt) 
    349                         echo 'ERROR '; 
    350                 else 
    351                         echo 'OK ';      
    352                 echo "<br />\n"; 
    353         } 
    354  
    355         if (defined('XOOPS_DB_SALT')){ 
    356                 echo 'XOOPS_DB_SALT:  ' ;  
    357                 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt) 
    358                         echo 'ERROR '; 
    359                 else 
    360                         echo 'OK ';      
    361                 echo "<br />\n"; 
    362         } 
    363  
    364         echo 'XOOPS_DB_HOST:  ' ;  
    365         if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host) 
    366                 echo 'ERROR '; 
    367         else 
    368                 echo 'OK ';      
    369         echo "<br />\n"; 
    370  
    371         echo 'XOOPS_DB_USER:  ' ;  
    372         if(XOOPS_DB_USER !== $xoops_config->xoops_db_user) 
    373                 echo 'ERROR '; 
    374         else 
    375                 echo 'OK ';      
    376         echo "<br />\n"; 
    377  
    378         echo 'XOOPS_DB_PASS:  ' ;  
    379         if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass) 
    380                 echo 'ERROR '; 
    381         else 
    382                 echo 'OK ';      
    383         echo "<br />\n"; 
    384  
    385         echo 'XOOPS_DB_NAME:  ' ;  
    386         if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name) 
    387                 echo 'ERROR '; 
    388         else 
    389                 echo 'OK ';      
    390         echo "<br />\n"; 
    391  
    392         echo 'XOOPS_DB_PREFIX:  ' ;  
    393         if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix) 
    394                 echo 'ERROR '; 
    395         else 
    396                 echo 'OK ';      
    397         echo "<br />\n"; 
    398 } 
    399  
    400 function xpress_config_nomal_view() 
    401 { 
    402         require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 
    403         $xoops_config = new ConfigFromXoops; 
    404          
    405         echo '<table width="400" cellspacing="1" cellpadding="1" border="1">'; 
    406         echo '<tbody>'; 
    407         echo '<tr>'; 
    408         echo '<td>Define item</td>'; 
    409         echo '<td>XOOPS setting value</td>'; 
    410         echo '<td>xoops_config get value</td>'; 
    411         echo '</tr>'; 
    412         echo '<tr>'; 
    413         if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path) 
    414                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>'; 
    415         else 
    416                 echo '<td>XOOPS_ROOT_PATH</td>';         
    417         echo '<td>' . XOOPS_ROOT_PATH . '</td>'; 
    418         echo '<td>' . $xoops_config->xoops_root_path . '</td>'; 
    419         echo '</tr>'; 
    420  
    421         echo '<tr>'; 
    422         if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path) 
    423                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>'; 
    424         else 
    425                 echo '<td>XOOPS_TRUST_PATH</td>';        
    426         echo '<td>' . XOOPS_TRUST_PATH . '</td>'; 
    427         echo '<td>' . $xoops_config->xoops_trust_path . '</td>'; 
    428         echo '</tr>'; 
    429  
    430         echo '<tr>'; 
    431         if(XOOPS_URL !== $xoops_config->xoops_url) 
    432                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>'; 
    433         else 
    434                 echo '<td>XOOPS_URL</td>';       
    435         echo '<td>' . XOOPS_URL . '</td>'; 
    436         echo '<td>' . $xoops_config->xoops_url . '</td>'; 
    437         echo '</tr>'; 
    438  
    439         if (defined('XOOPS_SALT')){ 
    440                 echo '<tr>'; 
    441                 if(XOOPS_SALT !== $xoops_config->xoops_salt) 
    442                         echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>'; 
    443                 else 
    444                         echo '<td>XOOPS_SALT</td>'; 
    445                 echo '<td>' . XOOPS_SALT . '</td>'; 
    446                 echo '<td>' . $xoops_config->xoops_salt . '</td>'; 
    447                 echo '</tr>'; 
    448         } 
    449  
    450         if (defined('XOOPS_DB_SALT')){ 
    451                 echo '<tr>'; 
    452                 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt) 
    453                         echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>'; 
    454                 else 
    455                         echo '<td>XOOPS_DB_SALT</td>'; 
    456                 echo '<td>' . XOOPS_DB_SALT . '</td>'; 
    457                 echo '<td>' . $xoops_config->xoops_db_salt . '</td>'; 
    458                 echo '</tr>'; 
    459         } 
    460  
    461         echo '<tr>'; 
    462         if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host) 
    463                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>'; 
    464         else 
    465                 echo '<td>XOOPS_DB_HOST</td>'; 
    466         echo '<td>' . XOOPS_DB_HOST . '</td>'; 
    467         echo '<td>' . $xoops_config->xoops_db_host . '</td>'; 
    468         echo '</tr>'; 
    469  
    470         echo '<tr>'; 
    471         if(XOOPS_DB_USER !== $xoops_config->xoops_db_user) 
    472                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>'; 
    473         else 
    474                 echo '<td>XOOPS_DB_USER</td>'; 
    475         echo '<td>' . XOOPS_DB_USER . '</td>'; 
    476         echo '<td>' . $xoops_config->xoops_db_user . '</td>'; 
    477         echo '</tr>'; 
    478  
    479         echo '<tr>'; 
    480         if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass) 
    481                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>'; 
    482         else 
    483                 echo '<td>XOOPS_DB_PASS</td>'; 
    484         echo '<td>' . XOOPS_DB_PASS . '</td>'; 
    485         echo '<td>' . $xoops_config->xoops_db_pass . '</td>'; 
    486         echo '</tr>'; 
    487  
    488         echo '<tr>'; 
    489         if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name) 
    490                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>'; 
    491         else 
    492                 echo '<td>XOOPS_DB_NAME</td>'; 
    493         echo '<td>' . XOOPS_DB_NAME . '</td>'; 
    494         echo '<td>' . $xoops_config->xoops_db_name . '</td>'; 
    495         echo '</tr>'; 
    496  
    497         echo '<tr>'; 
    498         if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix) 
    499                 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>'; 
    500         else 
    501                 echo '<td>XOOPS_DB_PREFIX</td>'; 
    502         echo '<td>' . XOOPS_DB_PREFIX . '</td>'; 
    503         echo '<td>' . $xoops_config->xoops_db_prefix . '</td>'; 
    504         echo '</tr>'; 
    505         echo '</tbody>'; 
    506         echo '</table>'; 
    507 } 
    508 function xpress_config_from_xoops_view($is_report = false) 
    509 { 
    510         global $xoopsUserIsAdmin,$xoopsUser; 
    511  
    512         $user_groups = $xoopsUser->getGroups(); 
    513         $is_admin_group = in_array('1',$user_groups); 
    514          
    515         require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 
    516         $xoops_config = new ConfigFromXoops; 
    517         if ($is_report) { 
    518                 echo "******** "  . _AM_XP2_XOOPS_CONFIG_INFO . "********" . "<br />\n"; 
    519                 xpress_config_report_view(); 
    520                 echo "<br />\n"; 
    521         } else { 
    522                 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_XOOPS_CONFIG_INFO . "</legend>"; 
    523                 echo "<div style='padding: 8px;'>"; 
    524                 if ($xoopsUserIsAdmin && $is_admin_group){ 
    525                         xpress_config_nomal_view(); 
    526                 } else { 
    527                         xpress_config_report_view(); 
    528                 } 
    529                 echo "</div>"; 
    530                 echo '</legend>'; 
    531                 echo "</fieldset><br />"; 
    532         } 
    533 } 
    534321 
    535322function xpress_state($is_report = false) 
     
    818605        if (!empty($_POST['submit_report'])) $report = true; else $report = false; 
    819606        xpress_sys_info($report); 
    820         xpress_config_from_xoops_view($report); 
    821607        xpress_active_plugin_list($report); 
    822608        xpress_block_state($report); 
  • branches/Ver3.0/xpressme_integration_kit/class/modInfo_class.php

    r755 r757  
    99 */ 
    1010 
    11 /*  
    12  * The function to acquire only a set value without calling the XOOPS system is here. 
    13  */ 
    14  
    15 class modInfo{ 
     11if (defined( 'XOOPS_MAINFILE_INCLUDED')) : 
     12 
     13class modInfoClass { 
    1614        var $xoops_mainfile_path; 
    1715        var $xoops_root_path; 
     
    2725        var $xoops_language; 
    2826        var $module_db_prefix; 
    29         var $db_name; 
    30         var $db_user; 
    31         var $db_pass; 
    32         var $db_host; 
    3327        var $module_name; 
    3428        var $module_path; 
     
    3731        var $module_codename; 
    3832        var $module_id; 
    39         var $is_impress; 
     33        var $xoops_version; 
     34        var $is_impress_cms; 
     35        var $is_cube_legacy; 
     36        var $is_xoops2jp; 
     37        var $is_xoops2; 
     38        var $is_xoops_legacy; 
     39        var $is_jpex; 
    4040        var $xoops_time_zone; 
     41        var $wp_version; 
     42        var $wpConfigInfo; 
    4143         
    4244        function __constructor()        //for PHP5 
    4345    { 
    44         $this->xpressInfo(); 
     46        $this->modInfoClass(); 
    4547        
    4648    } 
    4749     
    48     function modInfo()  //for PHP4 constructor 
     50    function modInfoClass()     //for PHP4 constructor 
    4951    {   
    50         global $xoopsModule; 
    51          
    52         $this->xoops_mainfile_path = dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; 
    53         $this->module_path=dirname(dirname(__FILE__)); 
    54         $this->module_name=basename($this->module_path); 
     52        global $xoopsModule,$wpConfigInfo; 
     53        if (is_object($wpConfigInfo)){ 
     54                include_once dirname(__FILE__).'/wpConfigInfo_class.php'; 
     55                $this->wpConfigInfo = new wpConfigInfoClass; 
     56        } 
    5557                $this->xoops_root_path = XOOPS_ROOT_PATH; 
    5658                $this->xoops_trust_path = (defined('XOOPS_TRUST_PATH')) ? XOOPS_TRUST_PATH : ''; 
    5759                $this->xoops_url = XOOPS_URL; 
    58                 $this->module_url = $this->xoops_url . '/modules/' . $this->module_name; 
     60        $this->xoops_mainfile_path = XOOPS_ROOT_PATH . '/mainfile.php'; 
    5961                $this->xoops_upload_path = XOOPS_UPLOAD_PATH; 
    6062                $this->xoops_upload_url = XOOPS_UPLOAD_URL; 
    6163                $this->xoops_cache_path = XOOPS_CACHE_PATH; 
    62                 $this->db_prefix = XOOPS_DB_PREFIX; 
    63                 $this->module_db_prefix = $this->xoops_db_prefix  . '_' . preg_replace('/wordpress/','wp',$this->module_name) . '_'; 
    64                 $this->db_name = XOOPS_DB_NAME; 
    65                 $this->db_user = XOOPS_DB_USER; 
    66                 $this->db_pass = XOOPS_DB_PASS; 
    67                 $this->db_host = XOOPS_DB_HOST; 
    68                 $this->xoops_db_salt = (defined('XOOPS_DB_SALT')) ? XOOPS_DB_SALT : ''; 
    69                 $this->xoops_salt = (defined('XOOPS_SALT')) ? XOOPS_SALT : ''; 
     64        $this->module_path=dirname(dirname(__FILE__)); 
     65        $this->module_name=basename($this->module_path); 
     66                $this->module_url = $this->xoops_url . '/modules/' . $this->module_name; 
     67                $this->xoops_db_prefix = XOOPS_DB_PREFIX . '_'; 
     68                $this->module_db_prefix = $this->_get_module_db_prefix(); 
    7069                $this->xoops_lang =  @$GLOBALS["xoopsConfig"]['language']; 
    7170                $this->module_id =! empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0; 
    7271                $this->module_version = empty($xoopsModule) ? $xoopsModule->getVar('version') : ''; 
    73                 $module_codename = $this->_get_module_codename(); 
    74         // start /admin/index.php page detect 
    75         $php_script_name = $_SERVER['SCRIPT_NAME']; 
    76                 $php_query_string = $_SERVER['QUERY_STRING']; 
    77                 $admin_page =   basename(dirname(dirname(__FILE__))) . '/admin/index.php'; 
    78                 $is_xoops_module_admin = false; 
    79                 if (strstr($php_script_name,$admin_page) !== false) $is_xoops_module_admin = true; 
    80                 if (strstr($php_query_string,$admin_page) !== false) $is_xoops_module_admin = true; 
     72                $this->module_codename = $this->_get_module_codename(); 
     73                $this->wp_version = $this->_get_wp_version(); 
     74                 
     75                $this->xoops_version = (defined('XOOPS_VERSION')) ? XOOPS_VERSION : ''; 
     76        $this->_branches_cores(); 
    8177                 
    8278                if (function_exists('date_default_timezone_get')){ 
    8379                        $this->xoops_time_zone = date_default_timezone_get(); 
    8480                } 
     81 
    8582    } 
    8683 
    87      
     84        function _get_module_db_prefix(){ 
     85        $module_db_prefix = XOOPS_DB_PREFIX . '_' . preg_replace('/wordpress/','wp',$this->module_name); 
     86        return $module_db_prefix; 
     87        } 
     88    function _branches_cores(){ 
     89        /*  XOOPS include/version.php define value */ 
     90                //define("XOOPS_VERSION","XOOPS 2.0.16a JP"); 
     91                //define("XOOPS_VERSION", "XOOPS Cube Legacy 2.2"); 
     92                //define('XOOPS_VERSION', 'ImpressCMS 1.1.2 Final'); 
     93                //define("XOOPS_VERSION", "XOOPS JPEx 1.6"); 
     94                //define("XOOPS_VERSION", "XOOPS 2.3.3"); 
     95                //define("XOOPS_VERSION", "Xoops Legacy");      define("XOOPS_ENGINE", "legacy"); 
     96        $this->is_impress_cms = false; 
     97                $this->is_cube_legacy = false; 
     98                $this->is_xoops2jp = false; 
     99                $this->is_xoops2 = false; 
     100                $this->is_xoops_legacy = false; 
     101                $this->is_jpex = false; 
     102                 
     103                $version = XOOPS_VERSION; 
     104                 
     105                 
     106        // branches by cores 
     107                if( preg_match('/JP$/', $this->xoops_version)) 
     108                        $this->is_xoops2jp = true; 
     109                if( preg_match('/Cube\s*Legacy/', $this->xoops_version)) 
     110                        $this->is_cube_legacy = true; 
     111                if( preg_match('/ImpressCMS/', $this->xoops_version)) 
     112                        $this->is_impress_cms = true; 
     113                if( preg_match('/JPEx/', $this->xoops_version)) 
     114                        $this->is_jpex = true; 
     115                if( preg_match('/XOOPS\s*[0-9|\.]*$/', $this->xoops_version)) 
     116                        $this->is_xoops2 = true; 
     117                if( preg_match('/Xoops\s*Legacy/', $this->xoops_version)) 
     118                        $this->is_xoops_legacy = true; 
     119        } 
     120    function _get_wp_version(){ 
     121        $wp_version_file =  dirname(dirname(__FILE__)) . '/wp-includes/version.php'; 
     122        if (file_exists($wp_version_file)){ 
     123                include $wp_version_file; 
     124                return str_replace("ME", "", $wp_version); 
     125        } 
     126        return ''; 
     127    } 
     128         
    88129    // get XPressME module virsion and codename from xoops_versions.php 
    89130    function _get_module_codename(){ 
     
    100141                return ''; 
    101142    } 
    102      
     143        function get_xoops_db_prefix(){ 
     144                return $this->xoops_db_prefix; 
     145        } 
     146         
     147        function get_xoops_root_path(){ 
     148                return $this->xoops_root_path; 
     149        } 
     150        function get_xoops_trust_path(){ 
     151                return $this->xoops_trust_path; 
     152        } 
     153        function get_xoops_mainfile_path(){ 
     154                return $this->xoops_mainfile_path; 
     155        } 
     156        function get_xoops_header_path(){ 
     157                return $this->xoops_root_path ."/header.php"; 
     158        } 
     159        function get_xoops_footer_path(){ 
     160                return $this->xoops_root_path . '/footer.php'; 
     161        } 
     162        function get_xoops_cache_path(){ 
     163                return $this->xoops_cache_path; 
     164        } 
     165        function get_xoops_url(){ 
     166                return $this->xoops_url; 
     167        } 
     168        function get_xoops_upload_path(){ 
     169                return $this->xoops_upload_path; 
     170        } 
     171        function get_xoops_upload_url(){ 
     172                return $this->xoops_upload_url; 
     173        } 
     174        function get_module_path(){ 
     175                return $this->module_path; 
     176        } 
     177        function get_module_templates_path(){ 
     178                return $this->module_path . '/templates'; 
     179        } 
     180         
     181        function get_module_name(){ 
     182                return $this->module_name; 
     183        } 
     184        function get_module_dirname(){ 
     185                return $this->module_name; 
     186        } 
     187        function get_module_url(){ 
     188                return $this->module_url; 
     189        } 
     190        function get_module_db_prefix(){ 
     191                return $this->xpress_db_prefix; 
     192        } 
     193        function get_xoops_time_zone(){ 
     194                return $this->xoops_time_zone; 
     195        } 
     196        function get_module_version(){ 
     197                return $this->module_version; 
     198        } 
     199        function get_module_codename(){ 
     200                return $this->module_codename; 
     201        } 
     202        function get_wp_version(){ 
     203                return $this->wp_version; 
     204        } 
     205        function get_module_full_version(){ 
     206                return $this->module_version . $this->module_codename; 
     207        } 
     208         
     209        function is_impress_cms(){ 
     210                return $this->is_impress_cms; 
     211        } 
     212        function is_cube_legacy(){ 
     213                return $this->is_cube_legacy; 
     214        } 
     215        function is_xoops2jp(){ 
     216                return $this->is_xoops2jp; 
     217        } 
     218        function is_xoops2(){ 
     219                return $this->is_xoops2; 
     220        } 
     221        function is_xoops_legacy(){ 
     222                return $this->is_xoops_legacy; 
     223        } 
     224        function is_jpex(){ 
     225                return $this->is_jpex; 
     226        } 
     227         
     228        function get_moduleID_ByDirname($dir_name){ 
     229                $module_handler =& xoops_gethandler('module'); 
     230                $module =& $module_handler->getByDirname($dir_name); 
     231                $module_id = $module->getVar('mid'); 
     232        } 
     233         
     234        function get_moduleID(){ 
     235                global $xoopsModule; 
     236                $module_id = $xoopsModule->getVar('mid'); 
     237                return $module_id; 
     238        } 
     239         
     240        function get_ModuleConfig($key_name=''){ 
     241                if (empty($key_name)) return ''; 
     242                global $xoopsModuleConfig; 
     243                $value = isset($xoopsModuleConfig[$key_name]) ? $xoopsModuleConfig[$key_name] : ''; 
     244        } 
     245         
     246        function get_ModuleConfig_ByDirname($dir_name,$key_name=''){ 
     247                $mid = $this->get_moduleID_ByDirname($dir_name); 
     248                $conf_handler =& xoops_gethandler('config'); 
     249                $modConfig = $conf_handler->getConfigsByCat(0, $mid); 
     250                if(empty($modConfig)) return ''; 
     251                if(empty($key_name)) return $modConfig; 
     252                return isset($modConfig[$key_name]) ? $modConfig[$key_name] : ''; 
     253        } 
     254    
    103255        function is_wpdb_installed(){ 
    104256                global $xoopsDB; 
     
    111263                return false; 
    112264        } 
    113          
     265        function is_wp_file_found() 
     266        { 
     267                if (!file_exists($this->module_path . '/wp-settings.php')){ 
     268                        return false; 
     269                } 
     270                return true; 
     271        } 
     272 
    114273        function is_writeable_mode($check_file) { 
    115274        if (!is_dir($check_file)) { 
     
    135294        return true; 
    136295        } 
     296        function get_php_version() 
     297        { 
     298                if (function_exists('phpversion')) 
     299                        return phpversion(); 
     300                else  
     301                        return ''; 
     302        } 
     303        function get_mysql_version() 
     304        { 
     305                global $xoopsDB; 
     306                list($SV) = $xoopsDB->fetchRow($xoopsDB->query('SELECT version()')); 
     307                return $SV; 
     308        } 
     309        public function get_mod_image_link($file_name='')  
     310        { 
     311                $link_url = ''; 
     312                if(!empty($file_name)){ 
     313                        if(file_exists($this->module_path.'/images/'.$file_name)){ 
     314                                $link_url = '<img alt="'.$file_name.'" src="'. $this->mod_url .'/images/'.$file_name.'" title="'.$file_name.'" align=top>'; 
     315                        } 
     316                } 
     317                return $link_url; 
     318        } 
     319        function get_wpLang($xoops_lang=''){ 
     320                return $this->wpConfigInfo->get_wpLang($xoops_lang); 
     321        } 
    137322         
    138323} 
     324endif; 
    139325?> 
  • branches/Ver3.0/xpressme_integration_kit/class/xpressD3commentContent.class.php

    r749 r757  
    4444                function displayCommentsInline( $params ) 
    4545                { 
    46                         global $xoops_config; 
     46                        global $modInfo; 
    4747                        if ( function_exists('date_default_timezone_set') ) 
    48                                 date_default_timezone_set($xoops_config->xoops_time_zone); 
     48                                date_default_timezone_set($modInfo->get_xoops_time_zone()); 
    4949                        $new_params = $this->restructParams( $params ) ; 
    5050                        if (!$this->canAddComment($params['id']) ) { 
  • branches/Ver3.0/xpressme_integration_kit/include/add_xpress_config.php

    r755 r757  
    2020 
    2121require_once dirname(dirname(dirname(dirname( __FILE__ )))).'/mainfile.php' ; 
    22 require_once dirname( __FILE__ ).'/xoops3_define.php' ; 
    23 get_xoops3_define(); 
    2422 
    2523$_SERVER['REQUEST_METHOD'] = $request_method; //It returns it to former data.  
    2624 
    2725require_once dirname( __FILE__ ).'/xpress_debug_log.php' ; 
    28 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 
    29 $xoops_config = new ConfigFromXoops; 
    30 // TEST modInfo_class 
     26require_once dirname(dirname( __FILE__ )).'/class/wpConfigInfo_class.php' ; 
     27$wpConfigInfo = new wpConfigInfoClass; 
    3128require_once dirname(dirname( __FILE__ )).'/class/modInfo_class.php' ; 
    32 $mod_info = new modInfo; 
     29$modInfo = new modInfoClass; 
    3330require_once dirname( __FILE__ ).'/set_cash_cookie_path.php' ; 
    3431?> 
  • branches/Ver3.0/xpressme_integration_kit/include/add_xpress_process.php

    r744 r757  
    1414} 
    1515function safe_site_url(){ 
    16         global $xoops_config,$blog_id,$blogname; 
     16        global $modInfo,$blog_id,$blogname; 
    1717         
    1818        if (is_xpress_index_page_call()){ 
     
    3535                $siteurl = get_option('siteurl'); 
    3636                $home = get_option('home'); 
    37                 $module_url = $xoops_config->module_url; 
    38                 $module_name = $xoops_config->module_name; 
     37                $module_url = $modInfo->get_module_url(); 
     38                $module_name = $modInfo->get_module_name(); 
    3939                $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
    4040                $guess_url = preg_replace('|/' . $module_name . '/.*|i', '/' . $module_name, $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 
     
    5959                } 
    6060                if ($site_url_error || $home_url_error){ 
    61                         include $xoops_config->xoops_root_path ."/header.php"; 
     61                        include $modInfo->get_xoops_header_path(); 
    6262                        $form = '<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n"; 
    6363                        $form .= '<table cellspacing="1" cellpadding="1" border="0">'; 
     
    9494                        $form .= '</form>' ."\n"; 
    9595                        echo $form; 
    96                         include $xoops_config->xoops_root_path . '/footer.php'; 
     96                        include $modInfo->get_xoops_footer_path(); 
    9797                        exit(); 
    9898                } 
     
    103103                        $form .= '<input type="submit" value= "'.__('Permalink Settings').'" name="submit_redirect" />' ."\n"; 
    104104                        $form .= '</form>' ."\n"; 
    105                         include $xoops_config->xoops_root_path ."/header.php"; 
     105                        include $modInfo->get_xoops_header_path(); 
    106106                        echo $form; 
    107                         include $xoops_config->xoops_root_path . '/footer.php'; 
     107                        include $modInfo->get_xoops_footer_path(); 
    108108                        exit(); 
    109109                } 
     
    118118        require_once( dirname( __FILE__ ).'/wp_check.php'); 
    119119        if (!is_wpdb_installed()){ 
    120                 include $xoops_config->xoops_root_path ."/header.php"; 
     120                include $modInfo->get_xoops_header_path(); 
    121121                echo "<h2>Wordpress has not been installed yet. </h2>"; 
    122                 include $xoops_config->xoops_root_path . '/footer.php'; 
     122                include $modInfo->get_xoops_footer_path(); 
    123123                exit(); 
    124124        } 
    125125 
    126         //$_SERVER['REQUEST_METHOD'] = 'POST' is 
    127         //When notifying by a private message, Notification_reserve_send(); 
    128         //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method.  
    129 /* 
    130         $request_method =  (isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : ''; 
    131         $_SERVER['REQUEST_METHOD'] = 'POST'; 
    132         require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php.  
    133         $_SERVER['REQUEST_METHOD'] = $request_method; 
    134 */ 
    135126        xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 
    136127        unset($offset);         //This Trap is provides the case where $offset is defined on the XOOPS side. 
     
    161152                xpress_pulugin_activation('xpressme/xpressme.php'); 
    162153                // reloaded  
    163                 header('Location: ' . $xoops_config->module_url . '/'); 
     154                header('Location: ' . $modInfo->get_module_url() . '/'); 
    164155                 
    165156                $err_str = "The activation of the XPressME plugin was executed.<br />\n"; 
     
    172163        ob_start(); 
    173164                $now_ob_level = ob_get_level(); 
    174                 if (version_compare($xoops_config->wp_version,'2.2', '<')) 
    175                         require_once dirname( __FILE__ ).'/old_template-loader.php' ; 
    176                 else 
    177                         require_once( ABSPATH . WPINC . '/template-loader.php' ); 
     165                require_once( ABSPATH . WPINC . '/template-loader.php' ); 
    178166                ob_end_flush_child($now_ob_level); 
    179167                $wp_output = ob_get_contents(); 
     
    202190        // This Function in xpressme plugin 
    203191        require_once( dirname( __FILE__ ).'/xpress_block_render.php' );  
    204         xpress_unnecessary_block_cache_delete($xoops_config->module_name); 
     192        xpress_unnecessary_block_cache_delete($modInfo->get_module_dirname()); 
    205193        if (is_home()) { 
    206                 xpress_block_cache_refresh($xoops_config->module_name); 
     194                xpress_block_cache_refresh($modInfo->get_module_dirname()); 
    207195                require_once( dirname( __FILE__ ).'/xpress_block_header.php' );  
    208                 set_xpress_block_header($xoops_config->module_name); 
     196                set_xpress_block_header($modInfo->get_module_dirname()); 
    209197        } 
    210198        if ( ini_get( 'register_globals' ) ) 
     
    213201        exit();         // The return to wp-blog-header.php is stolen here 
    214202} 
    215 //if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path;            // for Notification_triggerEvent 
    216 //if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path;  // for Notification_triggerEvent 
    217203xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 
    218204require_once(ABSPATH.'wp-settings.php'); 
  • branches/Ver3.0/xpressme_integration_kit/include/data.inc.php

    r749 r757  
    3131        global $xoopsDB; 
    3232 
     33        $module_handler =& xoops_gethandler('module'); 
     34        $module =& $module_handler->getByDirname($mydirname); 
     35        $module_id = $module->getVar('mid'); 
     36         
    3337        $wp_prefix = preg_replace('/wordpress/','wp',$mydirname); 
    3438        require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php'); 
    3539        include(XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/wp-includes/version.php'); 
    36  
    37         $modules_table = $xoopsDB->prefix('modules'); 
    38         $modSQL ="SELECT mid FROM " . $modules_table . " WHERE dirname LIKE '" . $mydirname . "'"; 
    39         $modRes = $xoopsDB->query($modSQL, 0, 0); 
    40         $modRow = $xoopsDB->fetchArray($modRes); 
    41         $module_id = $modRow['mid']; 
    4240 
    4341        $table_config = $xoopsDB->prefix('config'); 
  • branches/Ver3.0/xpressme_integration_kit/include/memory_limit.php

    r752 r757  
    22        // Set XPressME memory limit 
    33        function xpress_set_memory_limmit(){ 
    4                 global $xoops_config; 
    54                global $xoopsDB,$xoopsModule,$xoopsModuleConfig; 
    65                 
  • branches/Ver3.0/xpressme_integration_kit/include/request_url.php

    r232 r757  
    1313 */ 
    1414function check_page_call($check_file =''){ 
    15         global $xoops_config;   // not object at install 
     15        global $modInfo;        // not object at install 
    1616        if (empty($check_file)) return false; 
    1717        $xpress_page =  basename(dirname(dirname(__FILE__))) . '/' . $check_file; 
  • branches/Ver3.0/xpressme_integration_kit/include/set_cash_cookie_path.php

    r478 r757  
    11<?php 
    2 $modname= $xoops_config->module_name; 
    3 $modurl = $xoops_config->module_url; 
     2$modname= $modInfo->get_module_dirname(); 
     3$modurl = $modInfo->get_module_url(); 
    44$hash = md5($modurl); 
    55/** 
     
    5050 */ 
    5151if ( !defined('COOKIEPATH') ) 
    52         define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url . '/' ) ); 
     52        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $modInfo->get_xoops_url() . '/' ) ); 
    5353 
    5454/** 
     
    5757 */ 
    5858if ( !defined('SITECOOKIEPATH') ) 
    59         define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url  . '/' ) ); 
     59        define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $modInfo->get_xoops_url()  . '/' ) ); 
    6060 
    6161/** 
  • branches/Ver3.0/xpressme_integration_kit/include/wp_installer.php

    r744 r757  
    4646        //xpress 
    4747        global $wpdb,$wp_rewrite, $wp_queries, $table_prefix, $wp_db_version, $wp_roles, $wp_query,$wp_embed; 
    48         global $xoops_config; 
    4948        $msgs = array(); 
    5049                 
     
    107106         
    108107        // Rewrite Option for Xpress 
    109         $xoops_config_tbl = XOOPS_DB_PREFIX . '_config' ; 
    110         $sql = "SELECT conf_value FROM  $xoops_config_tbl WHERE `conf_name` = 'default_TZ'"; 
     108        $xoops_conf_tbl = XOOPS_DB_PREFIX . '_config' ; 
     109        $sql = "SELECT conf_value FROM  $xoops_conf_tbl WHERE `conf_name` = 'default_TZ'"; 
    111110        $xoops_default_TZ = $wpdb->get_var($sql); 
    112111        update_option('gmt_offset', $xoops_default_TZ);  
  • branches/Ver3.0/xpressme_integration_kit/include/xpress_block_header.php

    r719 r757  
    44        require_once dirname( __FILE__ ) .'/xml.php' ; 
    55        require_once dirname( __FILE__ ) .'/xpress_cache.php' ; 
    6         global $xoops_config; 
     6        global $mod_info; 
    77         
    8         if (!is_object($xoops_config)){ // is call other modules 
    9                 require_once dirname(dirname( __FILE__ )) .'/class/config_from_xoops.class.php' ; 
    10                 $xoops_config = new ConfigFromXoops; 
     8        if (!is_object($mod_info)){ // is call other modules 
     9                require_once dirname(dirname( __FILE__ )) .'/class/modInfo_class.php' ; 
     10                $mod_info = new modInfoClass; 
    1111        } 
    1212         
     
    4646        function get_block_stylesheet_url($mydirname) 
    4747        { 
    48                 global $xoops_config; 
    49                 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
     48                global $mod_info; 
     49                $mydirpath = $mod_info->get_xoops_root_path() . '/modules/' . $mydirname; 
    5050                $select_theme = get_xpress_theme_name($mydirname); 
    5151                $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 
    5252                if (file_exists($style_file)) 
    53                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 
     53                        return $mod_info->get_xoops_url() . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 
    5454                else     
    55                         return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/block_style.css'; 
     55                        return $mod_info->get_xoops_url() . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/block_style.css'; 
    5656        } 
    5757 
  • branches/Ver3.0/xpressme_integration_kit/include/xpress_block_render.php

    r749 r757  
    44        require_once dirname( __FILE__ ) .'/xml.php' ; 
    55        require_once dirname( __FILE__ ) .'/xpress_cache.php' ; 
    6         global $xoops_config; 
    7          
    8         if (!is_object($xoops_config)){ // is call other modules 
    9                 require_once dirname(dirname( __FILE__ )) .'/class/config_from_xoops.class.php' ; 
    10                 $xoops_config = new ConfigFromXoops; 
     6        global $modInfo; 
     7         
     8        if (!is_object($modInfo)){ // is call other modules 
     9                require_once dirname(dirname( __FILE__ )) .'/class/modInfo_class.php' ; 
     10                $modInfo = new modInfoClass; 
    1111        } 
    1212         
     
    6868        { 
    6969                global $xoopsDB; 
    70                         $modules_tbl = $xoopsDB->prefix('modules'); 
    71  
    72                         $sql = "SELECT mid FROM $modules_tbl WHERE dirname = '$mydirname'"; 
    73                         $result =  $xoopsDB->query($sql, 0, 0); 
    74                         if ($xoopsDB->getRowsNum($result)  > 0){ 
    75                                 $row = $xoopsDB->fetchArray($result); 
    76                                 $mid = $row['mid']; 
    77                         } 
    78                         return $mid; 
     70                $module_handler =& xoops_gethandler('module'); 
     71                $module =& $module_handler->getByDirname($mydirname); 
     72                $module_id = $module->getVar('mid'); 
     73                return $module_id; 
    7974        } 
    8075 
     
    121116    function xpress_block_cache_found($mydirname,$block_name) 
    122117    { 
    123         global $xoops_config; 
     118        global $modInfo; 
    124119         
    125                 $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     120                $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    126121        $xml_name = $block_name . '.xml'; 
    127122 
     
    138133        function xpress_block_render($mydirname,$block_function_name,$options) 
    139134        { 
    140                 global $wpdb,$xoops_config,$xoopsUserIsAdmin; 
     135                global $wpdb,$modInfo,$xoopsUserIsAdmin; 
    141136                $func_file = $block_function_name; 
    142137                $call_theme_function_name = str_replace(".php", "", $block_function_name); 
     
    183178                 
    184179                $tpl =& new XoopsTpl() ; 
    185                 $tpl->template_dir = $xoops_config->module_path . '/templates'; 
     180                $tpl->template_dir = $modInfo->get_module_templates_path(); 
    186181                if (!$tpl->template_exists($templates_file)){ 
    187                         $src_file_path = $xoops_config->module_path . '/templates/' .$mydirname. '_' . str_replace(".php", ".html", $block_function_name); 
     182                        $src_file_path = $modInfo->get_module_templates_path() . '/' .$mydirname. '_' . str_replace(".php", ".html", $block_function_name); 
    188183                        $templates_file = add_xpress_tpl($mydirname,$templates_file,$src_file_path); 
    189184                } 
     
    198193         
    199194        function add_xpress_tpl($mydirname,$templates='',$src_file_path){ 
    200                 global $wpdb,$xoops_config , $xoops_db; 
     195                global $wpdb,$modInfo , $xoops_db; 
    201196                 
    202197                $mid = get_block_mid($mydirname); 
     
    210205                        $type = $temp_parm[0]; 
    211206                } 
    212                 $temp_file_path = $xoops_config->module_path . '/templates/'. $filename; 
     207                $temp_file_path = $modInfo->get_module_templates_path() . '/'. $filename; 
    213208                $pattern = '^' . $mydirname . '_'; 
    214209                if (preg_match('/' . $pattern . '/' , $filename, $match)){ // file prefix check 
     
    274269        function xpress_unnecessary_block_cache_delete($mydirname) 
    275270        { 
    276                 global $xoops_db,$xoops_config; 
     271                global $xoops_db,$modInfo; 
    277272                 
    278273                $mid = get_xpress_modid(); 
     
    289284                $pattern = '(' . $pattern . ')'; 
    290285                 
    291                 $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     286                $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    292287                $cache_time = 0; 
    293288        if ($dh = opendir($cache_dir)) { 
  • branches/Ver3.0/xpressme_integration_kit/include/xpress_cache.php

    r719 r757  
    44if(!function_exists("cache_is_writable")): 
    55        function cache_is_writable(){ 
    6                 global $xoops_config; 
    7                 $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     6                global $modInfo; 
     7                $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    88                $filename = $cache_dir .'xpress_cache_test.txt'; 
    99                $fp = @fopen($filename, "w"); 
     
    3030    function xpress_cache_read($mydirname,$collation_key) 
    3131    { 
    32         global $xoops_config; 
     32        global $modInfo; 
    3333         
    34         $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     34        $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    3535        $filename = $cache_dir .$mydirname . '_' . $collation_key; 
    3636        if (xpress_cache_found($filename)) { 
     
    4545    function xpress_cache_write($mydirname,$collation_key,$content) 
    4646    { 
    47                 global $xoops_config; 
    48                 $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     47                global $modInfo; 
     48                $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    4949                $cache_time = 0; 
    5050 
     
    6262    function xpress_cache_clear($mydirname) 
    6363    { 
    64                 global $xoops_config; 
    65                 $cache_dir = $xoops_config->xoops_cache_path . '/'; 
     64                global $modInfo; 
     65                $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 
    6666                $cache_time = 0; 
    6767        if ($dh = opendir($cache_dir)) { 
  • branches/Ver3.0/xpressme_integration_kit/include/xpress_render.php

    r754 r757  
    182182//rendering for the module header and the body 
    183183function xpress_render($contents){ 
    184         global $xoops_config; 
     184        global $modInfo; 
    185185        global $xoopsUser , $xoopsTpl,$xpress_config , $xoopsModule , $xoopsLogger, $xoopsConfig ; //for XOOPS 
    186186         
     
    190190        xpress_remake_global_for_permlink(); 
    191191        $mydirname = basename(dirname(dirname(__FILE__))); 
    192         include $xoops_config->xoops_root_path ."/header.php"; 
     192        include $modInfo->get_xoops_header_path(); 
    193193        $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); 
    194194        $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents)); 
     
    265265        //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed.  
    266266        if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) { 
    267                 require_once $xoops_config->xoops_root_path . '/include/notification_select.php'; 
     267                require_once $modInfo->get_xoops_root_path() . '/include/notification_select.php'; 
    268268        } 
    269269         
     
    272272        $xoopsTpl->clear_cache($templates_file); 
    273273        echo $xoopsTpl->fetch( $templates_file ) ; 
    274         include $xoops_config->xoops_root_path . '/footer.php'; 
     274        include $modInfo->get_xoops_footer_path(); 
    275275} 
    276276 
  • branches/Ver3.0/xpressme_integration_kit/wp-config.php

    r743 r757  
    1818 
    1919/** Do not change. The name of the database for WordPress */ 
    20 define('DB_NAME', $xoops_config->xoops_db_name); 
     20define('DB_NAME', $wpConfigInfo->get_db_name() ); 
    2121 
    2222/** Do not change. MySQL database username */ 
    23 define('DB_USER', $xoops_config->xoops_db_user); 
     23define('DB_USER', $wpConfigInfo->get_db_user() ); 
    2424 
    2525/** Do not change. MySQL database password */ 
    26 define('DB_PASSWORD', $xoops_config->xoops_db_pass); 
     26define('DB_PASSWORD', $wpConfigInfo->get_db_pass() ); 
    2727 
    2828/** Do not change. MySQL hostname */ 
    29 define('DB_HOST', $xoops_config->xoops_db_host); 
     29define('DB_HOST', $wpConfigInfo->get_db_host() ); 
    3030         
    3131/** Database Charset to use in creating database tables. */ 
     
    6161 */ 
    6262// Do not change. $table_prefix is generated from XOOPS DB Priefix and the module directory name.  
    63 $table_prefix  = $xoops_config->module_db_prefix; 
     63$table_prefix  = $wpConfigInfo->get_db_prefix(); 
    6464 
    6565/** 
     
    7575 * define ('WPLANG', 'ja');             // language support to Japanese 
    7676 */ 
    77 define ('WPLANG', $xoops_config->wp_lang);              // language detect from xoops language 
     77define ('WPLANG', $wpConfigInfo->get_wpLang() );                // language detect from xoops language 
    7878 
    7979/* That's all, stop editing! Happy blogging. */ 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php

    r688 r757  
    4040 
    4141function xpress_is_multiblog() { 
    42         global $xoops_config; 
    43          
    4442        if (function_exists('is_multisite') && is_multisite()) return true; 
    4543        return false; 
     
    5654 
    5755function xpress_is_wp_version($operator='==',$comp_version){ 
    58         global $xoops_config; 
    59         return version_compare($xoops_config->wp_version, $comp_version, $operator); 
     56        global $modInfo; 
     57        return version_compare($modInfo->get_wp_version(), $comp_version, $operator); 
    6058} 
    6159 
     
    184182function xpress_credit($args ='') 
    185183{ 
    186         global $wp_version , $xoops_config; 
    187         if ($xoops_config->is_wpmu) { 
    188                 global $wpmu_version; 
    189         } 
     184        global $wp_version , $modInfo; 
    190185         
    191186        $defaults = array( 
     
    197192        extract( $r ); 
    198193         
    199         $xpress_version = $xoops_config->module_version; 
    200         $xpress_codename = $xoops_config->module_codename; 
     194        $xpress_version = $modInfo->get_module_version(); 
     195        $xpress_codename = $modInfo->get_module_codename(); 
    201196        if ($no_link){ 
    202                 if ($xoops_config->is_wpmu) { 
    203                         $output = 'XPressMU Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename); 
    204                         $output .= '(included WordPress MU ' . $wpmu_version. ')'; 
     197                $output = 'XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename); 
     198                if (strstr($wp_version,'ME')){ 
     199                        $output .= '(included WordPress ' . $wp_version . ')'; 
    205200                } else { 
    206                         $output = 'XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename); 
    207                         if (strstr($wp_version,'ME')){ 
    208                                 $output .= '(included WordPress ' . $wp_version . ')'; 
    209                         } else { 
    210                                 $output .= '(included WordPress ' . $wp_version . ')'; 
    211                         } 
    212                 } 
    213         } else { 
    214                 if ($xoops_config->is_wpmu) { 
    215                         $output = '<a href="http://ja.xpressme.info"'. " target='_blank'" . '>XPressMU Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>'; 
    216                         $output .= '(included <a href="http://mu.wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress MU ' . $wpmu_version . '</a>)'; 
     201                        $output .= '(included WordPress ' . $wp_version . ')'; 
     202                } 
     203        } else { 
     204                $output = '<a href="http://ja.xpressme.info"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>'; 
     205                if (strstr($wp_version,'ME')){ 
     206                        $output .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)'; 
    217207                } else { 
    218                         $output = '<a href="http://ja.xpressme.info"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>'; 
    219                         if (strstr($wp_version,'ME')){ 
    220                                 $output .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)'; 
    221                         } else { 
    222                                 $output .= '(included <a href="http://wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)'; 
    223                         } 
     208                        $output .= '(included <a href="http://wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)'; 
    224209                } 
    225210        }                
     
    664649function xpress_post_new_link($args ='') 
    665650{ 
    666         global $xoops_config; 
     651        global $modInfo; 
    667652         
    668653        $defaults = array( 
     
    846831 
    847832function xpress_get_calendar($args = '') { 
    848         global $wpdb, $m, $monthnum, $year, $wp_locale, $posts , $xoops_config; 
     833        global $wpdb, $m, $monthnum, $year, $wp_locale, $posts , $modInfo; 
    849834 
    850835        $defaults = array( 
     
    10351020 
    10361021function xpress_create_new_blog_link($args ='' ) { 
    1037         global $xoops_config; 
     1022        global $modInfo; 
    10381023 
    10391024        global $current_user; 
     
    10581043 
    10591044function xpress_create_new_blog() { 
    1060         global $xoops_config; 
     1045        global $modInfo; 
    10611046        global $current_user; 
    10621047        $ret = array(); 
     
    10701055                        case 'all': 
    10711056                        case 'blog': 
    1072                                 $ret['url'] = $xoops_config->module_url . '/wp-signup.php'; 
     1057                                $ret['url'] = $modInfo->get_module_url() . '/wp-signup.php'; 
    10731058                                $ret['menu_url'] = 'wp-signup.php'; 
    10741059                                $ret['title'] = __('Create New Blog','xpressme'); 
     
    10831068} 
    10841069function xpress_primary_blog_link() { 
    1085         global $xoops_config; 
     1070        global $modInfo; 
    10861071        global $current_user; 
    10871072        global $blog_id; 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php

    r616 r757  
    524524//  The content is reflected in the D3Forum comment when there is a change in the WordPress comment.  
    525525function wp_comment_sync_to_d3forum($comment_ID = 0,$sync_mode){ 
    526         global $xpress_config,$xoops_db,$xoops_config,$wpdb,$blog_id; 
     526        global $xpress_config,$xoops_db,$modInfo,$wpdb,$blog_id; 
    527527         
    528528        if (empty($blog_id)) $blog_id =1; 
    529529         
    530530        if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); 
    531         $mydirname = $xoops_config->module_name; 
     531        $mydirname = $modInfo->get_module_dirname(); 
    532532 
    533533        $d3f_forum_id = $xpress_config->d3forum_forum_id; 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp_old.php

    r718 r757  
    11<?php 
    22// wp_login override for wp2.3 under 
    3 if ( !function_exists('wp_login') && version_compare($xoops_config->wp_version,'2.3', '<')) : 
     3if ( !function_exists('wp_login') && version_compare($modInfo->get_wp_version(),'2.3', '<')) : 
    44        function wp_login($username, $password, $already_md5 = false) { 
    55                global $wpdb, $error; 
     
    4343 
    4444// Under WP2.1 
    45 if (version_compare($xoops_config->wp_version,'2.1', '<')) : 
     45if (version_compare($modInfo->get_wp_version(),'2.1', '<')) : 
    4646        // ADD WP 2.1.0 
    4747        function the_modified_date($d = '') { 
     
    6060 
    6161// Under WP2.2 
    62 if (version_compare($xoops_config->wp_version,'2.2', '<')): 
     62if (version_compare($modInfo->get_wp_version(),'2.2', '<')): 
    6363        // Added WP2.2 wp_parse_args() 
    6464        function wp_parse_args( $args, $defaults = '' ) { 
     
    9595 
    9696// Under WP2.2.1 
    97 if (version_compare($xoops_config->wp_version,'2.2.1', '<')) : 
     97if (version_compare($modInfo->get_wp_version(),'2.2.1', '<')) : 
    9898        // Added WP2.2.1 wp_parse_str() 
    9999        function wp_parse_str( $string, &$array ) { 
     
    107107 
    108108// Under WP2.3 
    109 if (version_compare($xoops_config->wp_version,'2.3', '<')) : 
     109if (version_compare($modInfo->get_wp_version(),'2.3', '<')) : 
    110110        if ( !function_exists('wp_sanitize_redirect') ) : 
    111111        /** 
     
    167167 
    168168// Under WP2.5 
    169 if (version_compare($xoops_config->wp_version,'2.5', '<')) : 
     169if (version_compare($modInfo->get_wp_version(),'2.5', '<')) : 
    170170        // Added WP2.5 absint() 
    171171        function absint( $maybeint ) { 
     
    192192 
    193193// Under WP2.7 
    194 if (version_compare($xoops_config->wp_version,'2.6', '<')) : 
     194if (version_compare($modInfo->get_wp_version(),'2.6', '<')) : 
    195195        /** 
    196196         * Guess the URL for the site. 
     
    215215 
    216216// Under WP2.7 
    217 if (version_compare($xoops_config->wp_version,'2.7', '<')) : 
     217if (version_compare($modInfo->get_wp_version(),'2.7', '<')) : 
    218218        // Added WP2.7 separate_comments() 
    219219        function &separate_comments(&$comments) { 
     
    346346 
    347347// Under WP2.8 
    348 if (version_compare($xoops_config->wp_version,'2.8', '<')) : 
     348if (version_compare($modInfo->get_wp_version(),'2.8', '<')) : 
    349349        function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { 
    350350                $string = (string) $string; 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php

    r662 r757  
    3737function Notification_triggerEvent($force_reserve = false,$category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null) 
    3838{ 
    39         global $xoops_db,$xoops_config; 
     39        global $xoops_db,$modInfo; 
    4040        global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
    4141 
     
    5252                $_SERVER['REQUEST_METHOD'] = 'POST'; 
    5353        } 
    54 //      set_error_handler("xpress_error_handler"); 
    55 //      if ($xoops_config->is_impress != true){  // impress cms is error 
    56 //              if ( !defined("XOOPS_MAINFILE_INCLUDED")) { 
    57 //                      require_once $xoops_config->xoops_mainfile_path;        // load XOOPS System 
    58 //              } 
    59 //      } 
    6054        if (!$force_reserve && defined("XOOPS_MAINFILE_INCLUDED") ) { 
    6155                if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent'); 
     
    8579function do_CommentNotifications($commentID, $comment_post_ID) 
    8680{ 
    87         global $wpdb, $xoops_config , $xoops_db; 
     81        global $wpdb, $modInfo , $xoops_db; 
    8882 
    8983        $table_term_relationships = $wpdb->term_relationships; 
     
    139133function do_PostNotifications($post_id,$not_event) 
    140134{ 
    141         global $wpdb, $xoops_config, $xoops_db; 
     135        global $wpdb, $modInfo, $xoops_db; 
    142136 
    143137         // $not_event:         newpost,editpost ; $commentID, $comment_post_ID) 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php

    r348 r757  
    160160function wp_check_password($password, $hash, $user_id = '') { 
    161161        global $wp_hasher; 
    162         global $xoops_config,$xoops_db; 
     162        global $modInfo,$wpConfigInfo,$xoops_db; 
    163163 
    164164        // For attestation when password has been sent as hash value. (When having logged it in from Xoops and ImpressCMS) 
     
    174174         
    175175        // Password authentication for ImpressCMS  
    176         if($xoops_config->is_impress && function_exists('hash')){ 
    177                 $mainSalt = $xoops_config->xoops_db_salt; 
     176        if($modInfo->is_impress_cms() && function_exists('hash')){ 
     177                $mainSalt = $wpConfigInfo->get_db_salt(); 
    178178                // get user salt 
    179                 $xpress_user_db = $xoops_config->module_db_prefix . 'users'; 
    180                 $xoops_user_db = $xoops_config->xoops_db_prefix . '_users'; 
     179                $xpress_user_db = $wpConfigInfo->get_db_prefix() . 'users'; 
     180                $xoops_user_db = $wpConfigInfo->get_xoops_db_prefix() . 'users'; 
    181181                $login_name = $xoops_db->get_var("SELECT user_login FROM $xpress_user_db WHERE ID = $user_id"); 
    182182                $user_salt = $xoops_db->get_var("SELECT salt FROM $xoops_user_db WHERE uname = '$login_name'"); 
     
    236236if ( !function_exists('wp_redirect') ) : 
    237237function wp_redirect($location, $status = 302) { 
    238         global $is_IIS,$xoops_config,$action; 
     238        global $is_IIS,$modInfo,$action; 
    239239         
    240         if ($location == 'wp-login.php?loggedout=true') $location = $xoops_config->xoops_url.'/user.php?op=logout'; //xoops logout at wp logout 
    241         if ($location == 'wp-login.php?action=register') $location = $xoops_config->xoops_url."/register.php";  //wp-register to xoops register 
    242         if ($action == 'logout') $location = $xoops_config->xoops_url.'/user.php?op=logout'; //xoops logout at comment logout 
     240        if ($location == 'wp-login.php?loggedout=true') $location = $modInfo->get_xoops_url().'/user.php?op=logout'; //xoops logout at wp logout 
     241        if ($location == 'wp-login.php?action=register') $location = $modInfo->get_xoops_url()."/register.php";  //wp-register to xoops register 
     242        if ($action == 'logout') $location = $modInfo->get_xoops_url().'/user.php?op=logout'; //xoops logout at comment logout 
    243243 
    244244        $location = apply_filters('wp_redirect', $location, $status); 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php

    r658 r757  
    11<?php 
    2 global $xoops_config; 
    3 if (!is_object($xoops_config)){ // is call other modules 
    4         require_once dirname(dirname(dirname(dirname(dirname( __FILE__ ))))) .'/class/config_from_xoops.class.php' ; 
    5         $xoops_config = new ConfigFromXoops; 
     2global $modInfo; 
     3if (!is_object($modInfo)){ // is call other modules 
     4        require_once dirname(dirname(dirname(dirname(dirname( __FILE__ ))))) .'/class/modInfoClass.php' ; 
     5        $modInfo = new ConfigFromXoops; 
    66} 
    77 
     
    1414        global $xoops_db; 
    1515         
    16         $modules_db = get_xoops_prefix() . 'modules'; 
     16        $module_handler =& xoops_gethandler('module'); 
     17        $module =& $module_handler->getByDirname($mydirname); 
     18        $moduleID = $module->getVar('mid'); 
     19 
    1720        $config_db = get_xoops_prefix() . 'config'; 
    18  
    19         $moduleID = $xoops_db->get_var("SELECT mid FROM $modules_db WHERE dirname = '$module_dir'"); 
    2021        if (empty($moduleID)) return null; 
    2122        $conf_value = $xoops_db->get_var("SELECT conf_value FROM $config_db WHERE (conf_modid = $moduleID) AND (conf_name = '$config_name')"); 
     
    4647function get_xoops_prefix() 
    4748{ 
    48         global $xoops_config; 
    49         $ret =$xoops_config->xoops_db_prefix . '_'; 
     49        global $modInfo; 
     50        $ret = $modInfo->get_xoops_db_prefix(); 
    5051        return $ret; 
    5152} 
     
    5354function get_xoops_trust_path() 
    5455{ 
    55         global $xoops_config; 
    56         $ret =$xoops_config->xoops_trust_path; 
     56        global $modInfo; 
     57        $ret =$modInfo->get_xoops_trust_path(); 
    5758        return $ret; 
    5859} 
     
    6061function get_xoops_root_path() 
    6162{ 
    62         global $xoops_config; 
    63         $ret =$xoops_config->xoops_root_path; 
     63        global $modInfo; 
     64        $ret =$modInfo->get_xoops_root_path(); 
    6465        return $ret; 
    6566} 
     
    7273function get_xoops_url() 
    7374{ 
    74         global $xoops_config; 
    75         $ret =$xoops_config->xoops_url ; 
     75        global $modInfo; 
     76        $ret =$modInfo->get_xoops_url() ; 
    7677        return $ret; 
    7778} 
     
    7980function get_xpress_url() 
    8081{ 
    81         global $xoops_config; 
    82         $ret =$xoops_config->module_url ; 
     82        global $modInfo; 
     83        $ret =$modInfo->get_module_url() ; 
    8384        return $ret; 
    8485} 
     
    8687function get_xpress_modid() 
    8788{ 
    88         global $xoops_db; 
    89          
    90         $modulename = get_xpress_dir_name();     
    91         $sql = "SELECT mid FROM " . get_xoops_prefix() . "modules WHERE dirname = '$modulename'"; 
    92         $mid = $xoops_db->get_var($sql); 
    93         return $mid;     
     89        global $modInfo; 
     90         
     91        $modulename = get_xpress_dir_name(); 
     92        $mid = $modInfo->get_moduleID_ByDirname($modulename); 
     93        return $mid; 
    9494} 
    9595 
     
    369369function get_block_file_path($mydirname,$file_name) 
    370370{ 
    371         global $xoops_config, $xpress_config; 
    372         $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
     371        global $modInfo, $xpress_config; 
     372        $mydirpath = $modInfo->get_xoops_root_path() . '/modules/' . $mydirname; 
    373373        $select_theme = xpress_ThemeTemplate(get_xpress_theme_name($mydirname)); 
    374374        $xpress_default_theme = 'xpress_default'; 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_upgrade.php

    r748 r757  
    66 
    77function list_xpress_update( $update=null ) { 
    8         global $xoops_config,$xpress_config; 
    9          
    10         $xpress_version = $xoops_config->module_version . $xoops_config->module_codename; 
     8        global $modInfo,$xpress_config; 
     9         
     10        $xpress_version = $modInfo->get_module_full_version(); 
    1111        $lang = WPLANG; 
    1212         
     
    139139 
    140140function do_xpress_upgrade( $develop = false,$reinstall = false ) { 
    141         global $wp_filesystem,$xoops_config; 
     141        global $wp_filesystem,$modInfo; 
    142142 
    143143        if ( $reinstall ) 
     
    191191                show_message( __('Please update the module. ', 'xpressme') ); 
    192192                 
    193                 $update_url = $xoops_config->module_url .'/admin/update.php'; 
     193                $update_url = $modInfo->get_module_url() .'/admin/update.php'; 
    194194                show_message( '<strong>' . __('Actions:', 'xpressme') . '</strong> <a href="' . esc_url( $update_url ) . '">' . __('Go to Module Update', 'xpressme') . '</a>' ); 
    195195        } 
     
    216216 
    217217function xp_remote_get($url, $headers = ""){ 
    218         global $xoops_config; 
    219         $xpress_version = $xoops_config->module_version . $xoops_config->module_codename; 
    220  
    221         require_once( $xoops_config->module_path . '/wp-includes/class-snoopy.php'); 
     218        global $modInfo; 
     219        $xpress_version = $modInfo->get_module_full_version(); 
     220 
     221        require_once( $modInfo->get_module_path() . '/wp-includes/class-snoopy.php'); 
    222222 
    223223        // Snoopy is an HTTP client in PHP 
     
    263263function get_xpress_latest_version($check_url=null){ 
    264264        global $wp_version, $wpdb, $wp_local_package; 
    265         global $xoops_config; 
    266          
    267         $xpress_version = $xoops_config->module_version . $xoops_config->module_codename; 
     265        global $modInfo; 
     266         
     267        $xpress_version = $modInfo->get_module_full_version(); 
    268268        $lang = WPLANG; 
    269269        if(is_null($check_url)) 
     
    362362 
    363363        global $wp_version, $wpdb, $wp_local_package; 
    364         global $xoops_config; 
     364        global $modInfo; 
    365365 
    366366        $php_query_string = $_SERVER['QUERY_STRING']; 
    367         $xpress_version = $xoops_config->module_version . $xoops_config->module_codename; 
     367        $xpress_version = $modInfo->get_module_full_version(); 
    368368 
    369369        $latest = get_option('xpressme_latest_version'); 
     
    387387                $latest_version=$latest['latest_version']; 
    388388                $check_time=$latest['check_time']; 
    389                 $upgrade_page = $xoops_config->module_url . "/wp-admin/admin.php?page=upgrade_page"; 
     389                $upgrade_page = $modInfo->get_module_url() . "/wp-admin/admin.php?page=upgrade_page"; 
    390390 
    391391                if (version_compare($xpress_version, $latest_version, '<')) { 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php

    r633 r757  
    5050function my_plugin_menu() 
    5151{ 
    52         global $xpress_config,$xoops_config; 
     52        global $xpress_config,$modInfo; 
    5353         
    5454        $plugin_url = WP_PLUGIN_URL."/xpressme/"; 
     
    172172function redirect_xoops_admin() 
    173173{ 
    174         global $xoops_config,$xpress_config; 
    175         $xoops_admin_url = $xoops_config->module_url . '/admin/index.php'; 
     174        global $modInfo,$xpress_config; 
     175        $xoops_admin_url = $modInfo->get_module_url() . '/admin/index.php'; 
    176176        wp_redirect($xoops_admin_url); 
    177177} 
     
    179179function display_option_page() 
    180180{ 
    181         global $xoops_config,$xpress_config; 
    182          
    183                 $xoops_admin_url = $xoops_config->module_url . '/admin/index.php'; 
     181        global $modInfo,$xpress_config; 
     182         
     183                $xoops_admin_url = $modInfo->get_module_url() . '/admin/index.php'; 
    184184 
    185185                $do_message =''; 
     
    221221function integration_option_page() 
    222222{ 
    223         global $xoops_config,$xpress_config,$blog_id; 
    224          
    225                 $xoops_admin_url = $xoops_config->module_url . '/admin/index.php'; 
     223        global $modInfo,$xpress_config,$blog_id; 
     224         
     225                $xoops_admin_url = $modInfo->get_module_url() . '/admin/index.php'; 
    226226 
    227227                $do_message =''; 
     
    256256                                                                                        false 
    257257                                                                                        ); 
    258 //              $lock = ($xoops_config->module_url != get_bloginfo('url')); 
     258//              $lock = ($modInfo->get_module_url() != get_bloginfo('url')); 
    259259                $lock = false; 
    260260                echo                            $xpress_config->groupe_role_option($lock);       
     
    273273function other_option_page() 
    274274{ 
    275         global $xoops_config,$xpress_config; 
    276          
    277                 $xoops_admin_url = $xoops_config->module_url . '/admin/index.php'; 
     275        global $modInfo,$xpress_config; 
     276         
     277                $xoops_admin_url = $modInfo->get_module_url() . '/admin/index.php'; 
    278278 
    279279                $do_message =''; 
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php

    r639 r757  
    5555        function setDefault() 
    5656        { 
    57                 global $xoops_config; 
     57                global $modInfo; 
    5858                $this->is_use_xoops_upload_path = true; 
    5959                $this->is_use_xoops_upload_path = true; 
     
    117117        function SettingValueWrite($mode) 
    118118        { 
    119                 global $xoops_config; 
     119                global $modInfo; 
    120120 
    121121                $write_options = array ( 
     
    442442                } // end of loop 
    443443 
    444                 global $xoops_config; 
     444                global $modInfo; 
    445445 
    446446                $table = get_wp_prefix() . 'group_role';         
     
    788788         
    789789        function d3forum_option($do_message = ''){ 
    790                 global $xoops_db,$xoops_config; 
     790                global $xoops_db,$modInfo; 
    791791                 
    792792                $multi_blog_use_d3forum = true; 
     
    809809                        // Form making for forum selection of D3forum 
    810810                        $modules_table = get_xoops_prefix() .'modules'; 
    811                         $sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1"; 
     811                        $sql = "SELECT name,isactive,dirname FROM $modules_table WHERE isactive = 1"; 
    812812                        $modules = $xoops_db->get_results($sql); 
    813813                        foreach ($modules as $module) { 
     
    10511051        function xpress_upload_filter($uploads) 
    10521052        { 
    1053                 global $xoops_config; 
     1053                global $modInfo; 
    10541054                global $blog_id,$blogname; 
    10551055                 
    10561056                if ($this->is_use_xoops_upload_path){ 
    10571057                        $wordpress_dir = ABSPATH ; 
    1058                         $xoops_dir = $xoops_config->xoops_upload_path . '/'; 
     1058                        $xoops_dir = $modInfo->get_xoops_upload_path() . '/'; 
    10591059                        if (xpress_is_multiblog() && $blog_id <> BLOG_ID_CURRENT_SITE){ 
    1060                                 $wordpress_base_url = $xoops_config->module_url; 
     1060                                $wordpress_base_url = $modInfo->get_module_url(); 
    10611061                        } else { 
    10621062                                $wordpress_base_url = get_option( 'siteurl' ); 
    10631063                        } 
    1064                         $xoops_upload_url = $xoops_config->xoops_upload_url; 
     1064                        $xoops_upload_url = $modInfo->get_xoops_upload_url(); 
    10651065                        // @rmdir($uploads[path]);  //remove wordpress side uploads_dir  
    10661066                         
  • branches/Ver3.0/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_widget_class.php

    r670 r757  
    2121        */ 
    2222        function widget($args, $instance){ 
    23                 global $xpress_config,$xoops_config; 
     23                global $xpress_config,$modInfo; 
    2424                global $current_user; 
    2525 
     
    129129        */ 
    130130        function form($instance){ 
    131                 global $xpress_config,$xoops_config; 
     131                global $xpress_config,$modInfo; 
    132132                 
    133133                if (xpress_is_wp_version('<','2.1') ){ 
  • branches/Ver3.0/xpressme_integration_kit/xoops_version.php

    r744 r757  
    137137 
    138138        if(is_object($GLOBALS["xoopsUser"])){ 
    139                 global $current_user , $xoops_config; 
     139                global $current_user; 
    140140                if (mod_access_level() > 0) { 
    141141                $modversion['sub'][1]['name'] = constant( '_MI_XP2_MENU_POST_NEW'); 
Note: See TracChangeset for help on using the changeset viewer.