XPressME Integration Kit

Trac

source: trunk/include/request_url.php @ 95

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

XOOPS mainfile.phpのdefine文を事前に読み取りwp-config.phpのDB接続関係を生成することにより、XOOPSシステムを必要なときだけ呼び出す仕組みを作る。
およびイベント通知関係の修正(まだゲストのアクセス権限がないと駄目)

File size: 1.3 KB
Line 
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 */
14function check_page_call($check_file =''){
15        global $xoops_config;
16        if (empty($check_file)) return false;
17        $xpress_page =  $xoops_config->module_name . '/' . $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
26function is_xpress_index_page_call(){
27        return check_page_call('index.php');
28}
29
30function is_admin_page_call(){
31        return check_page_call('wp-admin');
32}
33
34function is_media_upload_page_call(){
35        return check_page_call('wp-admin/async-upload.php');
36}
37
38function is_wp_cron_page_call(){
39        return check_page_call('wp-cron.php');
40}
41
42function is_xmlrpc_call(){
43        $ret =  check_page_call('xmlrpc.php');
44
45        $xmlrpc_debug = 0;
46        if ($xmlrpc_debug && $ret) {
47                xpress_debug_message('is_xmlrpc_call()'. "\n" . sprint_r($_SERVER) );
48        }
49        return $ret;
50}
51?>
Note: See TracBrowser for help on using the repository browser.