<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.5 www.bcoos.net 2006-08 GPL 
//v1.4 www.exoops.info 2006/03 GPL
// $Id: system_user.php,v 1.3 2003/03/19 07:04:21 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_system_user_show() {
global $db, $xoopsUser,$bcoosConfig;
if (!$xoopsUser) {
	return FALSE;
}
$block             = array();
$block['title']    = sprintf(_MB_SYSTEM_MENU4, $xoopsUser->uname());
$block['content']  = "<img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."menu_pointer.gif' border='0'>";
$block['content'] .= "&nbsp;<a href='".XOOPS_URL."/user.php'>"._VIEWACCOUNT."</a><br />";
$block['content'] .= "<img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."menu_pointer.gif' border='0'>";
$block['content'] .= "&nbsp;<a href='".XOOPS_URL."/user.php?op=logout'>"._LOGOUT."</a><br /><br />";
list($total_messages) = $db->fetchRow($db->query("SELECT COUNT(*) FROM ".$db->prefix("priv_msgs")." WHERE to_userid = ".$xoopsUser->getVar("uid").""));
list($new_messages)   = $db->fetchRow($db->query("SELECT COUNT(*) FROM ".$db->prefix("priv_msgs")." WHERE to_userid = ".$xoopsUser->getVar("uid")." AND read_msg=0"));
if ($total_messages > 0) {
	if ($new_messages > 0) {
		$block['content'] .= $new_messages.": <a id='msgtxt' href='".XOOPS_URL."/viewpmsg.php' onmouseover='setBlink(0);' onmouseout='setBlink(1);'><b>"._NEWMESSAGES."</b></a><br />";
		if ( !defined('EXOOPS_PM_INCLUDED') ) {
			$block['content'] .= "";
		}
		$block['content'] .= '
					<script type="text/javascript">
					<!--
					var blink    = 1;
					var blinkdom = xoopsGetElementById("msgtxt");
					function blink1() {
					blinkdom.style.visibility = "hidden";
					if (blink == 1) {
						setTimeout("blink2()", 500);
						} else {
							blinkdom.style.visibility = "visible";
						}
					}
					function blink2() {
					blinkdom.style.visibility = "visible";
					if (blink == 1) {
						setTimeout("blink1()", 1000);
					}
					}
					function setBlink(val) {
					blink = val;
					blink1();
					}
					setBlink(1);
					//-->
					</script>';
		} else {
			$block['content'] .= _NOMESSAGES." <br /> ";
		}
	$block['content'] .= $total_messages.": <a href='".XOOPS_URL."/viewpmsg.php'>"._TOTALMESSAGES."</a>";
	} else {
		$block['content'] .= "<a href='".XOOPS_URL."/viewpmsg.php'>"._NOMESSAGES."</a>";
	}
if ($xoopsUser->isAdmin()) {
	$block['content'] .= "<br /><br /><img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."menu_pointer.gif' border='0'>";
	$block['content'] .= "&nbsp;<a href='".XOOPS_URL."/admin.php'>"._MB_SYSTEM_ADMENU."</a>";
}
return $block;
}
//---------------------------------------------------------------------------------------//
?>
