| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | function 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 |
|
|---|
| 11 | function onaction_edit_post_notify($post_id)
|
|---|
| 12 | {
|
|---|
| 13 | include_once ABSPATH . '/include/notification.inc.sub.php';
|
|---|
| 14 | do_PostNotifications($post_id,'editpost');
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | function 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 |
|
|---|
| 32 | function 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 | ?> |
|---|