XPressME Integration Kit

Trac

Changeset 752


Ignore:
Timestamp:
May 20, 2011, 1:55:21 PM (13 years ago)
Author:
toemon
Message:

Xoops3 の moduleデータベースのmid が id に変更されたため直接DBアクセスでdirnameからmidを取得できないので
$xoopsModule->getVar('mid')で取得するように変更。

Location:
branches/Ver3.0/xpressme_integration_kit/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Ver3.0/xpressme_integration_kit/include/memory_limit.php

    r551 r752  
    33        function xpress_set_memory_limmit(){ 
    44                global $xoops_config; 
    5                 global $xoopsDB; 
     5                global $xoopsDB,$xoopsModule,$xoopsModuleConfig; 
    66                 
    7                 $module_id = ''; 
    8                 $memory = ''; 
    9                  
    10                 if (!is_object($xoops_config)){ 
    11                         require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 
    12                         $xoops_config = new ConfigFromXoops; 
    13                 } 
    14                  
    15                 $has_xoops_db = (!empty($xoopsDB)); 
    16                 if (!$has_xoops_db) { 
    17                         $cn = mysql_connect($xoops_config->xoops_db_host, $xoops_config->xoops_db_user, $xoops_config->xoops_db_pass); 
    18                         if ($cn){ 
    19                                 $db_selected = mysql_select_db($xoops_config->xoops_db_name, $cn); 
    20                         } 
    21                 } 
    22  
    23                 // get module ID 
    24                 $module_table = $xoops_config->xoops_db_prefix . '_modules'; 
    25                 $module_sql = "SELECT mid FROM $module_table WHERE `dirname` = '$xoops_config->module_name'"; 
    26                 if ($has_xoops_db) { 
    27                         if ($result = $xoopsDB->query($module_sql, 0, 0)){ 
    28                                 $row = $xoopsDB->fetchArray($result); 
    29                                 $module_id = $row['mid']; 
    30                         }        
    31                 } else { 
    32                         if ($db_selected){ 
    33                                 if($result = mysql_query($module_sql)){ 
    34                                         $row = mysql_fetch_assoc($result); 
    35                                         $module_id = $row['mid']; 
    36                                 } 
    37                         } 
    38                 } 
    39                 if (!empty($module_id)){ 
    40                         // get memory_limit 
    41                         $config_table = $xoops_config->xoops_db_prefix . '_config'; 
    42                         $config_sql = "SELECT conf_value FROM $config_table WHERE `conf_modid` = $module_id AND `conf_name` = 'memory_limit'"; 
    43                         if ($has_xoops_db) { 
    44                                 if ($result = $xoopsDB->query($config_sql, 0, 0)){ 
    45                                         $row = $xoopsDB->fetchArray($result); 
    46                                         $memory = $row['conf_value']; 
    47                                 } 
    48                         } else { 
    49                                 if ($db_selected){ 
    50                                         if($result = mysql_query($config_sql)){ 
    51                                                 $row = mysql_fetch_assoc($result); 
    52                                                 $memory = $row['conf_value']; 
    53                                         } 
    54                                 } 
    55                         } 
    56                 } 
    57                 if (!$has_xoops_db) { 
    58                         mysql_close($cn); 
    59                 } 
     7                $memory = ! empty($xoopsModuleConfig) ? $xoopsModuleConfig['memory_limit'] : 0; 
    608                 
    619                if (empty($memory)) return; 
  • branches/Ver3.0/xpressme_integration_kit/include/onuninstall.php

    r751 r752  
    99function xpress_onuninstall_base( $module , $mydirname ) 
    1010{ 
    11         global $xoopsDB; 
     11        global $xoopsDB,$xoopsModule; 
    1212        // transations on module uninstall 
    1313 
     
    2323        } 
    2424 
    25         $mid = $module->getVar('mid') ; 
     25        $mid = $xoopsModule->getVar('mid') ; 
    2626         
    2727        $xp_prefix = preg_replace('/wordpress/','wp',$mydirname); 
Note: See TracChangeset for help on using the changeset viewer.