Changeset 757 for branches/Ver3.0/xpressme_integration_kit/include
- Timestamp:
- May 23, 2011, 3:03:57 PM (13 years ago)
- Location:
- branches/Ver3.0/xpressme_integration_kit/include
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver3.0/xpressme_integration_kit/include/add_xpress_config.php
r755 r757 20 20 21 21 require_once dirname(dirname(dirname(dirname( __FILE__ )))).'/mainfile.php' ; 22 require_once dirname( __FILE__ ).'/xoops3_define.php' ;23 get_xoops3_define();24 22 25 23 $_SERVER['REQUEST_METHOD'] = $request_method; //It returns it to former data. 26 24 27 25 require_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 26 require_once dirname(dirname( __FILE__ )).'/class/wpConfigInfo_class.php' ; 27 $wpConfigInfo = new wpConfigInfoClass; 31 28 require_once dirname(dirname( __FILE__ )).'/class/modInfo_class.php' ; 32 $mod _info = new modInfo;29 $modInfo = new modInfoClass; 33 30 require_once dirname( __FILE__ ).'/set_cash_cookie_path.php' ; 34 31 ?> -
branches/Ver3.0/xpressme_integration_kit/include/add_xpress_process.php
r744 r757 14 14 } 15 15 function safe_site_url(){ 16 global $ xoops_config,$blog_id,$blogname;16 global $modInfo,$blog_id,$blogname; 17 17 18 18 if (is_xpress_index_page_call()){ … … 35 35 $siteurl = get_option('siteurl'); 36 36 $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(); 39 39 $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 40 40 $guess_url = preg_replace('|/' . $module_name . '/.*|i', '/' . $module_name, $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); … … 59 59 } 60 60 if ($site_url_error || $home_url_error){ 61 include $ xoops_config->xoops_root_path ."/header.php";61 include $modInfo->get_xoops_header_path(); 62 62 $form = '<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n"; 63 63 $form .= '<table cellspacing="1" cellpadding="1" border="0">'; … … 94 94 $form .= '</form>' ."\n"; 95 95 echo $form; 96 include $ xoops_config->xoops_root_path . '/footer.php';96 include $modInfo->get_xoops_footer_path(); 97 97 exit(); 98 98 } … … 103 103 $form .= '<input type="submit" value= "'.__('Permalink Settings').'" name="submit_redirect" />' ."\n"; 104 104 $form .= '</form>' ."\n"; 105 include $ xoops_config->xoops_root_path ."/header.php";105 include $modInfo->get_xoops_header_path(); 106 106 echo $form; 107 include $ xoops_config->xoops_root_path . '/footer.php';107 include $modInfo->get_xoops_footer_path(); 108 108 exit(); 109 109 } … … 118 118 require_once( dirname( __FILE__ ).'/wp_check.php'); 119 119 if (!is_wpdb_installed()){ 120 include $ xoops_config->xoops_root_path ."/header.php";120 include $modInfo->get_xoops_header_path(); 121 121 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(); 123 123 exit(); 124 124 } 125 125 126 //$_SERVER['REQUEST_METHOD'] = 'POST' is127 //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 */135 126 xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 136 127 unset($offset); //This Trap is provides the case where $offset is defined on the XOOPS side. … … 161 152 xpress_pulugin_activation('xpressme/xpressme.php'); 162 153 // reloaded 163 header('Location: ' . $ xoops_config->module_url. '/');154 header('Location: ' . $modInfo->get_module_url() . '/'); 164 155 165 156 $err_str = "The activation of the XPressME plugin was executed.<br />\n"; … … 172 163 ob_start(); 173 164 $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' ); 178 166 ob_end_flush_child($now_ob_level); 179 167 $wp_output = ob_get_contents(); … … 202 190 // This Function in xpressme plugin 203 191 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()); 205 193 if (is_home()) { 206 xpress_block_cache_refresh($ xoops_config->module_name);194 xpress_block_cache_refresh($modInfo->get_module_dirname()); 207 195 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()); 209 197 } 210 198 if ( ini_get( 'register_globals' ) ) … … 213 201 exit(); // The return to wp-blog-header.php is stolen here 214 202 } 215 //if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent216 //if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent217 203 xpress_set_memory_limmit(); // Set memory limmit.(Limmit Value from XPressMe modele config.) 218 204 require_once(ABSPATH.'wp-settings.php'); -
branches/Ver3.0/xpressme_integration_kit/include/data.inc.php
r749 r757 31 31 global $xoopsDB; 32 32 33 $module_handler =& xoops_gethandler('module'); 34 $module =& $module_handler->getByDirname($mydirname); 35 $module_id = $module->getVar('mid'); 36 33 37 $wp_prefix = preg_replace('/wordpress/','wp',$mydirname); 34 38 require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php'); 35 39 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'];42 40 43 41 $table_config = $xoopsDB->prefix('config'); -
branches/Ver3.0/xpressme_integration_kit/include/memory_limit.php
r752 r757 2 2 // Set XPressME memory limit 3 3 function xpress_set_memory_limmit(){ 4 global $xoops_config;5 4 global $xoopsDB,$xoopsModule,$xoopsModuleConfig; 6 5 -
branches/Ver3.0/xpressme_integration_kit/include/request_url.php
r232 r757 13 13 */ 14 14 function check_page_call($check_file =''){ 15 global $ xoops_config; // not object at install15 global $modInfo; // not object at install 16 16 if (empty($check_file)) return false; 17 17 $xpress_page = basename(dirname(dirname(__FILE__))) . '/' . $check_file; -
branches/Ver3.0/xpressme_integration_kit/include/set_cash_cookie_path.php
r478 r757 1 1 <?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(); 4 4 $hash = md5($modurl); 5 5 /** … … 50 50 */ 51 51 if ( !defined('COOKIEPATH') ) 52 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $ xoops_config->xoops_url. '/' ) );52 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $modInfo->get_xoops_url() . '/' ) ); 53 53 54 54 /** … … 57 57 */ 58 58 if ( !defined('SITECOOKIEPATH') ) 59 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $ xoops_config->xoops_url. '/' ) );59 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $modInfo->get_xoops_url() . '/' ) ); 60 60 61 61 /** -
branches/Ver3.0/xpressme_integration_kit/include/wp_installer.php
r744 r757 46 46 //xpress 47 47 global $wpdb,$wp_rewrite, $wp_queries, $table_prefix, $wp_db_version, $wp_roles, $wp_query,$wp_embed; 48 global $xoops_config;49 48 $msgs = array(); 50 49 … … 107 106 108 107 // Rewrite Option for Xpress 109 $xoops_conf ig_tbl = XOOPS_DB_PREFIX . '_config' ;110 $sql = "SELECT conf_value FROM $xoops_conf ig_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'"; 111 110 $xoops_default_TZ = $wpdb->get_var($sql); 112 111 update_option('gmt_offset', $xoops_default_TZ); -
branches/Ver3.0/xpressme_integration_kit/include/xpress_block_header.php
r719 r757 4 4 require_once dirname( __FILE__ ) .'/xml.php' ; 5 5 require_once dirname( __FILE__ ) .'/xpress_cache.php' ; 6 global $ xoops_config;6 global $mod_info; 7 7 8 if (!is_object($ xoops_config)){ // is call other modules9 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; 11 11 } 12 12 … … 46 46 function get_block_stylesheet_url($mydirname) 47 47 { 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; 50 50 $select_theme = get_xpress_theme_name($mydirname); 51 51 $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css'; 52 52 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'; 54 54 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'; 56 56 } 57 57 -
branches/Ver3.0/xpressme_integration_kit/include/xpress_block_render.php
r749 r757 4 4 require_once dirname( __FILE__ ) .'/xml.php' ; 5 5 require_once dirname( __FILE__ ) .'/xpress_cache.php' ; 6 global $ xoops_config;7 8 if (!is_object($ xoops_config)){ // is call other modules9 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; 11 11 } 12 12 … … 68 68 { 69 69 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; 79 74 } 80 75 … … 121 116 function xpress_block_cache_found($mydirname,$block_name) 122 117 { 123 global $ xoops_config;118 global $modInfo; 124 119 125 $cache_dir = $ xoops_config->xoops_cache_path. '/';120 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 126 121 $xml_name = $block_name . '.xml'; 127 122 … … 138 133 function xpress_block_render($mydirname,$block_function_name,$options) 139 134 { 140 global $wpdb,$ xoops_config,$xoopsUserIsAdmin;135 global $wpdb,$modInfo,$xoopsUserIsAdmin; 141 136 $func_file = $block_function_name; 142 137 $call_theme_function_name = str_replace(".php", "", $block_function_name); … … 183 178 184 179 $tpl =& new XoopsTpl() ; 185 $tpl->template_dir = $ xoops_config->module_path . '/templates';180 $tpl->template_dir = $modInfo->get_module_templates_path(); 186 181 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); 188 183 $templates_file = add_xpress_tpl($mydirname,$templates_file,$src_file_path); 189 184 } … … 198 193 199 194 function add_xpress_tpl($mydirname,$templates='',$src_file_path){ 200 global $wpdb,$ xoops_config, $xoops_db;195 global $wpdb,$modInfo , $xoops_db; 201 196 202 197 $mid = get_block_mid($mydirname); … … 210 205 $type = $temp_parm[0]; 211 206 } 212 $temp_file_path = $ xoops_config->module_path . '/templates/'. $filename;207 $temp_file_path = $modInfo->get_module_templates_path() . '/'. $filename; 213 208 $pattern = '^' . $mydirname . '_'; 214 209 if (preg_match('/' . $pattern . '/' , $filename, $match)){ // file prefix check … … 274 269 function xpress_unnecessary_block_cache_delete($mydirname) 275 270 { 276 global $xoops_db,$ xoops_config;271 global $xoops_db,$modInfo; 277 272 278 273 $mid = get_xpress_modid(); … … 289 284 $pattern = '(' . $pattern . ')'; 290 285 291 $cache_dir = $ xoops_config->xoops_cache_path. '/';286 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 292 287 $cache_time = 0; 293 288 if ($dh = opendir($cache_dir)) { -
branches/Ver3.0/xpressme_integration_kit/include/xpress_cache.php
r719 r757 4 4 if(!function_exists("cache_is_writable")): 5 5 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() . '/'; 8 8 $filename = $cache_dir .'xpress_cache_test.txt'; 9 9 $fp = @fopen($filename, "w"); … … 30 30 function xpress_cache_read($mydirname,$collation_key) 31 31 { 32 global $ xoops_config;32 global $modInfo; 33 33 34 $cache_dir = $ xoops_config->xoops_cache_path. '/';34 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 35 35 $filename = $cache_dir .$mydirname . '_' . $collation_key; 36 36 if (xpress_cache_found($filename)) { … … 45 45 function xpress_cache_write($mydirname,$collation_key,$content) 46 46 { 47 global $ xoops_config;48 $cache_dir = $ xoops_config->xoops_cache_path. '/';47 global $modInfo; 48 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 49 49 $cache_time = 0; 50 50 … … 62 62 function xpress_cache_clear($mydirname) 63 63 { 64 global $ xoops_config;65 $cache_dir = $ xoops_config->xoops_cache_path. '/';64 global $modInfo; 65 $cache_dir = $modInfo->get_xoops_cache_path() . '/'; 66 66 $cache_time = 0; 67 67 if ($dh = opendir($cache_dir)) { -
branches/Ver3.0/xpressme_integration_kit/include/xpress_render.php
r754 r757 182 182 //rendering for the module header and the body 183 183 function xpress_render($contents){ 184 global $ xoops_config;184 global $modInfo; 185 185 global $xoopsUser , $xoopsTpl,$xpress_config , $xoopsModule , $xoopsLogger, $xoopsConfig ; //for XOOPS 186 186 … … 190 190 xpress_remake_global_for_permlink(); 191 191 $mydirname = basename(dirname(dirname(__FILE__))); 192 include $ xoops_config->xoops_root_path ."/header.php";192 include $modInfo->get_xoops_header_path(); 193 193 $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); 194 194 $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents)); … … 265 265 //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed. 266 266 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'; 268 268 } 269 269 … … 272 272 $xoopsTpl->clear_cache($templates_file); 273 273 echo $xoopsTpl->fetch( $templates_file ) ; 274 include $ xoops_config->xoops_root_path . '/footer.php';274 include $modInfo->get_xoops_footer_path(); 275 275 } 276 276
Note: See TracChangeset
for help on using the changeset viewer.