<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)">
<title>心情日记本·分享你我的心情</title>
<meta name="keywords" content="心情日记本·分享你我的心情">
<link href="/templets/default/diary/css.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="<?php echo $GLOBALS['cfg_cmsurl']; ?>/include/dedeajax2.js"></script>
<script language="javascript">
function postBadGood(ftype,fid)
{
	var taget_obj = document.getElementById(ftype+fid);
	var saveid = GetCookie('badgoodid');
	if(saveid != null)
	{
		 var saveids = saveid.split(',');
		 var hasid = false;
		 saveid = '';
		 j = 1;
		 for(i=saveids.length-1;i>=0;i--)
		 {
		 	  if(saveids[i]==fid && hasid) continue;
		 	  else {
		 	  	if(saveids[i]==fid && !hasid) hasid = true;
		 	  	saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
		 	  	j++;
		 	  	if(j==10 && hasid) break;
		 	  	if(j==9 && !hasid) break;
		 	  }
		 }
     if(hasid) { alert('您刚才已表决过了喔！'); return false; }
     else saveid += ','+fid;
		 SetCookie('badgoodid',saveid,1);
	}
	else
	{
		SetCookie('badgoodid',fid,1);
	}
	//document.write("feedback.php?action="+ftype+"&fid="+fid);
	//return;
  myajax = new DedeAjax(taget_obj,false,false,'','','');
  myajax.SendGet2("feedback.php?aid=<?php echo $GLOBALS['aid']; ?>&action="+ftype+"&fid="+fid);
  DedeXHTTP = null;
}

function ajaxFeedback(aid, fid, type)
{
	
	var taget_obj = $DE('ajaxfeedback_'+fid);
	if(taget_obj.innerHTML == '')
	{
		var myajax = new DedeAjax(taget_obj, true, true, '', 'x');
		myajax.SendGet2("<?php echo $GLOBALS['cfg_phpurl']; ?>/feedback.php?aid="+aid+"&fid="+fid+"&action=quote&type=ajax");
		eval('var result = typeof CKEDITOR.instances.msg_'+fid);
		if(result != 'undefined')
		{
			// 删除实例
			eval('var edit = CKEDITOR.instances.msg_'+fid);
			CKEDITOR.remove(edit);
		}
		CKEDITOR.replace(document.getElementById('msg_'+fid) , CKEDITOR.instances.msg.config);
		scroll(0, taget_obj.offsetTop - 120);
		var formname = 'f = document.ajaxfeedback_'+fid;
		eval(formname);
		if(f.validate)
		{
			if($DE('vdimg_'+fid)) $DE('vdimg_'+fid).src = "<?php echo $GLOBALS['cfg_cmsurl']; ?>/include/vdimgck.php?"+f.validate.value;
			f.validate.value = '';
		}
		
		DedeXHTTP = null;
	}
}

function ajaxQuotePost(fid)
{
	var formname = 'f = document.ajaxfeedback_'+fid;
	eval(formname);
	//var f = document.formname;
	//var f = f[0];
	var nvalidate = '';
	var nnotuser = '';
	var nusername = '';
	var npwd = '';
	var taget_obj = $DE('commetcontentNew');
	var waithtml = "<div style='line-height:30px'><img src='<?php echo $GLOBALS['cfg_cmsurl']; ?>/images/loadinglit.gif' />正在发送中...</div>";
	eval('var msg = CKEDITOR.instances.msg_'+fid+'.getData()');

	if(f.validate)
	{
		if(f.validate.value=='') {
			alert("请填写验证码！");
			return;
		}
		else {
			nvalidate = f.validate.value;
		}
	}
	var myajax = new DedeAjax(taget_obj, false, true, '', '', waithtml);
	
	if(f.notuser.checked) nnotuser = '1';
	if(f.username) nusername = f.username.value;
	if(f.pwd) npwd = f.pwd.value;
	
	myajax.sendlang = '<?php echo $GLOBALS['cfg_soft_lang']; ?>';
	myajax.AddKeyN('dopost', 'send');
	myajax.AddKeyN('aid', '<?php echo $GLOBALS['aid']; ?>');
	myajax.AddKeyN('fid', f.fid.value);
	myajax.AddKeyN('type', 'ajax');
	myajax.AddKeyN('comtype', f.comtype.value);
	myajax.AddKeyN('isconfirm','yes');
	
	myajax.AddKeyN('typeid', f.typeid.value);
	myajax.AddKeyN('quotemsg', f.quotemsg.value);
	myajax.AddKeyN('validate', nvalidate);
	myajax.AddKeyN('notuser', nnotuser);
	myajax.AddKeyN('username', nusername);
	myajax.AddKeyN('pwd', npwd);
	myajax.AddKeyN('msg', msg);
	myajax.SendPost2('<?php echo $GLOBALS['cfg_phpurl']; ?>/feedback_ajax.php');
	//alert(f.quotemsg.value);
	if($DE('ajaxfeedback_'+fid).innerHTML != null)
	{
		$DE('ajaxfeedback_'+fid).innerHTML = '';
	}
	scroll(0, taget_obj.offsetTop);
	taget_obj.removeAttribute('id');

}
</script>
</head>
<body bgcolor="#FFFfff">             
<table class=td width="100%" border="0" cellpadding="2" cellspacing="0" height="100%" bgcolor="#FFFFFF" align="center">
<tr>
<td width="350" height="20">&nbsp;&nbsp;&nbsp;&nbsp;对此日记发表评论：</td><td width="100" height="20" align="center"><span id=qianxie style="display:block"><a href="#" target="_self" onClick="bookf.style.display='block';qianxie.style.display='none';qianxie1.style.display='block';">↓写评论</a></span>
<span id=qianxie1 style="display:none"><a href="#" target="_self" onClick="bookf.style.display='none';qianxie.style.display='block';qianxie1.style.display='none';">↑暂不写</a></span>
</td>
</tr>
<tr>
<td valign="top" height="*" colspan="2" align="center">
<table border="0" width="99%" cellspacing="0" cellpadding="0" bgcolor="#EBEBEB" align="center">
<?php
$atts = array();
$atts['tagname'] = 'datalist';
$blockValue = $this->refObj->GetArcList($atts,$this->refObj,$fields); 
if(is_array($blockValue)){
foreach( $blockValue as $key=>$fields )
{

  if($fields['userid']!='') $spaceurl = $cfg_basehost.'/member/index.php?uid='.$fields['userid'];
  else $spaceurl = "#";
  if($fields['username']=='匿名') $spaceurl = "#";
  $fields['bgimg'] = 'cmt-neu.gif';
  $fields['ftypetitle'] = '该用户表示中立';
  if($fields['ftype']=='bad') {
  	$fields['bgimg'] = 'cmt-bad.gif';
  	$fields['ftypetitle'] = '该用户表示差评';
  }
  else if($fields['ftype']=='good') {
  	$fields['bgimg'] = 'cmt-good.gif';
  	$fields['ftypetitle'] = '该用户表示好评';
  }
  if(empty($fields['mface']))
  {
    if($fields['sex']=="女") $fields['mface']="/member/templets/images/dfgirl.png";
    else $fields['mface']="/member/templets/images/dfboy.png";
  }
?> 　
<tr>
<td>&nbsp;<font color="#FF3300">网友</font><font color="#008080">评论:</font></td>
</tr>
<tr>
<td>  
<font color="#666666"><?php echo RemoveXSS(Quote_replace(parseSmileys($fields['msg'],$cfg_cmspath.'/images/smiley')));?></font>
</td>
</tr>
<tr><td>
<p align="right">　<a href="<?php echo $spaceurl; ?>" target="_blank"><?php echo $fields['userid']; ?></a>&nbsp;&nbsp;<font color="#008080">  <?php echo MyDate('Y-m-d H:i',$fields['dtime']); ?></font>&nbsp;&nbsp;</td></tr>
<?php
}
}?>
<tr><td bgcolor="#FFFFFF">
<?php
$atts = array();
$atts['tagname'] = 'pagelist';
$atts['listitem'] = 'info,index,end,pre,next,pageno';
$atts['listsize'] = '5';
 echo $this->refObj->GetPageList($atts,$this->refObj,$fields); 
?>

</td></tr>
</table>
</td></tr></table>
<div id="bookf" style="display:none;z-index:300;position:absolute;left:0px;top:20px;padding-left:20px"> 
<table border="0" width="400" cellspacing="0" cellpadding="0" bgcolor="#EBEBEB" height="200" align="center">
<form action="feedback.php" method="post" name="feedback">
<input type="hidden" name="action" value="send" />
<input type="hidden" name="comtype" value="comments">
<input type="hidden" name="aid" value="<?php echo $aid; ?>" />
<input type="hidden" name="isconfirm" value="yes" />
<tr> 
<td width="100%" colspan="2" align="center">
<script type="text/javascript">
//<![CDATA[
window.CKEDITOR_BASEPATH='<?php echo $GLOBALS['cfg_cmsurl']; ?>/include/ckeditor/';
//]]>
</script>
<script type="text/javascript" src="<?php echo $GLOBALS['cfg_cmsurl']; ?>/include/ckeditor/ckeditor.js?t=B8DJ5M3"></script>
<?php
GetEditor('msg','',100,'Feedback','print','false',true);
?>
</td>
</tr>
<tr>
<td align="center">
<?php if($cfg_ml->M_ID <= 0) { ?>
<input name="username" type="text" id="username" size="10" class="nb" />
（<a href="../member/index_do.php?fmdo=user&dopost=regnew" target="_blank"><u>注册新用户</u></a>）
<?php
}else{  echo $cfg_ml->M_LoginID."&nbsp;"; }
?>
<input name="notuser" type="checkbox" id="notuser" value="1" />
匿名评论
<?php if(preg_match("/4/",$safe_gdopen)){ ?>
验证码：
<input name="validate" type="text" id="validate" size="10" style="height:18px;width:50px;margin-right:6px;text-transform:uppercase;"  />
<img src='../include/vdimgck.php' width='60' height='24' style="cursor:pointer" onclick="this.src=this.src+'?'" title="点击我更换图片" alt="点击我更换图片" /><?php } ?></td>
<td width="84"><INPUT height=21 name=submit src="/templets/default/diary/img/replay.png" type=image width=80 style="border:0px"></td>
</tr></form>
</table></div>
</body>
</html>