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 | //for Event notification update on single post to which link is changed by permalink
|
---|
23 | if ( is_404() ) {
|
---|
24 | if (!empty($_POST['not_redirect'])) {
|
---|
25 | include '../../mainfile.php';
|
---|
26 | require_once XOOPS_ROOT_PATH.'/include/notification_update.php';
|
---|
27 | exit();
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | if (!function_exists('is_wordpress_style')){ // When the XPressME plug-in is invalid
|
---|
32 | require_once dirname( __FILE__ ).'/xpress_active_plugin.php' ;
|
---|
33 | xpress_pulugin_activation('xpressme/xpressme.php');
|
---|
34 | // reloaded
|
---|
35 | header('Location: ' . $xoops_config->module_url . '/');
|
---|
36 |
|
---|
37 | $err_str = "The activation of the XPressME plugin was executed.<br />\n";
|
---|
38 | $err_str .= "Because the XPressME plugin was invalid.<br />\n";
|
---|
39 | $err_str .= "Please do the rereading seeing on the page.\n";
|
---|
40 | die($err_str);
|
---|
41 | }
|
---|
42 |
|
---|
43 | Notification_reserve_send();
|
---|
44 | ob_start();
|
---|
45 | if (version_compare($xoops_config->wp_version,'2.2', '<'))
|
---|
46 | require_once dirname( __FILE__ ).'/old_template-loader.php' ;
|
---|
47 | else
|
---|
48 | require_once( ABSPATH . WPINC . '/template-loader.php' );
|
---|
49 | $wp_output = ob_get_contents();
|
---|
50 | ob_end_clean();
|
---|
51 |
|
---|
52 | //Rendering Select
|
---|
53 | if(
|
---|
54 | is_wordpress_style() // When the display mode is WordPress style
|
---|
55 | || is_feed() // It judges it here because it does in is_index_page() through feed to which the permalink is set.
|
---|
56 | || is_iphone_with_wptouch() // When iPhone access & used wptouch plugin (thx uemu)
|
---|
57 | ){
|
---|
58 | echo $wp_output;
|
---|
59 | } else {
|
---|
60 | require_once( dirname( __FILE__ ).'/xpress_render.php' );
|
---|
61 | xpress_render($wp_output);
|
---|
62 | }
|
---|
63 |
|
---|
64 | //When there is no block cache, and an optional block is different, cache is refreshed.
|
---|
65 | //When adding, and changing and deleting Post & Comment, block cache is refreshed by add_action at any time.
|
---|
66 | // This Function in xpressme plugin
|
---|
67 | require_once( dirname( __FILE__ ).'/xpress_block_render.php' );
|
---|
68 | xpress_unnecessary_block_cache_delete($xoops_config->module_name);
|
---|
69 | if (is_home()) xpress_block_cache_refresh($xoops_config->module_name);
|
---|
70 | exit(); // The return to wp-blog-header.php is stolen here
|
---|
71 | }
|
---|
72 | if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent
|
---|
73 | if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path; // for Notification_triggerEvent
|
---|
74 | ?> |
---|