Index: /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php
===================================================================
--- /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 661)
+++ /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 662)
@@ -35,7 +35,9 @@
 }
 
-function Notification_triggerEvent($category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null)
+function Notification_triggerEvent($force_reserve = false,$category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null)
 {
 	global $xoops_db,$xoops_config;
+	global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin;
+
 	//When notifying by a private message, 
 	//it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 
@@ -56,5 +58,5 @@
 //		}
 //	}
-	if ( defined("XOOPS_MAINFILE_INCLUDED")) {
+	if (!$force_reserve && defined("XOOPS_MAINFILE_INCLUDED") ) {
 		if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent');
 		$module_id = get_xpress_modid() ;
@@ -72,5 +74,10 @@
 //	require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
 //	$notification_handler =& xoops_gethandler( 'notification' ) ;
-	Notification_triggerEvent( 'global' , 0 , 'waiting') ;
+
+	// Fixed Compile Error : /wp-includes/class-phpmailer.php - Cannot redeclare class PHPMailer
+	$comments_notify = get_option('comments_notify');
+	if($comments_notify) $force_reserve = true; else $force_reserve = false;
+	
+	Notification_triggerEvent($force_reserve,'global' , 0 , 'waiting') ;
 }
 
@@ -103,7 +110,12 @@
 
 	$comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
-	Notification_triggerEvent('global' , 0 , 'comment' , $comment_tags , false);
-	Notification_triggerEvent('author' , $post_author , 'comment' , $comment_tags , false);
-	Notification_triggerEvent('post' , $comment_post_ID , 'comment' , $comment_tags , false);
+
+	// Fixed Compile Error : /wp-includes/class-phpmailer.php - Cannot redeclare class PHPMailer
+	$moderation_notify = get_option('moderation_notify');
+	if($moderation_notify) $force_reserve = true; else $force_reserve = false;
+
+	Notification_triggerEvent($force_reserve, 'global' , 0 , 'comment' , $comment_tags , false);
+	Notification_triggerEvent($force_reserve, 'author' , $post_author , 'comment' , $comment_tags , false);
+	Notification_triggerEvent($force_reserve, 'post' , $comment_post_ID , 'comment' , $comment_tags , false);
 
 	// categorie notification
@@ -120,5 +132,5 @@
 		$cat_name = $categorie->cat_name;
 		$comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
-		Notification_triggerEvent('category' , $cat_id , 'comment' , $comment_tags , false);
+		Notification_triggerEvent($force_reserve, 'category' , $cat_id , 'comment' , $comment_tags , false);
 
 	}
@@ -152,9 +164,9 @@
 
 	$posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
-
+	$force_reserve = false;
 	switch ($not_event) {
 		case 'newpost' :
-			Notification_triggerEvent('global' , 0 , 'newpost' , $posts_tags , false);
-			Notification_triggerEvent('author' , $post_author , 'newpost' , $posts_tags , false);
+			Notification_triggerEvent($force_reserve, 'global' , 0 , 'newpost' , $posts_tags , false);
+			Notification_triggerEvent($force_reserve, 'author' , $post_author , 'newpost' , $posts_tags , false);
 
 			// categorie notification
@@ -171,9 +183,9 @@
 				$cat_name = $categorie->cat_name;
 				$posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
-				Notification_triggerEvent('category' , $cat_id , 'newpost' , $posts_tags , false);
+				Notification_triggerEvent($force_reserve, 'category' , $cat_id , 'newpost' , $posts_tags , false);
 			}
 			break;
 		case 'editpost' :
-			Notification_triggerEvent('post' , $post_id , 'editpost' , $posts_tags , false);
+			Notification_triggerEvent($force_reserve, 'post' , $post_id , 'editpost' , $posts_tags , false);
 			break;
 		default :
