XPressME Integration Kit

Trac

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

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

閲覧数カウント機能の実装 #18
xpress_post_views_count($post_id=0,$format= ,$show = true)関数で閲覧数表示
wp-content/themes/xpress_default/index.php上で仮に使用しています。
投稿者自身の閲覧をカウントするかしないかは、xpressmeプラグインの設定画面で指定します。

File size: 1.4 KB
Line 
1<?php
2/*
3Plugin Name: Plugin for XPressME
4Plugin URI: http://www.toemon.com
5Description: Plugin for XPressME (custom function,filter,action)
6Author: toemon
7Version: 0.001
8Author URI: http://www.toemon.com
9*/
10require_once('xpressme_class.php');
11require_once dirname( __FILE__ ).'/include/custom_functions.php' ;
12
13
14$xpessme = new XPressME_Class();
15
16
17$xoops_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
18$xoops_db->prefix = get_xoops_prefix();
19$xoops_db->tables = array('modules', 'newblocks', 'users');
20
21
22add_action('admin_menu', array(&$xpessme, 'add_option_page'));
23add_action('admin_head', array(&$xpessme, 'add_admin_head'));
24add_filter("upload_dir",array(&$xpessme, 'xpress_upload_filter'),       1);             // Change wp-include/wp_upload_dir()
25if (!$xpressme->is_save_post_revision){
26        remove_action( 'pre_post_update', 'wp_save_post_revision' );                    // Not Save Post Revision
27}
28add_action("comment_post",      "block_cache_refresh");
29add_action("edit_comment",      "block_cache_refresh");
30add_action("delete_comment","block_cache_refresh");
31add_action("delete_post",       "block_cache_refresh");
32add_action("publish_post",      "block_cache_refresh");
33add_action("edit_post",         "block_cache_refresh");
34add_action("private_to_published",      "block_cache_refresh");
35add_action("wp_set_comment_status" , "block_cache_refresh");
36
37add_action("the_content",       "set_post_views_count");
38
39
40//require_once('../include/custom_functions.php');
41?>
Note: See TracBrowser for help on using the repository browser.