XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/include/add_xpress_process.php @ 438

Last change on this file since 438 was 430, checked in by toemon, 15 years ago

add_xpress_process.phpのwp();が$offset=1を受け取った場合の、不具合を回避 Fixes 242

File size: 3.0 KB
Line 
1<?php
2// used wptouch plugin & iPhone access check (thx uemu)
3function is_iphone_with_wptouch(){
4        global $wptouch_plugin;
5        if (is_object($wptouch_plugin)) return $wptouch_plugin->applemobile;
6        return false;
7}
8
9require_once( dirname( __FILE__ ).'/request_url.php');
10if (is_xpress_index_page_call()){
11        //When notifying by a private message, Notification_reserve_send();
12        //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method.
13        $_SERVER['REQUEST_METHOD'] = 'POST';
14
15        require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php.
16        unset($offset);
17        require_once(ABSPATH.'wp-settings.php');
18        if (!is_object($xoopsUser)){    // before login auth cookie clear
19                wp_logout();
20        }
21        wp();
22       
23        //for Event notification update on single post to which link is changed by permalink
24        if ( is_404() ) {
25                if (!empty($_POST['not_redirect'])) {
26                        include '../../mainfile.php';
27                        require_once XOOPS_ROOT_PATH.'/include/notification_update.php';
28                        exit();
29                }
30        }
31       
32        if (!function_exists('is_wordpress_style')){    // When the XPressME plug-in is invalid
33                require_once dirname( __FILE__ ).'/xpress_active_plugin.php' ;
34                xpress_pulugin_activation('xpressme/xpressme.php');
35                // reloaded
36                header('Location: ' . $xoops_config->module_url . '/');
37               
38                $err_str = "The activation of the XPressME plugin was executed.<br />\n";
39                $err_str .= "Because the XPressME plugin was invalid.<br />\n";
40                $err_str .= "Please do the rereading seeing on the page.\n";                   
41                die($err_str);
42        }
43       
44        Notification_reserve_send();
45        ob_start();     
46                if (version_compare($xoops_config->wp_version,'2.2', '<'))
47                        require_once dirname( __FILE__ ).'/old_template-loader.php' ;
48                else
49                        require_once( ABSPATH . WPINC . '/template-loader.php' );
50                $wp_output = ob_get_contents();
51        ob_end_clean();
52
53        //Rendering Select
54        if(
55                is_wordpress_style()            // When the display mode is WordPress style
56                || is_feed()                            // It judges it here because it does in is_index_page() through feed to which the permalink is set.
57                || is_iphone_with_wptouch()     // When iPhone access & used wptouch plugin (thx uemu)
58        ){
59                        echo $wp_output;
60        } else {
61                        require_once( dirname( __FILE__ ).'/xpress_render.php' );
62                        xpress_render($wp_output);
63        }
64
65        //When there is no block cache, and an optional block is different, cache is refreshed.
66        //When adding, and changing and deleting Post & Comment, block cache is refreshed by add_action at any time.
67        // This Function in xpressme plugin
68        require_once( dirname( __FILE__ ).'/xpress_block_render.php' );
69        xpress_unnecessary_block_cache_delete($xoops_config->module_name);
70        if (is_home()) xpress_block_cache_refresh($xoops_config->module_name);
71        exit();         // The return to wp-blog-header.php is stolen here
72}
73if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path;              // for Notification_triggerEvent
74if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path;    // for Notification_triggerEvent
75?>
Note: See TracBrowser for help on using the repository browser.