<?/*欢迎使用"丫丫留言板(YaYa MessageBoard )v1.3"
有什么问题到
http://www.palmarinfo.com/whl/
http://yayamb.yeah.net
留言
管理员密码默认123
2003/9/16正式发布
2003/9/17修正分页显示错误
2003/9/19换了一种分页方式
2003/9/20回复直接在原留言后面显示
2003/9/21用户名过滤空格和标点,解决图片过大不能显示问题
2003/9/24过滤留言
2003/10/22修改了发现的错误,加了帮助
2003/10/27修复一个安全错误*/
error_reporting(7);//设定错误讯息回报的等级
if(phpversion()>="4.1.0"){
extract($_REQUEST);
}
define(WENJIAN,"index.php"); //留言板主文件名
define(PASS, "123"); //管理员密码默认123
define(LOGFILE, "liuyan.txt");//留言存放文件
define(YE, "10"); //每页显示留言数目
$woimg =1; //是否开启img标签1为打开0为关闭
$shicha=0; //时差调节
$jzusername=array("whl","whl204","丫丫");//留言板保留用户名
$guolv="法|功|草你|操|fuck|政府|操你妈|我靠|泽民|性爱|falundafa|falun|bitch";//留言板过滤
function head1($head1)
{
$head1= '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>丫丫留言板-YaYa MessageBoard</title>
<style type="text/css">
<!--
td{word-break:break-all}
a:link,a:visited { text-decoration: none; color: #6600FF }
a:hover { text-decoration: underline }
.header { font-family: Tahoma, Verdana; font-size: 12px; color: #ffffff; font-weight: bold; background-color: #606096 }
body { font-family: Tahoma, Verdana; color: #004080;scrollbar-base-color: DFDFDF; scrollbar-arrow-color: #000000; font-size: 12px; background-color: #ffffff }
table { font-family: Tahoma, Verdana; color: #004080; font-size: 12px }
textarea,input,object { font-family: Tahoma, Verdana; font-size: 12px; color: #004080; font-weight: normal; background-color: DFDFDF }
select { font-family: Tahoma; font-size: 12px; color: #004080; font-weight: normal; background-color: DFDFDF }
.bold { font-weight: bold }
</style>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0">
<center><table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="logo.gif" ></td>
</tr>
</table></center>
<br>';
echo $head1;
}
function head($head)
{
$head= '
<table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
<tr><td bgcolor="#000000">
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr class="header">
<td align="center">丫丫留言板 欢迎你</td>
</tr>
</table>
</td></tr></table>';
echo $head;
}
//form 显示
$msge='
<center><form name="form1" method="post" action="'.WENJIAN.'">
<input type=hidden name=act value="liuyan">
<input type=hidden name=pass value='.$pass.'>
<table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
<tr><td bgcolor="#000000">
<table width="100%" border="0" cellpadding="4" cellspacing="1">
<tr>
<td colspan="2" class=header>发布新留言</td>
</tr>
<tr>
<td width="20%" bgcolor="DFDFDF" align="center">姓名</td>
<td width="80%" bgcolor="#F1F1F1"><input name="name" type="text" size="12"></td>
</tr>
<tr>
<td bgcolor="DFDFDF" width="20%" align="center">内容</td>
<td width="80%" bgcolor="#F1F1F1"> <textarea name="txt" cols="80" rows="7" ></textarea>
<br>
<input type="submit" name="Submit" value="发表留言">
<input type="reset" name="Submit2" value="清空内容">
</td>
</tr>
</table></td></tr></table>
</form>
</center>';
$msge1='
<center><form name="form1" method="post" action="'.WENJIAN.'">
<input type=hidden name=act value="admin">
<input type=hidden name=admin value="repost">
<input type=hidden name=reno value='.$reno.'>
<input type=hidden name=pass value='.$pass.'>
<table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
<tr><td bgcolor="#000000">
<table width="100%" border="0" cellpadding="4" cellspacing="1">
<tr>
<td colspan="2" class=header>回复留言</td>
</tr>
<tr>
</tr>
<tr>
<td bgcolor="DFDFDF" width="20%" align="center">内容</td>
<td width="80%" bgcolor="#F1F1F1"> <textarea name="thnr" cols="80" rows="7" ></textarea>
<br>
<input type="submit" name="Submit" value="发表回复">
<input type="reset" name="Submit2" value="清空内容">
</td>
</tr>
</table></td></tr></table>
</form>
</center>';
function bb2html($st)
{
global $woimg;
$st = preg_replace("/\[b\](.*?)\[\/b\]/si", "<b>\\1</b>", $st);
$st = preg_replace("/\[i\](.*?)\[\/i\]/si", "<i>\\1</i>", $st);
$st = preg_replace("/\[u\](.*?)\[\/u\]/si", "<u>\\1</u>", $st);
$st = preg_replace("/\[p\](.*?)\[\/p\]/si", "<p>\\1</p>", $st);
$st = preg_replace("/\[color=(\S+?)\](.*?)\[\/color\]/si",
"<font color=\"\\1\">\\2</font>", $st);
$st = preg_replace("/\[s([1-7])\](.*?)\[\/s([1-7])\]/si",
"<font size=\"\\1\">\\2</font>", $st);
$st = preg_replace("/\[pre\](.*?)\[\/pre\]/si", "<pre>\\1</pre>", $st);
$st = preg_replace("/\[quote\](.*?)\[\/quote\]/si", "<blockquote>\\1</blockquote>", $st);
$st = preg_replace("/(^|[^=\]h])(ttp:)/si", "\\1http:", $st);
$st = preg_replace("/(^|[^=\]])(http|https|ftp)(:\/\/[\!-;\=\?-\~]+)/si", "\\1<a href=\"\\2\\3\" target=_blank>\\2\\3</a>", $st);
$st = preg_replace("/(^|[^=\]\/])(www\.[\!-;\=\?-\~]+)/si", "\\1<a href=\"http://\\2\" target=_blank>\\2</a>", $st);
$st = preg_replace("/\[url\](http|https|ftp)(:\/\/\S+?)\[\/url\]/si",
"<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</A>", $st);
$st = preg_replace("/\[url\](\S+?)\[\/url\]/si",
"<a href=\"http://\\1\" target=\"_blank\">\\1</A>", $st);
$st = preg_replace("/\[url=(http|https|ftp)(:\/\/\S+?)\](.*?)\[\/url\]/si",
"<a href=\"\\1\\2\" target=\"_blank\">\\3</A>", $st);
$st = preg_replace("/\[url=(\S+?)\](\S+?)\[\/url\]/si",
"<a href=\"http://\\1\" target=\"_blank\">\\2</A>", $st);
$st = preg_replace("/\[email\](\S+?@\S+?\\.\S+?)\[\/email\]/si",
"<a href=\"mailto:\\1\">\\1</A>", $st);
$st = preg_replace("/\[email=(\S+?@\S+?\\.\S+?)\](.*?)\[\/email\]/si",
"<a href=\"mailto:\\1\">\\2</A>", $st);
if($woimg){
$st = preg_replace("/\[img\](mailto:)?(\S+?)(\.jpe?g|\.gif|\.png)\[\/img\]/si",
"<img src=\"\\2\\3\" border=0 onload=\"if(this.width>screen.width-333) {this.width=screen.width-333;this.alt='Click Here to Open New Window';}\" onmouseover=\"if(this.alt) this.style.cursor='hand';\" onclick='if(this.alt) window.open(\"\\1\\2\\3\");'>", $st);
}
$st = str_replace("&heart;","<font color=red>♥</font>",$st);
return $st;
}
//取得ip
function iptype1 () {
if (getenv("HTTP_CLIENT_IP")) {
return getenv("HTTP_CLIENT_IP");
}
else {
return "none";
}
}
function iptype2 () {
if (getenv("HTTP_X_FORWARDED_FOR")) {
return getenv("HTTP_X_FORWARDED_FOR");
}
else {
return "none";
}
}
function iptype3 () {
if (getenv("REMOTE_ADDR")) {
return getenv("REMOTE_ADDR");
}
else {
return "none";
}
}
function ip() {
$ip1 = iptype1();
$ip2 = iptype2();
$ip3 = iptype3();
if (isset($ip1) && $ip1 != "none" && $ip1 != "unknown") {
return $ip1;
}
elseif (isset($ip2) && $ip2 != "none" && $ip2 != "unknown") {
return $ip2;
}
elseif (isset($ip3) && $ip3 != "none" && $ip3 != "unknown") {
return $ip3;
}
else {
return "none";
}
}
//写入信�