Index: trunk/include/notification.inc.php
===================================================================
--- trunk/include/notification.inc.php	(revision 61)
+++ trunk/include/notification.inc.php	(revision 61)
@@ -0,0 +1,41 @@
+<?php
+
+function xpress_notify_info( $category , $item_id )
+{
+	$db =& Database::getInstance() ;
+	$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+
+//	$module_handler =& xoops_gethandler( 'module' ) ;
+//	$module =& $module_handler->getByDirname( $mydirname ) ;
+
+	if( $category == 'global' ) {
+		$item['name'] = '';
+		$item['url'] = XOOPS_URL.'/modules/'.$mydirname . '/wp-admin/edit-comments.php?comment_status=moderated';
+		return $item ;
+	}
+
+	if( $category == 'category' ) {
+		// Assume we have a valid cat_id
+		$item['name'] = '';
+		$item['url'] = '';
+
+		return $item ;
+	}
+	
+	if( $category == 'author' ) {
+		// Assume we have a valid cat_id
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item ;
+	}
+
+	if( $category == 'post' ) {
+		// Assume we have a valid forum_id
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item ;
+	}
+
+}
+?>
Index: trunk/include/notification.inc.sub.php
===================================================================
--- trunk/include/notification.inc.sub.php	(revision 61)
+++ trunk/include/notification.inc.sub.php	(revision 61)
@@ -0,0 +1,146 @@
+<?php
+function do_CommentNotifications($commentID, $comment_post_ID)
+{
+	$xpress_prefix = $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+	if ($xpress_prefix == 'wordpress') $xpress_prefix = 'wp';
+	$db =& Database::getInstance() ;
+	$myts =& MyTextsanitizer::getInstance() ;
+
+	$table_term_relationships = $db->prefix($xpress_prefix."_term_relationships");
+	$table_term_taxonomy = $db->prefix($xpress_prefix."_term_taxonomy");
+	$table_terms = $db->prefix($xpress_prefix."_terms");
+	$table_categories = $db->prefix($xpress_prefix."_categories");
+	$wp_post = $db->prefix($xpress_prefix."_posts");
+	$wp_options = $db->prefix($xpress_prefix."_options");
+	$wp_users  = $db->prefix($xpress_prefix."_users");
+	$wp_comments  = $db->prefix($xpress_prefix."_comments");
+	$post_id = $comment_post_ID;
+
+	$post_title = get_the_title($post_id);
+	$post_url = get_permalink($post_id). '#comment';
+	$blog_name = get_bloginfo('name');
+
+	/*
+	$sql = "SELECT option_value  FROM $wp_options WHERE option_name ='blogname'";
+	$blog_row = $db->fetchArray( $db->query( $sql ) ) ;
+	if( empty( $blog_row ) ) return false;
+	$blog_name = $blog_row['option_value'];
+	*/								
+	// query
+	$sql = "SELECT * FROM ".$wp_post." WHERE ID=$comment_post_ID ";
+	$post_row = $db->fetchArray( $db->query( $sql ) ) ;
+	if( empty( $post_row ) ) return false;
+	//			$post_title = $post_row['post_title'];
+	$post_author = $post_row['post_author'];
+
+	$sql = "SELECT display_name  FROM $wp_users WHERE ID ='$post_author'";
+	$blog_row = $db->fetchArray( $db->query( $sql ) ) ;
+	if( empty( $blog_row ) ) return false;
+	$user_name = $blog_row['display_name'];
+
+	require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
+	// non-module integration returns false quickly
+	
+	if( ! is_object($GLOBALS["xoopsModule"]) ) return false ;
+	$not_modid = $GLOBALS["xoopsModule"]->getVar('mid') ;
+
+	$comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
+	$notification_handler =& xoops_gethandler( 'notification' ) ;
+	$notification_handler->triggerEvent( 'global' , 0 , 'comment' , $comment_tags , false , $not_modid ) ;
+	$notification_handler->triggerEvent( 'author' , $post_author , 'comment' , $comment_tags , false , $not_modid ) ;
+	$notification_handler->triggerEvent( 'post' , $comment_post_ID , 'comment' , $comment_tags , false , $not_modid ) ;
+
+	// categorie notification
+	include(XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/wp-includes/version.php');
+	if ($wp_db_version < 6124){
+		$sql2 = "SELECT c.cat_ID, c.cat_name FROM ".$table_categories." c, ".$table_post2cat." p2c WHERE c.cat_ID = p2c.category_id AND p2c.post_id=".$comment_post_ID;
+	} else {
+		$sql2  = "SELECT $table_term_relationships.object_id, $table_terms.term_id AS cat_ID, $table_terms.name AS cat_name ";
+		$sql2 .= "FROM $table_term_relationships INNER JOIN ($table_term_taxonomy INNER JOIN $table_terms ON $table_term_taxonomy.term_id = $table_terms.term_id) ON $table_term_relationships.term_taxonomy_id = $table_term_taxonomy.term_taxonomy_id ";
+		$sql2 .= "WHERE ($table_term_relationships.object_id =" . $comment_post_ID.") AND ($table_term_taxonomy.taxonomy='category')";		
+	}
+	$res2 = $db->query($sql2);
+	while($row2 = $db->fetchArray($res2)){
+		$cat_id = $row2['cat_ID'];
+		$cat_name = $row2['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_handler->triggerEvent( 'category' , $cat_id , 'comment' , $comment_tags , false , $not_modid ) ;
+	}
+}
+
+function do_PostNotifications($post_id,$not_event)
+{
+	 // $not_event:		newpost,editpost ; $commentID, $comment_post_ID)
+	 
+	$xpress_prefix = $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+	if ($xpress_prefix == 'wordpress') $xpress_prefix = 'wp';
+	$db =& Database::getInstance() ;
+	$myts =& MyTextsanitizer::getInstance() ;
+
+	$table_term_relationships = $db->prefix($xpress_prefix."_term_relationships");
+	$table_term_taxonomy = $db->prefix($xpress_prefix."_term_taxonomy");
+	$table_terms = $db->prefix($xpress_prefix."_terms");
+	$table_categories = $db->prefix($xpress_prefix."_categories");
+	$wp_post = $db->prefix($xpress_prefix."_posts");
+	$wp_options = $db->prefix($xpress_prefix."_options");
+	$wp_users  = $db->prefix($xpress_prefix."_users");
+	$wp_comments  = $db->prefix($xpress_prefix."_comments");
+
+	$post_title = get_the_title($post_id);
+	$post_url = get_permalink($post_id). '#comment';
+	$blog_name = get_bloginfo('name');
+
+	// query
+	$sql = "SELECT * FROM ".$wp_post." WHERE ID=$post_id ";
+	$post_row = $db->fetchArray( $db->query( $sql ) ) ;
+	if( empty( $post_row ) ) return false;
+	//			$post_title = $post_row['post_title'];
+	$post_author = $post_row['post_author'];
+
+	$sql = "SELECT display_name  FROM $wp_users WHERE ID ='$post_author'";
+	$blog_row = $db->fetchArray( $db->query( $sql ) ) ;
+	if( empty( $blog_row ) ) return false;
+	$user_name = $blog_row['display_name'];
+
+	require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ;
+	// non-module integration returns false quickly
+	
+	if( ! is_object($GLOBALS["xoopsModule"]) ) return false ;
+	$not_modid = $GLOBALS["xoopsModule"]->getVar('mid') ;
+
+	$posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ;
+
+	$notification_handler =& xoops_gethandler( 'notification' ) ;	
+	switch ($not_event) {
+		case 'newpost' :
+			$notification_handler->triggerEvent( 'global' , 0 , 'newpost' , $posts_tags , false , $not_modid ) ;
+			$notification_handler->triggerEvent( 'author' , $post_author , 'newpost' , $posts_tags , false , $not_modid ) ;
+
+			// categorie notification
+			include(XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/wp-includes/version.php');
+			if ($wp_db_version < 6124){
+				$sql2 = "SELECT c.cat_ID, c.cat_name FROM ".$table_categories." c, ".$table_post2cat." p2c WHERE c.cat_ID = p2c.category_id AND p2c.post_id=".$post_id;
+			} else {
+				$sql2  = "SELECT $table_term_relationships.object_id, $table_terms.term_id AS cat_ID, $table_terms.name AS cat_name ";
+				$sql2 .= "FROM $table_term_relationships INNER JOIN ($table_term_taxonomy INNER JOIN $table_terms ON $table_term_taxonomy.term_id = $table_terms.term_id) ON $table_term_relationships.term_taxonomy_id = $table_term_taxonomy.term_taxonomy_id ";
+				$sql2 .= "WHERE ($table_term_relationships.object_id =" . $post_id.") AND ($table_term_taxonomy.taxonomy='category')";		
+			}
+			$res2 = $db->query($sql2);
+			while($row2 = $db->fetchArray($res2)){
+				$cat_id = $row2['cat_ID'];
+				$cat_name = $row2['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_handler->triggerEvent( 'category' , $cat_id , 'newpost' , $posts_tags , false , $not_modid ) ;
+			}
+			break;
+		case 'editpost' :
+			$notification_handler->triggerEvent( 'post' , $post_id , 'editpost' , $posts_tags , false , $not_modid ) ;
+			break;
+		default :
+	}
+}		
+
+
+
+	
+?>
Index: trunk/include/xpress_render.php
===================================================================
--- trunk/include/xpress_render.php	(revision 60)
+++ trunk/include/xpress_render.php	(revision 61)
@@ -101,5 +101,5 @@
 	$xoopsTpl->assign('xoops_pagetitle', $page_title);
 	$xoopsTpl->assign('xpress_body_contents', get_body($contents));
- 	echo get_body($contents);
+	echo get_body($contents);
 }
 
