XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php @ 281

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

WP2011のときマルチユーザモードが有効にならないバグ修正 fixes #152

File size: 3.9 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' ;
22if ($xoops_config->is_wp20)
23        require_once dirname( __FILE__ ).'/include/functions_for_wp20.php' ;
24
25add_action('admin_menu', array(&$xpress_config, 'add_option_page'));
26add_action('admin_head', array(&$xpress_config, 'add_admin_head'));
27add_filter("upload_dir",array(&$xpress_config, 'xpress_upload_filter'), 1);             // Change wp-include/wp_upload_dir()
28if (!$xpress_config->is_save_post_revision){
29        remove_action( 'pre_post_update', 'wp_save_post_revision' );                    // Not Save Post Revision
30}
31add_action("wp_meta" , "wp_meta_add_xpress_menu");                      // add xpress menu  in wp_meta
32       
33//Site URL check
34add_filter('option_home',                       "safe_site_url_filter");
35add_filter('option_siteurl',            "safe_site_url_filter");
36       
37
38//XOOPS Bloack Cache Refresh
39add_action("comment_post",      "block_cache_refresh");
40add_action("edit_comment",      "block_cache_refresh");
41add_action("wp_set_comment_status","block_cache_refresh"); //wp_delete_comment() at deleted
42add_action("deleted_post",      "block_cache_refresh");
43add_action("publish_post",      "block_cache_refresh");
44add_action("edit_post",         "block_cache_refresh");
45add_action("private_to_published",      "block_cache_refresh");
46add_action("transition_post_status", "block_cache_refresh");
47
48add_action("the_content",       "set_post_views_count");
49
50//XOOPS notifiction
51require_once dirname( __FILE__ ).'/include/notify_functions.php' ;
52add_action("transition_post_status",    "onaction_publish_post_notify" ,10 , 3);
53//      add_action("edit_post", "onaction_edit_post_notify");
54add_action("comment_post",      "onaction_comment_notify");
55//      add_action("approve_comment" , "onaction_comment_apobe_notify");
56add_action("wp_set_comment_status" , "onaction_comment_apobe_notify");
57
58// user data sync  user_sync_to_xoops($user_id)
59require_once dirname( __FILE__ ).'/include/user_sync_xoops.php' ;
60add_action('profile_update', 'user_sync_to_xoops');
61add_action('user_register', 'user_sync_to_xoops');
62//require_once('../include/custom_functions.php');
63
64//D3Forum Comment Integration
65if ($xpress_config->is_use_d3forum){
66        require_once dirname( __FILE__ ).'/include/d3forum_comment_synchro.php' ;
67        add_action("comment_post",      "onaction_comment_post");
68        add_action("edit_comment",      "onaction_edit_comment");
69        add_action("delete_comment","onaction_delete_comment");
70        add_action("delete_post",       "onaction_delete_post");
71        add_action("wp_set_comment_status" , "onaction_comment_apobe");
72       
73       
74        add_filter('comments_template', "disp_d3forum_comments" );
75
76}
77
78
79
80//The trackback and the pingback are excluded from the count of the comment.
81add_filter('get_comments_number', 'xpress_comment_count', 0);
82
83// Query filter for  MultiUser
84add_filter('query','xpress_query_filter');
85//add_action("init", "xpress_set_author_cookie");
86if(xpress_is_wp20()){
87        // It is called before parse_request() makes $GET.
88        add_action("query_vars", "xpress_set_author_cookie");
89} else {
90        // It is called at the end of parse_request().
91        add_filter('request', 'xpress_set_author_cookie');
92}
93
94// SQL debug windows
95add_filter('query', array(&$xpress_config, 'xpress_sql_debug'));
96add_action('admin_footer', array(&$xpress_config, 'displayDebugLog'));
97add_action('wp_footer', array(&$xpress_config, 'displayDebugLog'));
98
99?>
Note: See TracBrowser for help on using the repository browser.