<?php
	
function onaction_publish_post_notify($post_id)
{
	include_once ABSPATH . '/include/notification.inc.sub.php';
	do_PostNotifications($post_id,'newpost');
}
function onaction_edit_post_notify($post_id)
{
	include_once ABSPATH . '/include/notification.inc.sub.php';
	do_PostNotifications($post_id,'editpost');
}

function onaction_comment_notify($commentID){
	global $wpdb;
	$status = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_ID = $commentID");
	$post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $commentID");

	if ($status ==1){
		include_once ABSPATH . '/include/notification.inc.sub.php';
		do_CommentNotifications($commentID, $post_id);
	} else {
		require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
		$notification_handler =& xoops_gethandler( 'notification' ) ;
		$notification_handler->triggerEvent( 'global' , 0 , 'waiting') ;
	}
}

function onaction_comment_apobe_notify($commentID){
	global $wpdb;
	$comment_type = $wpdb->get_var("SELECT comment_type FROM $wpdb->comments WHERE comment_ID = $commentID");
	$status = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_ID = $commentID");
	if(is_null($status)) return;
	//	$status = wp_get_comment_status($commentID);
	if ($status == 1){
			onaction_comment_notify($commentID);
	}
}

?>