XPressME Integration Kit

Trac


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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'); 
Note: See TracChangeset for help on using the changeset viewer.