1 | <?php
|
---|
2 | // used wptouch plugin & iPhone access check (thx uemu)
|
---|
3 | function is_iphone_with_wptouch(){
|
---|
4 | global $wptouch_plugin;
|
---|
5 | if (is_object($wptouch_plugin)) return $wptouch_plugin->applemobile;
|
---|
6 | return false;
|
---|
7 | }
|
---|
8 |
|
---|
9 | require_once( dirname( __FILE__ ).'/request_url.php');
|
---|
10 | if (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 | require_once(ABSPATH.'wp-settings.php');
|
---|
17 | if (!is_object($xoopsUser)){ // before login auth cookie clear
|
---|
18 | wp_logout();
|
---|
19 | }
|
---|
20 | wp();
|
---|
21 |
|
---|
22 | if (!function_exists('is_wordpress_style')){ // When the XPressME plug-in is invalid
|
---|
23 | require_once dirname( __FILE__ ).'/xpress_active_plugin.php' ;
|
---|
24 | xpress_pulugin_activation('xpressme/xpressme.php');
|
---|
25 | // reloaded
|
---|
26 | header('Location: ' . $xoops_config->module_url . '/');
|
---|
27 |
|
---|
28 | $err_str = "The activation of the XPressME plugin was executed.<br />\n";
|
---|
29 | $err_str .= "Because the XPressME plugin was invalid.<br />\n";
|
---|
30 | $err_str .= "Please do the rereading seeing on the page.\n";
|
---|
31 | die($err_str);
|
---|
32 | }
|
---|
33 |
|
---|
34 | Notification_reserve_send();
|
---|
35 | ob_start();
|
---|
36 | if (version_compare($xoops_config->wp_version,'2.2', '<'))
|
---|
37 | require_once dirname( __FILE__ ).'/old_template-loader.php' ;
|
---|
38 | else
|
---|
39 | require_once( ABSPATH . WPINC . '/template-loader.php' );
|
---|
40 | $wp_output = ob_get_contents();
|
---|
41 | ob_end_clean();
|
---|
42 |
|
---|
43 | //Rendering Select
|
---|
44 | if(
|
---|
45 | is_wordpress_style() // When the display mode is WordPress style
|
---|
46 | || is_feed() // It judges it here because it does in is_index_page() through feed to which the permalink is set.
|
---|
47 | || is_iphone_with_wptouch() // When iPhone access & used wptouch plugin (thx uemu)
|
---|
48 | ){
|
---|
49 | echo $wp_output;
|
---|
50 | } else {
|
---|
51 | require_once( dirname( __FILE__ ).'/xpress_render.php' );
|
---|
52 | xpress_render($wp_output);
|
---|
53 | }
|
---|
54 |
|
---|
55 | //When there is no block cache, and an optional block is different, cache is refreshed.
|
---|
56 | //When adding, and changing and deleting Post & Comment, block cache is refreshed by add_action at any time.
|
---|
57 | // This Function in xpressme plugin
|
---|
58 | require_once( dirname( __FILE__ ).'/xpress_block_render.php' );
|
---|
59 | xpress_unnecessary_block_cache_delete($xoops_config->module_name);
|
---|
60 | if (is_home()) xpress_block_cache_refresh($xoops_config->module_name);
|
---|
61 | exit(); // The return to wp-blog-header.php is stolen here
|
---|
62 | }
|
---|
63 | if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent
|
---|
64 | if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent
|
---|
65 | ?> |
---|