XPressME Integration Kit

Trac

source: trunk/wp-content/plugins/xpressme/include/notify_functions.php @ 85

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

XOOPSイベント通知の実装 #6
但し現状ではメインコンテンツにイベント通知選択は表示されたない。(ブロックとして表示)

File size: 1.4 KB
Line 
1<?php
2       
3function onaction_publish_post_notify($post_id)
4{
5        include_once ABSPATH . '/include/notification.inc.sub.php';
6        do_PostNotifications($post_id,'newpost');
7}
8function onaction_edit_post_notify($post_id)
9{
10        include_once ABSPATH . '/include/notification.inc.sub.php';
11        do_PostNotifications($post_id,'editpost');
12}
13
14function onaction_comment_notify($commentID){
15        global $wpdb;
16        $status = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_ID = $commentID");
17        $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $commentID");
18
19        if ($status ==1){
20                include_once ABSPATH . '/include/notification.inc.sub.php';
21                do_CommentNotifications($commentID, $post_id);
22        } else {
23                require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
24                $notification_handler =& xoops_gethandler( 'notification' ) ;
25                $notification_handler->triggerEvent( 'global' , 0 , 'waiting') ;
26        }
27}
28
29function onaction_comment_apobe_notify($commentID){
30        global $wpdb;
31        $comment_type = $wpdb->get_var("SELECT comment_type FROM $wpdb->comments WHERE comment_ID = $commentID");
32        $status = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_ID = $commentID");
33        if(is_null($status)) return;
34        //      $status = wp_get_comment_status($commentID);
35        if ($status == 1){
36                        onaction_comment_notify($commentID);
37        }
38}
39
40?>
Note: See TracBrowser for help on using the repository browser.