XPressME Integration Kit

Trac

source: trunk/include/request_url.php @ 134

Last change on this file since 134 was 132, checked in by toemon, 16 years ago

ImpressCMSで投稿すると、イベント通知するためにXOOPSをロードしたところで
Fatal error: Call to a member function prefix() on a non-object in C:\xampp\htdocs\impress\kernel\configitem.php on line 331のエラーが、
しょうがないので wp-admin/post.phpの場合は事前にXOOPSをロードするようにしてみた。
予約投稿は問題ないみたいだけれど、もいっかいイベント通知の確認しないと駄目かも

File size: 1.7 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;   // 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
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_admin_post_call(){
43        return check_page_call('wp-admin/post.php');
44}
45
46function 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
56function 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?>
Note: See TracBrowser for help on using the repository browser.