<?php
/*
'**************************************************************************************************
' 软件名称: 盘锦DJ舞曲网CMS Content Management PjRen.Net
' 版本编号: Version 2.5
' 盘锦舞曲: http://www.pj57.com
' 官方网站: http://www.pjren.net
' 小说网站: http://www.hx39.com
' 0427DJ网: http://www.0427dj.net
' 官方论坛: http://www.tianjiazhen.com
' 版权所有: 盘锦舞曲开发团队    盘锦人(QQ:814006710)
' 郑重声明:
'    1、任何个人或组织不得在未经授权的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    2、盘锦网络事业部保留此软件的法律追究权利
'**************************************************************************************************
*/
include "include/label.php";
include "include/userset.php";
$CHSHDJ_Name=SafeRequest("names","get","zr");
$S_Content=SafeRequest("content","get","zr");
if(is_utf8($S_Content)) $S_Content=convert_encoding($S_Content, 'GBK' ,'UTF-8');
$S_ID=SafeRequest("id","get");
if(defined('S_Mcode') && S_Mcode=='1'){
	$codehtml="验证码：<input type=\"text\" size=\"4\" id=\"codes\" name=\"codes\" style=\"background:#fffff9;border:1px #eaeaea solid;\" onClick=\"javascript:$('#imgcode').css('display','')\">&nbsp;<img src=\"include/code.php\"   id=\"imgcode\" style=\"display:none\">";
}else{
	$codehtml='';
	}	
if(isset($_COOKIE["s_name"])){
		$mname= $_COOKIE["s_name"];
	}
	else{
		$mname= Syc_Name;
}
$Gbook="<script language=\"javascript\" src=\"js/jquery.js\"></script>
<script language=\"javascript\" src=\"js/gbookajax.js\"></script><div id=\"syccms_message\" style=\"width:100%;\"><img src=\"images/faces/loading.gif\"><font style=\"font-size:12px;\">&nbsp;&nbsp;加载留言内容,请稍等......</font></div>
<div id=\"syccms_message_add\" style=\"border:1px solid #B5D6E6; height:200px; width:99.8%; margin-top:20px; font-size:12px;\">
<form name=\"form1\" id=\"form1\" action=\"\"><input type=hidden value=\"".$S_ID."\" id=\"vid\">
	<div style=\"width:98%; height:30px; line-height:30px; margin-top:5px;\">&nbsp;你的网名：<input type=\"text\" name=\"names\" id=\"names\" size=\"15\" value=\"".$mname."\">&nbsp;<font color=\"red\">＊</font><span id=\"info\" style=\"color:red\"></span></div>
	<div style=\"margin-top:5px; height:110px; width:100%; \">
		<div style=\"float:left; height:110px; width:70%; margin-left:2px;  \"><textarea name=\"content\" id=\"content\" style=\"width:95%; float:left;\" rows=\"7\"  >".$S_Content."</textarea>&nbsp;<font color=\"red\">＊</font></div>
        <div style=\"float:left; height:80px; color:#36C;  font-size:12px;line-height:20px;\">声明：您如果有什么建议或意见<br/>请在这里给管理员留言<br/>您所发的信息不能触犯国家法律<br/>否者您需对自己言行负全部责任！</div>
    </div>
	<div style=\"margin-top:5px;\">&nbsp;&nbsp;".$codehtml."<input type=\"button\" value=\"我要留言\" style=\" background:url(images/common/btn.gif); border:0px solid #CCC; color:#39F; height:31px; width:96px; border-left:0px solid red; margin-top:5px; font-weight:bold; \" id=\"add\" ></div>
    </form></div>
    </div>
    </div>
";
if(file_exists(_CHSHDJ_ROOT_.S_Templateurl."gbook.html")){
	$Mark_Text=GetTemp("gbook.html",0);
	$Mark_Text=ReplaceStr($Mark_Text,"{chshdjcms:gbook}",$Gbook);
	echo $Mark_Text;
	}
else{
	die("留言本模版不存在!");
	}
	
function is_utf8($string) {
// From http://w3.org/International/questions/qa-forms-utf-8.html
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $string);

} // function is_utf8 	
?>