1 | <?php
|
---|
2 | /*
|
---|
3 | * XPressME - WordPress for XOOPS
|
---|
4 | *
|
---|
5 | * @copyright XPressME Project http://www.toemon.com
|
---|
6 | * @license http://www.fsf.org/copyleft/gpl.html GNU public license
|
---|
7 | * @author toemon
|
---|
8 | * @package module::xpress
|
---|
9 | */
|
---|
10 |
|
---|
11 | /*
|
---|
12 | * There is a function that detects the kind of the page that the access is here.
|
---|
13 | */
|
---|
14 | function check_page_call($check_file =''){
|
---|
15 | global $xoops_config; // not object at install
|
---|
16 | if (empty($check_file)) return false;
|
---|
17 | $xpress_page = basename(dirname(dirname(__FILE__))) . '/' . $check_file;
|
---|
18 | $php_script_name = $_SERVER['SCRIPT_NAME'];
|
---|
19 | $php_query_string = $_SERVER['QUERY_STRING'];
|
---|
20 | if (strstr($php_script_name,$xpress_page) === false) return false;
|
---|
21 | if ($check_file !== 'index.php' ) return true;
|
---|
22 | // index.php check
|
---|
23 | if (strstr($php_query_string,'preview') === false) {
|
---|
24 | if (strstr($php_query_string,'feed') === false) {
|
---|
25 | // Because the judgment is difficult, the feed to which the permalink is set is confirmed here by the after processing.
|
---|
26 | return true;
|
---|
27 | }
|
---|
28 | }
|
---|
29 | return false;
|
---|
30 | }
|
---|
31 |
|
---|
32 | function is_xpress_index_page_call(){
|
---|
33 | return check_page_call('index.php');
|
---|
34 | }
|
---|
35 |
|
---|
36 | function is_admin_page_call(){
|
---|
37 | return check_page_call('wp-admin');
|
---|
38 | }
|
---|
39 |
|
---|
40 | function is_media_upload_page_call(){
|
---|
41 | return check_page_call('wp-admin/async-upload.php');
|
---|
42 | }
|
---|
43 |
|
---|
44 | function is_wp_cron_page_call(){
|
---|
45 | return check_page_call('wp-cron.php');
|
---|
46 | }
|
---|
47 |
|
---|
48 | function is_admin_post_call(){
|
---|
49 | return check_page_call('wp-admin/post.php');
|
---|
50 | }
|
---|
51 |
|
---|
52 | function is_xmlrpc_call(){
|
---|
53 | $ret = check_page_call('xmlrpc.php');
|
---|
54 |
|
---|
55 | $xmlrpc_debug = 0;
|
---|
56 | if ($xmlrpc_debug && $ret) {
|
---|
57 | xpress_debug_message('is_xmlrpc_call()'. "\n" . sprint_r($_SERVER) );
|
---|
58 | }
|
---|
59 | return $ret;
|
---|
60 | }
|
---|
61 |
|
---|
62 | function is_xpress_install_call(){
|
---|
63 | $action = 'action=ModuleInstall&dirname=';
|
---|
64 | $php_script_name = $_SERVER['SCRIPT_NAME'];
|
---|
65 | $php_query_string = $_SERVER['QUERY_STRING'];
|
---|
66 | if (strstr($php_query_string,$action) !== false) return true;
|
---|
67 | return false;
|
---|
68 | }
|
---|
69 | ?>
|
---|