Changeset 785 for trunk/xpressme_integration_kit
- Timestamp:
- May 30, 2011, 11:39:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/class/wpConfigInfo_class.php
r783 r785 30 30 { 31 31 global $xoopsModule; 32 $this->xoops_db_prefix = XOOPS_DB_PREFIX .'_'; 33 $this->db_prefix = $this->_get_wp_db_prefix(); 32 $this->xoops_db_prefix = XOOPS_DB_PREFIX . '_'; 34 33 $this->db_name = XOOPS_DB_NAME; 35 34 $this->db_user = XOOPS_DB_USER; … … 37 36 $this->db_host = XOOPS_DB_HOST; 38 37 if(!defined('XOOPS_DB_NAME') ) $this->_get_resource_db_ini(); 38 $this->db_prefix = $this->_get_wp_db_prefix(); 39 39 $this->db_salt = (defined('XOOPS_DB_SALT')) ? XOOPS_DB_SALT : ''; 40 40 require_once dirname( __FILE__ ).'/langInfo_class.php' ; … … 43 43 function _get_wp_db_prefix(){ 44 44 $module_name = basename(dirname(dirname(__FILE__))); 45 $module_db_prefix = XOOPS_DB_PREFIX . '_'. preg_replace('/wordpress/','wp',$module_name) . '_';45 $module_db_prefix = $this->xoops_db_prefix . preg_replace('/wordpress/','wp',$module_name) . '_'; 46 46 return $module_db_prefix; 47 47 } … … 63 63 $this->db_pass = $matchs[1]; 64 64 if (preg_match('/^\s*prefix\s*=\s*[\'"](.*)[\'"]/' ,$line,$matchs)) 65 $this-> db_prefix = $matchs[1];65 $this->xoops_db_prefix = $matchs[1].'_'; 66 66 } 67 67 } … … 70 70 return $this->xoops_db_prefix; 71 71 } 72 function get_db_prefix(){ 73 return $this->db_prefix; 72 function get_db_prefix($module_dirname){ 73 if (empty($module_dirname)){ 74 return $this->db_prefix; 75 } else { 76 $module_db_prefix = $this->xoops_db_prefix . preg_replace('/wordpress/','wp',$module_dirname) . '_'; 77 return $module_db_prefix; 78 } 74 79 } 75 80 function get_wp_db_prefix(){
Note: See TracChangeset
for help on using the changeset viewer.