<?php
//未登錄顯示的head
if(!$cfg_ml->IsLogin()) {
?>
<div id="header">
	<div id="siteNav">
    <div class="innerWrap">
      <div id="loginInfo">
      <script type="text/javascript">
           	var now=(new Date()).getHours();
			if(now>0&&now<=6){
				document.write("午夜好，");
			}else if(now>6&&now<=11){
				document.write("早上好，");
			}else if(now>11&&now<=14){
				document.write("中午好，");
			}else if(now>14&&now<=18){
				document.write("下午好，");
			}else{
				document.write("晚上好，");
			}
			</script>
       遊客
       </div>
      <ul id="quickMenu">
        <li><a title="網站主頁" href="../">網站主頁</a> </li>
        <li><a title="註冊" href="../member/index_do.php?fmdo=user&dopost=regnew">註冊</a> </li>
        <li><a title="登錄" href="../member/login.php">登錄</a> </li>
        <li class="help"> <a title="DEDECMS 幫助中心" href="http://help.dedecms.com" target="_blank">幫助</a> </li>
      </ul>
    </div>
  </div>
</div>
<?php
}
//登錄後顯示的head
else {
?>
<div id="header">
  <div id="siteNav">
    <div class="innerWrap">
      <div id="loginInfo">
      <script type="text/javascript">
           	var now=(new Date()).getHours();
			if(now>0&&now<=6){
				document.write("午夜好，");
			}else if(now>6&&now<=11){
				document.write("早上好，");
			}else if(now>11&&now<=14){
				document.write("中午好，");
			}else if(now>14&&now<=18){
				document.write("下午好，");
			}else{
				document.write("晚上好，");
			}
			</script>
       <a href="#" class="userName"><?php echo $cfg_ml->M_UserName?></a> <a href="../member/index_do.php?fmdo=login&dopost=exit#">[退出]</a> 
       <?php
       $pms = $dsql->GetOne("SELECT COUNT(*) AS nums FROM #@__member_pms WHERE toid='{$cfg_ml->M_ID}' AND `hasview`=0 AND folder = 'inbox'");
		if($pms['nums'] > 0)
		{
			echo "<a href='/member/pm.php' target='_blank'>短消息 [<font color='#FF0000'>{$pms['nums']}</font>]</a>";
		}
		elseif($pms['nums']==0)
		{
			echo "<a href='/member/pm.php' target='_blank'>短消息</a>";
		}
       ?>
       </div>
      <ul id="quickMenu">
        <li class="home"><a href="../" title="會員中心首頁">主頁</a></li>
        <li><a href="#">內容中心</a></li>
        <li><a href="<?php echo $myurl; ?>" title="會員空間">會員空間</a></li>
        <li><a href="../member/mystow.php" title="收藏夾">收藏夾</a></li>
        <li class="help"><a href="http://help.dedecms.com" title="DEDECMS 幫助中心">幫助</a></li>
      </ul>
    </div>
  </div>
  <!--頂部導航 -->
  <div id="topPic"> <a href="../member/"><img alt="會員中心" src="../member/templets/images/m_logo.gif" class="topLogo"/></a> </div>
  <div id="topNav">
    <ul id="appIterm">
      <li <?php echo ($menutype == 'content')? 'class="thisApp"' : "" ;?>><a href="../member/content_list.php?channelid=1">內容中心</a></li>
      <li <?php echo ($menutype == 'mydede')? 'class="thisApp"' : "" ;?>><a href="../member/" title="我的織夢">我的織夢</a></li>
      <li <?php echo ($menutype == 'config')? 'class="thisApp"' : "" ;?>><a href="../member/edit_space_info.php" title="系統設置">系統設置</a></li>
    </ul>
    <!--程序導航列表 -->
    <div id="channel">
      <ul>
        <li><a href="<?php echo $myurl; ?>" title="個人空間" target="_blank"><span>個人空間</span></a></li>
        <li <?php echo ($menutype_son == 'mf')? 'class="thisApp"' : "" ;?>><a href="../member/myfriend.php" title="我的好友"><span>我的好友</span></a></li>
        <li <?php echo ($menutype_son == 'pm')? 'class="thisApp"' : "" ;?>><a href="../member/pm.php" title="短消息"><span>短消息</span></a></li>
        <li <?php echo ($menutype_son == 'gu')? 'class="thisApp"' : "" ;?>><a href="../member/guestbook_admin.php" title="留言板"><span>留言板</span></a></li>
        <li <?php echo ($menutype_son == 'op')? 'class="thisApp"' : "" ;?>><a href="../member/operation.php" title="消費中心"><span>消費中心</span></a></li>
        <li <?php echo ($menutype_son == 'cc')? 'class="thisApp"' : "" ;?>><a href="../member/caicai.php" title="隨便踩踩"><span>隨便踩踩</span></a></li>
      </ul>
    </div>
    <!--導航欄目項 -->
  </div>
</div>
<?php
}
?>
