[xoops-cvslog 6559] CVS update: xoops2jp/html/modules/system/blocks

Back to archive index

NobuNobu nobun****@users*****
2007年 4月 30日 (月) 16:34:52 JST


Index: xoops2jp/html/modules/system/blocks/system_blocks.php
diff -u xoops2jp/html/modules/system/blocks/system_blocks.php:1.8 xoops2jp/html/modules/system/blocks/system_blocks.php:1.8.8.1
--- xoops2jp/html/modules/system/blocks/system_blocks.php:1.8	Mon May  1 11:37:30 2006
+++ xoops2jp/html/modules/system/blocks/system_blocks.php	Mon Apr 30 16:34:52 2007
@@ -1,5 +1,5 @@
 <?php
-// $Id: system_blocks.php,v 1.8 2006/05/01 02:37:30 onokazu Exp $
+// $Id: system_blocks.php,v 1.8.8.1 2007/04/30 07:34:52 nobunobu Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -46,9 +46,14 @@
         $uname = '';
     }
     if (is_object($xoopsModule)) {
-        $online_handler->write($uid, $uname, time(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
+        $online_handler->write($uid, $uname, time(), $xoopsModule->get('mid'), $_SERVER['REMOTE_ADDR']);
     } else {
-        $online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
+		//
+		// TODO We have to find the best method.
+		//
+		if (strpos(xoops_getenv('REQUEST_URI'),'misc.php') === false) {
+			$online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
+		}
     }
     $onlines =& $online_handler->getAll();
     if (false != $onlines) {
@@ -148,15 +153,26 @@
     if (is_object($xoopsUser)) {
         $pm_handler =& xoops_gethandler('privmessage');
         $block = array();
+        
         $block['lang_youraccount'] = _MB_SYSTEM_VACNT;
         $block['lang_editaccount'] = _MB_SYSTEM_EACNT;
         $block['lang_notifications'] = _MB_SYSTEM_NOTIF;
         $block['uid'] = $xoopsUser->getVar('uid');
         $block['lang_logout'] = _MB_SYSTEM_LOUT;
-        $criteria = new CriteriaCompo(new Criteria('read_msg', 0));
-        $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
-        $block['new_messages'] = $pm_handler->getCount($criteria);
-        $block['lang_inbox'] = _MB_SYSTEM_INBOX;
+
+		$block['flagShowInbox']=false;
+
+		// Check does this system have PrivateMessage feature.
+		$root=&XCube_Root::getSingleton();
+		$service=&$root->mServiceManager->searchXCubeService("PrivateMessage");
+		if($service) {
+			$client=new XCube_ServiceClient($service);
+			$parameters=array("uid"=>$xoopsUser->getVar('uid'));
+			$block['new_messages'] = $client->call("getCountUnread",$parameters);
+			$block['lang_inbox'] = _MB_SYSTEM_INBOX;
+			$block['flagShowInbox']=true;
+		}
+
         $block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;
         return $block;
     }
@@ -344,7 +360,7 @@
         }
         $com['id'] = $i;
         $com['title'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/'.$comment_config[$mid]['pageName'].'?'.$comment_config[$mid]['itemName'].'='.$comments[$i]->getVar('com_itemid').'&amp;com_id='.$i.'&amp;com_rootid='.$comments[$i]->getVar('com_rootid').'&amp;'.htmlspecialchars($comments[$i]->getVar('com_exparams')).'#comment'.$i.'">'.$comments[$i]->getVar('com_title').'</a>';
-        $com['icon'] = htmlspecialchars($comments[$i]->getVar('com_icon'), ENT_QUOTES);
+        $com['icon'] = $comments[$i]->getVar('com_icon');
         $com['icon'] = ($com['icon'] != '') ? $com['icon'] : 'icon1.gif';
         $com['time'] = formatTimestamp($comments[$i]->getVar('com_created'),'m');
         if ($comments[$i]->getVar('com_uid') > 0) {


xoops-cvslog メーリングリストの案内
Back to archive index