Index: trunk/admin/index.php
===================================================================
--- trunk/admin/index.php	(revision 61)
+++ trunk/admin/index.php	(revision 61)
@@ -0,0 +1,36 @@
+<?php 
+// $Id: xoops_version.php,v 1.8 2005/06/03 01:35:02 phppp Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program is free software; you can redistribute it and/or modify     //
+//  it under the terms of the GNU General Public License as published by     //
+//  the Free Software Foundation; either version 2 of the License, or        //
+//  (at your option) any later version.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  This program is distributed in the hope that it will be useful,          //
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
+//  GNU General Public License for more details.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: phppp (D.J.)                                                      //
+// URL: http://xoopsforge.com, http://xoops.org.cn                           //
+// ------------------------------------------------------------------------- //
+//include_once 'cp_functions.php';
+include_once('./../../../include/cp_header.php');
+xoops_cp_header();
+echo '<p>Yet Not Make XPressME index Page.</p>';
+xoops_cp_footer();
+	
+?>
Index: trunk/admin/menu.php
===================================================================
--- trunk/admin/menu.php	(revision 61)
+++ trunk/admin/menu.php	(revision 61)
@@ -0,0 +1,32 @@
+<?php 
+// $Id: xoops_version.php,v 1.8 2005/06/03 01:35:02 phppp Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program is free software; you can redistribute it and/or modify     //
+//  it under the terms of the GNU General Public License as published by     //
+//  the Free Software Foundation; either version 2 of the License, or        //
+//  (at your option) any later version.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  This program is distributed in the hope that it will be useful,          //
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
+//  GNU General Public License for more details.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: toemon                                                      //
+// URL: http://www.toemon.com                       //
+// ------------------------------------------------------------------------- //
+
+
+?>
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);
 }
 
Index: trunk/language/ja_utf8/mail_template/author_newcomment.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/author_newcomment.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/author_newcomment.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+投稿者[{XPRESS_AUTH_NAME}]さんの記事[{XPRESS_POST_TITLE}]に新しいコメントの投稿があります。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/author_newpost.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/author_newpost.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/author_newpost.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+投稿者[{XPRESS_AUTH_NAME}]さんの記事[{XPRESS_POST_TITLE}]の投稿があります。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/category_newcomment.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/category_newcomment.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/category_newcomment.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+カテゴリー[{XPRESS_CAT_TITLE}]内にある記事[{XPRESS_POST_TITLE}]に新しいコメントの投稿があります。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/category_newpost.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/category_newpost.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/category_newpost.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+カテゴリー[{XPRESS_CAT_TITLE}]に記事"{XPRESS_POST_TITLE}"の投稿があります。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/global_newcomment.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/global_newcomment.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/global_newcomment.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+{X_MODULE}モジュールにおいて記事「{XPRESS_POST_TITLE}」にコメントの投稿がありました。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/global_newpost.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/global_newpost.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/global_newpost.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+{X_MODULE}モジュールにおいて新規投稿「{XPRESS_POST_TITLE}」がありました。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/mail_template/global_waiting.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/global_waiting.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/global_waiting.tpl	(revision 61)
@@ -0,0 +1,3 @@
+{X_UNAME}さん、こんにちは
+
+{X_MODULE}モジュールにおいて要承認の投稿がありました。
Index: trunk/language/ja_utf8/mail_template/post_editpost.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/post_editpost.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/post_editpost.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+{X_SITENAME}{X_MODULE}の
+「{POST_TITLE}」にて記事内容の変更が行われています。
+
+この記事を見るには下記URLにアクセスしてください：
+{POST_URL}
Index: trunk/language/ja_utf8/mail_template/post_newcomment.tpl
===================================================================
--- trunk/language/ja_utf8/mail_template/post_newcomment.tpl	(revision 61)
+++ trunk/language/ja_utf8/mail_template/post_newcomment.tpl	(revision 61)
@@ -0,0 +1,6 @@
+{X_UNAME}さん、こんにちは
+
+指定された記事[{XPRESS_POST_TITLE}]に新しいコメントの投稿があります。
+
+この投稿を見るには下記URLにアクセスしてください：
+{XPRESS_POST_URL}
Index: trunk/language/ja_utf8/modinfo.php
===================================================================
--- trunk/language/ja_utf8/modinfo.php	(revision 60)
+++ trunk/language/ja_utf8/modinfo.php	(revision 61)
@@ -16,4 +16,52 @@
 	define("_MI_XPRESS_BLOCK_COMMENTS","最近のコメント");
 	define("_MI_XPRESS_BLOCK_CONTENT","最近の記事内容");
+	
+	// Notify Categories
+	define('_MI_XPRESS_NOTCAT_GLOBAL', 'ブログ全体');
+	define('_MI_XPRESS_NOTCAT_GLOBALDSC', 'ブログ全体における通知オプション');
+	define('_MI_XPRESS_NOTCAT_CAT', '選択中のカテゴリ');
+	define('_MI_XPRESS_NOTCAT_CATDSC', '選択中のカテゴリに対する通知オプション');
+	define('_MI_XPRESS_NOTCAT_AUTHOR', '選択中の投稿者'); 
+	define('_MI_XPRESS_NOTCAT_AUTHORDSC', '選択中の投稿者に対する通知オプション');
+	define('_MI_XPRESS_NOTCAT_POST', '表示中の記事'); 
+	define('_MI_XPRESS_NOTCAT_POSTDSC', '表示中の記事に対する通知オプション');
+
+	// Each Notifications
+	define('_MI_XPRESS_NOTIFY_GLOBAL_WAITING', '承認待ち');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP', '承認を要する投稿・編集が行われた場合に通知します。管理者専用');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGSBJ', '[{X_SITENAME}] {X_MODULE}: 承認待ち');
+
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOST', '記事投稿');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP', 'このブログ全体のいずれかに記事の投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTSBJ', '[{XPRESS_BLOG_NAME}]記事: "{XPRESS_POST_TITLE}"');
+
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENT', 'コメント投稿');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP', 'このブログ全体のいずれかにコメントの投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTSBJ', '[{XPRESS_BLOG_NAME}]コメント: "{XPRESS_POST_TITLE}"');
+
+	define('_MI_XPRESS_NOTIFY_CAT_NEWPOST', '選択カテゴリへの記事投稿');
+	define('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP', 'このカテゴリに記事投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_CAT_NEWPOSTSBJ', '[{XPRESS_BLOG_NAME}]記事: "{XPRESS_POST_TITLE}" (条件:カテゴリ="{XPRESS_CAT_TITLE}")');
+
+	define('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENT', '選択カテゴリへのコメント投稿');
+	define('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP', 'このカテゴリにコメント投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTSBJ', '[{XPRESS_BLOG_NAME}]コメント: (記事"{XPRESS_POST_TITLE}") (条件:カテゴリ="{XPRESS_CAT_TITLE}")');
+
+	define('_MI_XPRESS_NOTIFY_AUT_NEWPOST', '選択投稿者による記事投稿');
+	define('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP', 'この投稿者から記事投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_AUT_NEWPOSTSBJ', '[{XPRESS_BLOG_NAME}]記事: "{XPRESS_POST_TITLE}" (条件:投稿者="{XPRESS_AUTH_NAME}")');
+
+	define('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENT', '選択投稿者記事へのコメント投稿');
+	define('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP', 'この投稿者による記事へコメント投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTSBJ', '[{XPRESS_BLOG_NAME}]コメント: (記事"{XPRESS_POST_TITLE}") (条件:投稿者="{XPRESS_AUTH_NAME}")');
+
+	define('_MI_XPRESS_NOTIFY_POST_EDITPOST', '記事変更');
+	define('_MI_XPRESS_NOTIFY_POST_EDITPOSTCAP', '表示中の記事に変更があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_POST_EDITPOSTSBJ', '[{XPRESS_BLOG_NAME}]記事: "{XPRESS_POST_TITLE}"変更 (条件:記事指定)');
+
+	define('_MI_XPRESS_NOTIFY_POST_NEWCOMMENT', '記事へのコメント投稿');
+	define('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP', '表示中の記事にコメントの投稿があった場合に通知する');
+	define('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTSBJ', '[{XPRESS_BLOG_NAME}]コメント: (記事"{XPRESS_POST_TITLE}") (条件:記事指定)');
+
 }
 ?>
Index: trunk/notification_update.php
===================================================================
--- trunk/notification_update.php	(revision 61)
+++ trunk/notification_update.php	(revision 61)
@@ -0,0 +1,4 @@
+<?php
+include '../../mainfile.php';
+require_once XOOPS_ROOT_PATH.'/include/notification_update.php';
+?>
Index: trunk/templates/index.html
===================================================================
--- trunk/templates/index.html	(revision 61)
+++ trunk/templates/index.html	(revision 61)
@@ -0,0 +1,3 @@
+<{$xpress_body_contents}>
+
+<{include file='db:system_notification_select.html'}>
Index: trunk/wp-content/plugins/xpressme/include/notify_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/notify_functions.php	(revision 61)
+++ trunk/wp-content/plugins/xpressme/include/notify_functions.php	(revision 61)
@@ -0,0 +1,40 @@
+<?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);
+	}
+}
+
+?>
Index: trunk/wp-content/plugins/xpressme/xpressme.php
===================================================================
--- trunk/wp-content/plugins/xpressme/xpressme.php	(revision 60)
+++ trunk/wp-content/plugins/xpressme/xpressme.php	(revision 61)
@@ -37,4 +37,13 @@
 add_action("the_content",	"set_post_views_count");
 
+//XOOPS notifiction
+require_once dirname( __FILE__ ).'/include/notify_functions.php' ;
+add_action("private_to_published",	"onaction_publish_post_notify");
+//	add_action("edit_post",	"onaction_edit_post_notify");
+add_action("comment_post",	"onaction_comment_notify");
+//	add_action("approve_comment" , "onaction_comment_apobe_notify");
+add_action("wp_set_comment_status" , "onaction_comment_apobe_notify");
+
+
 
 //require_once('../include/custom_functions.php');
Index: trunk/wp-content/themes/xpress_default/blocks/style.css
===================================================================
--- trunk/wp-content/themes/xpress_default/blocks/style.css	(revision 60)
+++ trunk/wp-content/themes/xpress_default/blocks/style.css	(revision 61)
@@ -7,5 +7,4 @@
 Author URI: http://xoops-fan.com/
 Tags: XPressME,XPressEUC,KURO
-R~bgeXgo[W
 
 */
Index: trunk/xoops_version.php
===================================================================
--- trunk/xoops_version.php	(revision 60)
+++ trunk/xoops_version.php	(revision 61)
@@ -75,7 +75,7 @@
 $modversion['search']['func'] = $mydirname.'_global_search' ;
 //Admin things
-$modversion['hasAdmin'] = 0;
-//$modversion['adminindex'] = "admin/index.php";
-//$modversion['adminmenu'] = "admin/menu.php";
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
 
 $modversion['hasMain'] = 1;
@@ -88,5 +88,5 @@
 
 // Use smarty
-//$modversion["use_smarty"] = 1;
+$modversion["use_smarty"] = 1;
 
 /**
@@ -96,5 +96,5 @@
 $modversion['templates'] = array() ;
 
-$modversion['hasconfig'] = 0;
+$modversion['hasconfig'] = 1;
 
 //BLOCKS
@@ -121,3 +121,122 @@
 	'func_num'		=> 2,
 );
+
+// Notification
+$modversion['hasNotification'] = 1;
+$modversion['notification'] = array(
+	'lookup_file' => 'include/notification.inc.php' ,
+	'lookup_func' => "{$mydirname}_notify_info" ,
+	'category' => array(
+		array(
+			'name' => 'global' ,
+			'title' => constant('_MI_XPRESS_NOTCAT_GLOBAL') ,
+			'description' => constant('_MI_XPRESS_NOTCAT_GLOBALDSC') ,
+			'subscribe_from' => 'index.php' ,
+		) ,
+		array(
+			'name' => 'category' ,
+			'title' => constant('_MI_XPRESS_NOTCAT_CAT') ,
+			'description' => constant('_MI_XPRESS_NOTCAT_CATDSC') ,
+			'subscribe_from' => 'index.php' ,
+			'item_name' => 'cat' ,
+			'allow_bookmark' => 1 ,
+		) ,
+		array(
+			'name' => 'author' ,
+			'title' => constant('_MI_XPRESS_NOTCAT_AUTHOR') ,
+			'description' => constant('_MI_XPRESS_NOTCAT_AUTHORDSC') ,
+			'subscribe_from' => 'index.php' ,
+			'item_name' => 'author' ,
+			'allow_bookmark' => 1 ,
+		) ,
+		array(
+			'name' => 'post' ,
+			'title' => constant('_MI_XPRESS_NOTCAT_POST') ,
+			'description' => constant('_MI_XPRESS_NOTCAT_POSTDSC') ,
+			'subscribe_from' => 'index.php' ,
+			'item_name' => 'p' ,
+			'allow_bookmark' => 1 ,
+		) ,
+	) ,
+	'event' => array(
+		array(
+			'name' => 'waiting' ,
+			'category' => 'global' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITING') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') ,
+			'mail_template' => 'global_waiting' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGSBJ') ,
+			'admin_only' => 1 ,
+		) ,
+		array(
+			'name' => 'newpost' ,
+			'category' => 'global' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOST') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') ,
+			'mail_template' => 'global_newpost' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTSBJ') ,
+		) ,
+		array(
+			'name' => 'comment' ,
+			'category' => 'global' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENT') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') ,
+			'mail_template' => 'global_newcomment' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTSBJ') ,
+		) ,
+		
+		array(
+			'name' => 'newpost' ,
+			'category' => 'category' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOST') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') ,
+			'mail_template' => 'category_newpost' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTSBJ') ,
+		) ,
+		array(
+			'name' => 'comment' ,
+			'category' => 'category' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENT') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') ,
+			'mail_template' => 'category_newcomment' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTSBJ') ,
+		) ,
+
+		array(
+			'name' => 'newpost' ,
+			'category' => 'author' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOST') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') ,
+			'mail_template' => 'author_newpost' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTSBJ') ,
+		) ,
+		array(
+			'name' => 'comment' ,
+			'category' => 'author' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENT') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') ,
+			'mail_template' => 'author_newcomment' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTSBJ') ,
+		) ,
+
+		array(
+			'name' => 'comment' ,
+			'category' => 'post' ,
+			'title' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENT') ,
+			'caption' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') ,
+			'description' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') ,
+			'mail_template' => 'post_newcomment' ,
+			'mail_subject' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTSBJ') ,
+		) ,
+	) ,
+) ;
+
+
 ?>
