📄 reply.php
字号:
<?php
/////////////////////////////////////
// //
// 制 作 :宇海网络 //
// 主 页 :http://www.yhai.com //
// 邮 件 :support@yhai.com //
// //
/////////////////////////////////////
require("include/config.php");
require($datapath."/prepare.php");
require("include/sendmail.php");
require("global.php");
if(!CheckAdmin()){
wqx("你不是版主(未登陆或连接超时),无权执行相关操作");
}else{
$file="${datapath}/book.php";
$fp=fopen($file,"r");
flock($fp,LOCK_SH);
$id = isset($_GET['id'])?$_GET['id']:$_POST['id'];
if($_POST['act'] == "addto"){ /// 回复留言
$headdata="";$sign=1;
While($sign){
$headdata=$headdata.$temp;
$temp=fgets($fp,5000);
$line=explode("\t",$temp);
if($line[0]==$id) $sign=0;
if(feof($fp)) error("你的留言板不存在此条留言,无法回复");
}
$comments=replymsg($_POST['comments']);
if(strlen($comments)>200) error("你的回复内容过长");
$hftz = $line[13];
$line[13]="";
$line[14]=$comments;
$line[15]=$gb_time;
$temp2=implode("\t",$line);
$footdata=fread($fp,filesize($file));
fclose($fp);
$writemsg=$headdata.$temp2.$footdata;
$fp=fopen($file,"w");
flock($fp,LOCK_EX);
fwrite($fp,$writemsg);
fclose($fp);
if($hftz == "on" and $line[4] != ""){ /// 邮件通知
$ntime=date("Y-m-d.H:i",$line[11]);
$time=date("Y-m-d.H:i",$gb_time);
$message="\n下面是你在".$config[bookname]."的留言回复\n";
$message.="-------------------------------------------------\n\n";
$message.="你的留言:\n$line[10] [$ntime]\n\n";
$message.="版主回复:$comments\n";
$message.="回复时间:$time\n\n";
$message.="-------------------------------------------------\n";
$message.="宇海网络服务公司 http://www.yhai.com\n";
$message.="域名注册、虚拟主机、集团邮局、网页制作、网站推广\n\n";
$message.="绿叶软件营 http://lvsoft.126.com\n\n";
SendMail($line[4],$config[bookname]." 留言回复",$message,$line[1],$config[bookbz]);
}
success("回复成功","你已成功的回复了留言,即将返回留言簿","./");
}else{ /// 显示要回复的留言
$sign=1;
While($sign){
$temp=fgets($fp,5000);
$line=explode("\t",$temp);
if($line[0]==$id) $sign=0;
if(feof($fp)) error("对不起,你的留言板不存在此条留言。");
}
$time=date("Y-m-d.H:i",$line[11]);
$showtz="";
if($line[14]<>"") $showtz=" title=\"最后回复时间: ".date("Y-m-d.H:i",$line[15])."\"";
if(($line[13]=="on")and($line[4]<>"")) $showtz=" title=\"你的回复将会通过邮件发给“${line[1]}”\"";
fclose($fp);
if($config[ubb]){
$content = ubb($line[10]);
}else{
$content = ereg_replace("\[br\]"," ",$line[10]);
}
header("Expires: 0");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?echo$config[bookname];?>——回复留言</title>
<link rel="stylesheet" href="images/style.css">
<script language='JavaScript1.2' src='images/clue.js' type='text/javascript'></script>
</head>
<body bgcolor="#9BCBFB">
<script language="JavaScript1.2">
<!--
var postmaxchars = 200;
function validate(theform) {
ByteCount = 0;
if (postmaxchars != 0) {
for (i=0;i<theform.comments.value.length;i++){
ByteCount = (theform.comments.value.charCodeAt(i)<=256) ? ByteCount + 1 : ByteCount + 2;
}
if (ByteCount > postmaxchars) {
alert("你的信息太长了.\n\n请限制在 "+postmaxchars+" 字节以内.\n当前已有 "+ByteCount+" 字节.");
return false; }
else { document.form.submit.disabled = true; return true; }
} else {
document.form.submit.disabled = true; return true; }
}
-->
</script>
<p> </p>
<div align="center">
<center>
<table border="0" cellspacing="0" width="500" bgcolor="#000000">
<tr>
<td width="498">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="100%" colspan="2" align="center" height="23" background="images/table.gif"><font color="#FFFFFF"><?echo$config[bookname];?></font></td>
</tr>
<tr>
<td width="100%" colspan="2" height="1"></td>
</tr>
<tr>
<td width="74%" bgcolor="#EFEFEF" height="17"> 当前位置: <a href="<?echo$config[homeurl];?>"><?echo$config[homename];?></a> >> <a href="./">查看留言</a> >>
回复留言</td>
<td width="26%" bgcolor="#EFEFEF" height="17"> </td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table cellpadding="0" cellspacing="0" width="500" height="5">
<tr>
<td width="100%"></td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellspacing="0" width="500" bgcolor="#000000" cellpadding="0">
<tr>
<td width="100%">
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<form name="form" method="post" action="reply.php" onsubmit="return validate(this)">
<input type="hidden" name="act" value="addto">
<input type="hidden" name="id" value="<?echo$_GET['id'];?>">
<tr>
<td width="105" bgcolor="#DAEFE1">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">相关留言</td>
</tr>
</table>
</td>
<td width="377" bgcolor="#DAEFE1">
<p style="line-height: 12pt; margin-left: 10; margin-right: 10"><font color="#0000FF"><u>
<?echo$line[1];?></u></font> [<?echo$time;?>]<br>
<?echo$content;?></p>
</td>
</tr>
<tr>
<td width="105" bgcolor="#DAEFE1">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">回复内容<br>
(<100个字符)</td>
</tr>
</table>
</td>
<td width="377" bgcolor="#DAEFE1">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%">
<textarea rows="4" cols="50" name="comments" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" style="overflow:auto" class="input"<?echo$showtz;?>><?echo$line[14];?></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="490" colspan="2" align="center" bgcolor="#DAEFE1">
<input type="submit" value="发送" name="submit" style="width: 50; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" class="input">
<input type="reset" value="取消" name="reset" style="width: 50; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" class="input">
<input type="button" value="不回复" onclick="javascript:history.back()" style="width: 50; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" class="input">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</center>
</div>
<p> </p>
<div align="center">
<center>
<table cellpadding="3" cellspacing="0" bordercolor="#4F4F4F" width="400">
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%" bgcolor="#808080" height="1"></td>
</tr>
<tr>
<td width="100%" align="center">受权使用:<?echo$config[homename];?> / <a href="http://www.yhai.com"
title="宇海网络" target="_blank">Yhai.Com</a> <a href="http://lvsoft.126.com"
title="VerInfo: <?=Verinfo?>" target="_blank">YHPbook v<?=Verion?></a></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
<?
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -