XPressME Integration Kit

Trac

source: branches/Ver2.0/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php

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

bump RC2(r236) fixed#129 パーマリンクを設定しておくと、マルチユーザが有効にならないバグ修正
原因としてはパーマリンクを使用すると、$_GETが得られない為でした。
URLからパーマリンクを解析するのは厄介なのでwordpressでの解析を利用することにする上で
do_action('init') の時期では早すぎるので
wordpressがパーマリンクを解析しているparse_request()の発生するapply_filters('request', ...)でxpress_set_author_cookie()を呼び出すことにする。

File size: 3.6 KB
Line 
1<?php
2/*
3Plugin Name: Plugin for XPressME
4Plugin URI: http://ja.xpressme.info
5Description: Plugin for XPressME (custom function,filter,action)
6Author: toemon
7Version: 1.0
8Author URI: http://ja.xpressme.info
9*/
10require_once('xpressme_class.php');
11
12require_once dirname( __FILE__ ).'/include/custom_functions.php' ;              // XPressME functions for themes
13require_once dirname( __FILE__ ).'/include/xpress_common_functions.php' ;
14
15$xoops_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
16$xoops_db->prefix = get_xoops_prefix();
17$xoops_db->tables = array('modules', 'newblocks', 'users');
18
19$xpress_config = new XPressME_Class();
20
21require_once dirname( __FILE__ ).'/include/pluggable-override.php' ;
22
23add_action('admin_menu', array(&$xpress_config, 'add_option_page'));
24add_action('admin_head', array(&$xpress_config, 'add_admin_head'));
25add_filter("upload_dir",array(&$xpress_config, 'xpress_upload_filter'), 1);             // Change wp-include/wp_upload_dir()
26if (!$xpress_config->is_save_post_revision){
27        remove_action( 'pre_post_update', 'wp_save_post_revision' );                    // Not Save Post Revision
28}
29add_action("wp_meta" , "wp_meta_add_xpress_menu");                      // add xpress menu  in wp_meta
30       
31//Site URL check
32add_filter('option_home',                       "safe_site_url_filter");
33add_filter('option_siteurl',            "safe_site_url_filter");
34       
35
36//XOOPS Bloack Cache Refresh
37add_action("comment_post",      "block_cache_refresh");
38add_action("edit_comment",      "block_cache_refresh");
39add_action("wp_set_comment_status","block_cache_refresh"); //wp_delete_comment() at deleted
40add_action("deleted_post",      "block_cache_refresh");
41add_action("publish_post",      "block_cache_refresh");
42add_action("edit_post",         "block_cache_refresh");
43add_action("private_to_published",      "block_cache_refresh");
44add_action("transition_post_status", "block_cache_refresh");
45
46add_action("the_content",       "set_post_views_count");
47
48//XOOPS notifiction
49require_once dirname( __FILE__ ).'/include/notify_functions.php' ;
50add_action("transition_post_status",    "onaction_publish_post_notify" ,10 , 3);
51//      add_action("edit_post", "onaction_edit_post_notify");
52add_action("comment_post",      "onaction_comment_notify");
53//      add_action("approve_comment" , "onaction_comment_apobe_notify");
54add_action("wp_set_comment_status" , "onaction_comment_apobe_notify");
55
56// user data sync  user_sync_to_xoops($user_id)
57require_once dirname( __FILE__ ).'/include/user_sync_xoops.php' ;
58add_action('profile_update', 'user_sync_to_xoops');
59add_action('user_register', 'user_sync_to_xoops');
60//require_once('../include/custom_functions.php');
61
62//D3Forum Comment Integration
63if ($xpress_config->is_use_d3forum){
64        require_once dirname( __FILE__ ).'/include/d3forum_comment_synchro.php' ;
65        add_action("comment_post",      "onaction_comment_post");
66        add_action("edit_comment",      "onaction_edit_comment");
67        add_action("delete_comment","onaction_delete_comment");
68        add_action("delete_post",       "onaction_delete_post");
69        add_action("wp_set_comment_status" , "onaction_comment_apobe");
70       
71       
72        add_filter('comments_template', "disp_d3forum_comments" );
73
74}
75
76
77
78//The trackback and the pingback are excluded from the count of the comment.
79add_filter('get_comments_number', 'xpress_comment_count', 0);
80
81// Query filter for  MultiUser
82add_filter('query','xpress_query_filter');
83//add_action("init", "xpress_set_author_cookie");
84add_filter('request', 'xpress_set_author_cookie');
85
86// SQL debug windows
87add_filter('query', array(&$xpress_config, 'xpress_sql_debug'));
88add_action('admin_footer', array(&$xpress_config, 'displayDebugLog'));
89add_action('get_footer', array(&$xpress_config, 'displayDebugLog'));
90?>
Note: See TracBrowser for help on using the repository browser.