Index: trunk/xpressme_integration_kit/class/xpressD3commentContent.class.php
===================================================================
--- trunk/xpressme_integration_kit/class/xpressD3commentContent.class.php	(revision 842)
+++ trunk/xpressme_integration_kit/class/xpressD3commentContent.class.php	(revision 860)
@@ -9,8 +9,15 @@
 		{
 		//	include_once dirname(dirname(__FILE__)).'/include/common_functions.php' ;
-			global $forum_id;
-			
+			if ( empty( $this->forum_id ) ) {
+				global $forum_id;
+				if ( !empty( $forum_id ) ) {
+					$this->forum_id = $forum_id;
+				} else {
+					return parent::fetchSummary( $external_link_id );
+				}
+			}
+
 			$db =& XoopsDatabaseFactory::getDatabaseConnection() ;
-			$myts =& MyTextsanitizer::getInstance() ;
+			(method_exists('MyTextsanitizer', 'sGetInstance') && ($myts =& MyTextsanitizer::sGetInstance())) || ($myts =& MyTextsanitizer::getInstance()) ;
 
 			$module_handler =& xoops_gethandler( 'module' ) ;
@@ -24,5 +31,5 @@
 			
 			$xpress_prefix = preg_replace('/wordpress/','wp',$mydirname);
-			$blog_info = $this->get_comment_blog_info($forum_id);
+			$blog_info = $this->get_comment_blog_info($this->forum_id);
 			// query
 			$post_row = $db->fetchArray( $db->query( "SELECT * FROM ".$blog_info['mb_table_prefix']."posts WHERE ID=$post_id" ) ) ;
@@ -68,6 +75,14 @@
 		function canAddComment($external_link_id)
 		{
-			global $forum_id;
 			global $post;
+
+			if ( empty( $this->forum_id ) ) {
+				global $forum_id;
+				if ( !empty( $forum_id ) ) {
+					$this->forum_id = $forum_id;
+				} else {
+					return false;
+				}
+			}
 			
 			if (is_object($post)){  // in wordpress 
@@ -92,5 +107,5 @@
 					if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ;
 					
-					$blog_info = $this->get_comment_blog_info($forum_id);
+					$blog_info = $this->get_comment_blog_info($this->forum_id);
 					$xpress_prefix = preg_replace('/wordpress/','wp',$mydirname);
 
@@ -176,9 +191,16 @@
 		function validate_id( $link_id )
 		{
-			global $forum_id;
+			if ( empty( $this->forum_id ) ) {
+				global $forum_id;
+				if ( !empty( $forum_id ) ) {
+					$this->forum_id = $forum_id;
+				} else {
+					return false;
+				}
+			}
 			$post_id = intval( $link_id ) ;
 			$mydirname = $this->mydirname ;
 			$xpress_prefix = preg_replace('/wordpress/','wp',$mydirname);
-			$blog_info = $this->get_comment_blog_info($forum_id);		
+			$blog_info = $this->get_comment_blog_info($this->forum_id);
 			$db =& XoopsDatabaseFactory::getDatabaseConnection() ;
 			
