XPressME Integration Kit

Trac

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

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

予約投稿のイベント通知、実装 #59

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