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 | if (strstr($php_query_string,'preview') === false) return true;
|
---|
23 | return false;
|
---|
24 | }
|
---|
25 |
|
---|
26 | function is_xpress_index_page_call(){
|
---|
27 | return check_page_call('index.php');
|
---|
28 | }
|
---|
29 |
|
---|
30 | function is_admin_page_call(){
|
---|
31 | return check_page_call('wp-admin');
|
---|
32 | }
|
---|
33 |
|
---|
34 | function is_media_upload_page_call(){
|
---|
35 | return check_page_call('wp-admin/async-upload.php');
|
---|
36 | }
|
---|
37 |
|
---|
38 | function is_wp_cron_page_call(){
|
---|
39 | return check_page_call('wp-cron.php');
|
---|
40 | }
|
---|
41 |
|
---|
42 | function is_admin_post_call(){
|
---|
43 | return check_page_call('wp-admin/post.php');
|
---|
44 | }
|
---|
45 |
|
---|
46 | function is_xmlrpc_call(){
|
---|
47 | $ret = check_page_call('xmlrpc.php');
|
---|
48 |
|
---|
49 | $xmlrpc_debug = 0;
|
---|
50 | if ($xmlrpc_debug && $ret) {
|
---|
51 | xpress_debug_message('is_xmlrpc_call()'. "\n" . sprint_r($_SERVER) );
|
---|
52 | }
|
---|
53 | return $ret;
|
---|
54 | }
|
---|
55 |
|
---|
56 | function is_xpress_install_call(){
|
---|
57 | $action = 'action=ModuleInstall&dirname=';
|
---|
58 | $php_script_name = $_SERVER['SCRIPT_NAME'];
|
---|
59 | $php_query_string = $_SERVER['QUERY_STRING'];
|
---|
60 | if (strstr($php_query_string,$action) !== false) return true;
|
---|
61 | return false;
|
---|
62 | }
|
---|
63 | ?>
|
---|