⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 转载: 1、留言内容不良词语过滤 2、版主可修改留言内容 3、能把留言删除到回收站 4、可批量删除留言 5、留言前可先预览 6、UBB 标签代码支持 7、随机选择头像和表情
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
#####################################
##  名 称 :雨虹留言板  YHPbook    ##
##  设 计 :绿叶软件营 -> 蓝鸟     ##
##  展 示 :http://lvsoft.126.com  ##
##  电 邮 : lvsoft@tom.com         ##
#####################################

require("include/config.php");
require($datapath."/prepare.php");
require("global.php");
require("include/gb.php");

if($_POST["search"] == "//admin")  glrk();    /// 转到登陆页
$action = chop($_GET["act"]) ? chop($_GET["act"]) : chop($_POST["act"]);

$admin = CheckAdmin();

$announ=file($datapath."/announ.php");
if($announ[0] <> ""){
	list($annou,$a_time) = explode("\t",$announ[0]);
	if($annou <> ""){
		$a_time = date("Y-m-d",$a_time);
		$announ = "\"<font color=ff0000>[公告] </font><font color=000000>$annou</font> (${a_time})\",\"\"";
	}
	else{
		$announ = "\"<font color=ff0000>[公告] </font><font color=000000>当前没有公告</font> (".date("Y-m-d").")\",\"\"";
	}
}
else{
	$announ = "\"<font color=ff0000>[公告] </font><font color=000000>当前没有公告</font> (".date("Y-m-d").")\",\"\"";
}

//statist();
$count = online();
$online = "当前有 ".$count." 人在线";

$newly=file($datapath."/new.txt");
list($newno,$newtime) = explode("\t",$newly[0]);
$new_time = date(Ymd);
if(($newtime == $new_time) and ($newno > 0)){
	$newno = "其中今天有 ${newno} 条";
}else{
	$newno = "今天没有人留言";
}
$top=file($datapath."/top.txt");
$topid = chop($top[0]);
if($topid < 1)  $topid = 0;
$topguest = "";

$file="{$datapath}/book.php";
$fp=fopen($file,"r");
flock($fp,LOCK_SH);
$count=chop(fgets($fp,15));
list($num,$mk)=explode("|",$count);
if($num=="")  $num=0;
if($mk=="")   $mk=0;

$gb_mail = encodemail($config[email]);

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="宇海网络 | http://www.yhai.com | 域名注册、虚拟主机、集团邮局、网页制作、网站推广">
<title><?echo $config[bookname];?></title>
<link rel="stylesheet" href="images/style.css">
<script language='JavaScript1.2' src='images/fader.js' type='text/javascript'></script>
<script language='JavaScript1.2' src='images/clue.js' type='text/javascript'></script>
<script language='JavaScript1.2' type='text/javascript'>
prefix="";
arNews = [
"<font color=000000>目前共有 <?echo$num;?> 条留言,<?echo$newno;?>。<?echo$online;?></font>","",<?echo$announ;?>
]
</script>
</head>
<body bgcolor="#9BCBFB">
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td width="700">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="698" height="60" colspan="3">
		<table border="0" width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td><img border="0" src="images/logo.jpg" width="200" height="60"></td>
				<td background="images/i_3.jpg" width="498" align="center"><a href="http://www.yhai.com" target="_blank"><img border="0" src="images/adv.gif" width="450" height="50"></a></td>
			</tr>
		</table>
		</td>
		<td height="60" width="2">
		<img border="0" src="images/i_5.jpg" width="2" height="60"></td>
	</tr>
	<tr>
		<td width="145" height="27" background="images/i_1.jpg" align="center"><img border="0" src="images/top_home.gif" width="17" height="15" align="absbottom" alt="主页"><a href="<?echo$config[homeurl];?>"><font color="#000000" title="返回到主页"><?echo$config[homename];?></font></a></td>
		<td width="18" height="27">
		<img border="0" src="images/i_2.jpg" width="18" height="27"></td>
		<td height="27" width="535" background="images/i_4.jpg"><div id="elFader"></div></td>
		<td height="27" width="2">
		<img border="0" src="images/i_6.jpg" width="2" height="27"></td>
	</tr>
</table>
      <table width="100%" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF">
        <tr>
          <td width="30%" title="有效显示: <?echo $num-$mk;?> 条">&nbsp;<img border="0" alt="留言数" src="images/ly.gif" align="absbottom" width="16" height="16">共有 <?echo $num;?> 条留言(<?echo round($num/$config[size]*100);?>%) | 
<?
$recy = "";
$reaaa = "";
if($admin){
	if($action=="recy"){
		echo"<a href=\"./\" title=\"离开回收站\">回到首页</a>";
		$hszcx = "<input type=\"hidden\" name=\"act\" value=\"recy\">";
		$surl = "?act=recy";
		$recy = 1;
		$reaaa = "act=recy&";
	}else{
		echo"<a href=\"?act=recy\" title=\"查看被回收的留言\">回收站</a>(".$mk.")";
		$surl = "./";
	}
}else{
	echo "回收站(".$mk.")";
}
?>
		  </td>
          <td width="10%"></td>
		<td width="28%" height="22"><img border="0" alt="版主" src="images/bz.gif" align="absbottom" width="16" height="16"><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;<?echo$gb_mail;?>"><font color="#000000"><u title="E-Mail:<?echo$gb_mail;?>"><?echo $config[bookbz];?></u></font></a>
		  &nbsp; &nbsp; &nbsp; <img border="0" src="images/write.gif" alt="留言" align="absbottom" width="16" height="16"><b><a href="write.php"><font color="#000000" title="我要留言">签写留言</font></a></b></td>
		  <form action="index.php" method="post"><? echo $hszcx; ?>
		  <td width="22%" align="center">查找:<input type="text" size="15" name="search" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" class="input" maxLength="50">
      <input border="0" src="images/cz.gif" name="I1" width="15" height="15" type="image" title="搜索留言">
 </td></form>
       </tr> 
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#458EFC">
<tr>
<td width="3"></td>
<td width="694" align="center">
<table cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="100%" height="3"></td>
  </tr>

<?
if($admin) echo '
<tr>
    <td width="100%">
<table cellpadding="0" cellspacing="0" width="100%" height="20" bgcolor="#9FC5FD">
  <tr>
    <td width="70%">
	&nbsp; 管理选项: <a href="setup.php"><font color="#0000FF" title="基本变量设置">基本设置</font></a>&nbsp; <a href="setup.php#mail"><font color="#0000FF" title="发邮件参数设置">邮件系统</font></a>&nbsp; <a href="setup.php#del"><font color="#0000FF" title="删除留言相关操作">删除操作</font></a>&nbsp; <a href="logout.php"><font color="#0000FF" title="退出管理模式">退出管理</font></a></td>
	<td width="30%" align="center">
	[<a href="javascript:checkAll();" title="选择全部">全选</a>] [<a href="javascript:checkNone();" title="全部不选">不选</a>]
	&nbsp; <a href="javascript:Delet(\'mar\');"><u title="把所选择的留言删除到回收站">标记删除</u></a> <a href="javascript:Delet(\'del\');"><u title="彻底删除所选择的留言">彻底删除</u></a>&nbsp;</td>
  </tr>
</table>
</td></tr>
';

$j = $num+1;
$i = 1;
$num = 0;

if(Chop($_POST["search"])<>"" or Chop($_GET["search"])<>""){
	$key = isset($_POST["search"]) ? $_POST["search"] : urldecode($_GET["search"]);
	$key=htmlspecialchars($key);
	while ($i<$j) {
		$searchlist = chop(fgets($fp,8000));
		$search = explode("\t",$searchlist);
		$comments = " ".$search[10];
		if(!$admin and $search[12] == "on")  $comments = "";
		if($recy == chop($search[17])){
			if(strpos($comments,$key))  {$list[] = $searchlist; $num++;}
		}
		$i++;
	}
echo "<tr><td width=\"100%\" height=\"22\" bgcolor=\"#FFF7D2\">\n";
echo "&nbsp; &nbsp; &nbsp;根据关键字“<font color=#FF0000>$key</font>”共找出 $num 条相关留言\n";
echo "&nbsp; &nbsp; &nbsp;<a href=\"".$surl."\">查看全部</a></td></tr>\n";
$key=urlencode($key);
$sear="search=$key&";
}else{
	while ($i<$j) {
		$temp = chop(fgets($fp,8000));
		$line = explode("\t",$temp);
		if($recy == chop($line[17])) {
			if(($topid == $line[0]) and ($line[12] <> "on")){
				$topguest = $temp;
			}else{
				$list[] = $temp; $num++;
			}
		}
		$i++;
	}
}
fclose($fp);

$shad = $num;
if($admin and $shad>0){
echo '
<SCRIPT LANGUAGE="JavaScript">
<!--
function Delonw(){
	return confirm("你确定要删除此条留言吗?");
}
function Mark(){
	return confirm("确定要把此条留言移到回收站吗?");
}
function Delet(mode){
	var objID;
	var check=false;
	objID = document.delform.elements;
	for (var i=0 ;i<objID.length;i++)
	{
		if(objID[i].checked){
			check=true;
			break;
		}
	}
	if(check){
		if(mode == "mar"){
			if(confirm("确定要把所选留言移到回收站吗?")){
				document.delform.mode.value="mar";
				document.delform.submit()
			}
		}else{
			if(confirm("你确定要删除所选定的留言吗?")){
				document.delform.mode.value="";
				document.delform.submit()
			}
		}
	}else{
		alert ("你没有选择要删除的留言!");
	}
}

function checkAll()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -