<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
//位置
$url="$spacename &gt; 留言";
$pagetitle='的个人留言本';
include("header.temp.php");
$viewuid=(int)getcvar('mluserid');
$adminmenu='';
if($viewuid==$userid)
{
	$adminmenu="<a href='../member/mspace/gbook.php' target='_blank'>管理留言</a>";
}
$lynum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsmembergbook where userid='$userid'");
?>
<div id="space_warp" class="space_feedback_warp">
        <div class="space_feedback_bg">
          <div class="space_feedback_content">
            <div class="content">
            	<h2 class="bread_title"><span>历史留言(<em><?=$lynum?></em>)</span></h2>
                <dl class="form">
                	<dt>留言内容:</dt>
                    <dd>
                    	<textarea id="guestbook_content">请文明发言</textarea>
                        <div class="btn"><a href="javascript:;" data-mid="<?=$userid?>" id="guestbook_btn"></a></div>
                    </dd>
                </dl>
                <div class="feedback_content">
                	                
                    <?php
	while($r=$empire->fetch($sql))
	{
		if($r['uid'])
		{
			$r['uname']="<a href='../space/?userid=$r[uid]' target='_blank'>$r[uname]</a>";
			
			$addr=$empire->fetch1("select userpic from ".eReturnMemberTable()."add where ".egetmf('userid')."='$r[uid]' limit 1");
			$userpic=$addr[userpic]?$addr[userpic]:'/e/data/images/nouserpic.gif';	
			$userpic="<b><a href='../space/?userid=$r[uid]' target='_blank'><img src='".$userpic."' /></a></b>";
		}
		//管理菜单
		$adminlink='';
		$ip='';
		if($adminmenu)
		{
			$ip=' IP: '.$r[ip];
			$adminlink="[<a href='#ecms' onclick=\"window.open('../member/mspace/ReGbook.php?gid=$r[gid]','','width=600,height=380,scrollbars=yes');\">回复</a>]&nbsp;&nbsp;[<a href='../member/mspace/?enews=DelMemberGbook&gid=$r[gid]' onclick=\"return confirm('确认要删除?');\">删除</a>]";
		}
		$gbuname=$r[uname]." 留言于".$r[addtime].$ip;
		//私密
		if($r['isprivate'])
		{
			if($adminmenu||($r[uid]&&$viewuid==$r[uid]))
			{
				$r['gbtext']="<font color='blue'>[悄悄话] ".$r['gbtext']."</font>";
			}
			else
			{
				$r['gbtext']='[悄悄话隐藏]';
			}
		}
	?>
    <dl>
  <dt>
    <div class="head"><?=$userpic?></div>
    <div class="name"><?=$r['uname']?></div>
  </dt>
  <dd>
    <div class="fb">
      <div class="fm">
        <div class="fc">
          <p class="c"> <?=nl2br($r['gbtext'])?></p>
          <span class="d"><?=$r[addtime]?></span>
          <?
			if($r['retext'])
			{
			?>
            <div class="reply">
            <div class="reply_tip"></div>
            <div class="reply_content">
              <p><?=nl2br($r['retext'])?></p>
            </div>
          </div>
			<?
			}
			?>
        </div>
      </div>
    </div>
  </dd>
</dl>


	<?php
	}
	?>
    
    
                                    </div>
            </div>
          </div>
        </div>
      </div>
      <!--主要部分结束-->
<script>
$(function(){
	//滚动条
	$(".feedback_content").jscroll({
	   W:"11px"
	  ,Bg:"top center repeat-y"
	  ,Bar:{Pos:"up"
			,Bg:{Out:"-45px 0 repeat-y",Hover:"-58px 0 repeat-y",Focus:"-71px 0 repeat-y"}}
			,Btn:{btn:true
				  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
				  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
	  ,Fn:function(){}
	 });
});
</script>
</div>
<?php
include("footer.temp.php");
?>
