XPressME Integration Kit

Trac

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

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

メインメニューXPressME設定から読み込みエラー修正 fixes #166

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