[18] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | Plugin Name: Plugin for XPressME
|
---|
| 4 | Plugin URI: http://www.toemon.com
|
---|
| 5 | Description: Plugin for XPressME (custom function,filter,action)
|
---|
| 6 | Author: toemon
|
---|
| 7 | Version: 0.001
|
---|
| 8 | Author URI: http://www.toemon.com
|
---|
| 9 | */
|
---|
[19] | 10 | require_once('xpressme_class.php');
|
---|
[75] | 11 |
|
---|
[95] | 12 | require_once dirname( __FILE__ ).'/include/custom_functions.php' ; // XPressME functions for themes
|
---|
| 13 | require_once dirname( __FILE__ ).'/include/xpress_common_functions.php' ;
|
---|
[46] | 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 |
|
---|
[144] | 19 | $xpress_config = new XPressME_Class();
|
---|
[83] | 20 |
|
---|
| 21 | require_once dirname( __FILE__ ).'/include/pluggable-override.php' ;
|
---|
| 22 |
|
---|
[144] | 23 | add_action('admin_menu', array(&$xpress_config, 'add_option_page'));
|
---|
| 24 | add_action('admin_head', array(&$xpress_config, 'add_admin_head'));
|
---|
| 25 | add_filter("upload_dir",array(&$xpress_config, 'xpress_upload_filter'), 1); // Change wp-include/wp_upload_dir()
|
---|
| 26 | if (!$xpress_config->is_save_post_revision){
|
---|
[28] | 27 | remove_action( 'pre_post_update', 'wp_save_post_revision' ); // Not Save Post Revision
|
---|
| 28 | }
|
---|
[145] | 29 | add_action("wp_meta" , "wp_meta_add_xpress_menu"); // add xpress menu in wp_meta
|
---|
[96] | 30 |
|
---|
| 31 | //XOOPS Bloack Cache Refresh
|
---|
[46] | 32 | add_action("comment_post", "block_cache_refresh");
|
---|
| 33 | add_action("edit_comment", "block_cache_refresh");
|
---|
[96] | 34 | add_action("wp_set_comment_status","block_cache_refresh"); //wp_delete_comment() at deleted
|
---|
| 35 | add_action("deleted_post", "block_cache_refresh");
|
---|
[46] | 36 | add_action("publish_post", "block_cache_refresh");
|
---|
| 37 | add_action("edit_post", "block_cache_refresh");
|
---|
| 38 | add_action("private_to_published", "block_cache_refresh");
|
---|
[96] | 39 | add_action("transition_post_status", "block_cache_refresh");
|
---|
[46] | 40 |
|
---|
[51] | 41 | add_action("the_content", "set_post_views_count");
|
---|
| 42 |
|
---|
[61] | 43 | //XOOPS notifiction
|
---|
| 44 | require_once dirname( __FILE__ ).'/include/notify_functions.php' ;
|
---|
[91] | 45 | add_action("transition_post_status", "onaction_publish_post_notify" ,10 , 3);
|
---|
[61] | 46 | // add_action("edit_post", "onaction_edit_post_notify");
|
---|
| 47 | add_action("comment_post", "onaction_comment_notify");
|
---|
| 48 | // add_action("approve_comment" , "onaction_comment_apobe_notify");
|
---|
| 49 | add_action("wp_set_comment_status" , "onaction_comment_apobe_notify");
|
---|
[51] | 50 |
|
---|
[72] | 51 | // user data sync user_sync_to_xoops($user_id)
|
---|
| 52 | require_once dirname( __FILE__ ).'/include/user_sync_xoops.php' ;
|
---|
| 53 | add_action('profile_update', 'user_sync_to_xoops');
|
---|
| 54 | add_action('user_register', 'user_sync_to_xoops');
|
---|
[32] | 55 | //require_once('../include/custom_functions.php');
|
---|
[88] | 56 |
|
---|
[104] | 57 | //D3Forum Comment Integration
|
---|
[144] | 58 | if ($xpress_config->is_use_d3forum){
|
---|
[104] | 59 | require_once dirname( __FILE__ ).'/include/d3forum_comment_synchro.php' ;
|
---|
| 60 | add_action("comment_post", "onaction_comment_post");
|
---|
| 61 | add_action("edit_comment", "onaction_edit_comment");
|
---|
| 62 | add_action("delete_comment","onaction_delete_comment");
|
---|
| 63 | add_action("delete_post", "onaction_delete_post");
|
---|
| 64 | add_action("wp_set_comment_status" , "onaction_comment_apobe");
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | add_filter('comments_template', "disp_d3forum_comments" );
|
---|
| 68 |
|
---|
| 69 | }
|
---|
| 70 |
|
---|
[155] | 71 |
|
---|
| 72 |
|
---|
| 73 |
|
---|
[147] | 74 | //The trackback and the pingback are excluded from the count of the comment.
|
---|
| 75 | add_filter('get_comments_number', 'xpress_comment_count', 0);
|
---|
[104] | 76 |
|
---|
[155] | 77 | // Query filter for MultiUser
|
---|
| 78 | add_filter('query','xpress_query_filter');
|
---|
| 79 | add_action("init", "xpress_set_author_cookie");
|
---|
| 80 |
|
---|
[88] | 81 | // SQL debug windows
|
---|
[144] | 82 | add_filter('query', array(&$xpress_config, 'xpress_sql_debug'));
|
---|
| 83 | add_action('admin_footer', array(&$xpress_config, 'displayDebugLog'));
|
---|
| 84 | add_action('get_footer', array(&$xpress_config, 'displayDebugLog'));
|
---|
[18] | 85 | ?> |
---|