[php]代码库
留言板使用说明
#############################################################################
1。运行环境PHP4.0以上版本,本程序有一个INSTALL.PHP的安装文件。同时还有一个INSTALL.SQL文件。在安装的时候
先运行install.php配置,在安装数据库的时候请选择INSTALL.SQL文件,以便安装程序能正常建立数据库。
2。安装后初始管理员为:admin 密码为:0000 安装好后请尽快登陆管理模块进行修改。否则可能引起安全问题。
3。功能介绍:管理功能有屏蔽IP,添加管理员,修改管理员密码,删除管理员,支持在线修改config.php配置文件,
删除留言,自定义屏蔽不良关键字,支持BBCODE代码。具有数据库备份,恢复功能,让你从此不用担心数据丢失。
改变式样模块正在开发中。
4。季风在编程的时候尽量考虑到了可能出现的问题,但是由于水平有限,也有可能在使用过程中出现问题,请大家
发现问题后尽快联系我。谢谢!!!~~
#############################################################################
<?header("content-Type: text/html; charset=gb2312"); ?>
<?php //通用文件
require ("config.php");
require ("function.php");
require ("global.php");
?>
<?php
if (!isset($list_page) || $list_page<1){$list_page=1;}
$handle=mysql_connect($dbhost,$dbuser,$dbpwd);
$nsql = "SELECT COUNT(id) AS num FROM $gb_table ORDER BY dateline DESC";//查询数据库记录数{guestbook表}
$nresult =@mysql_db_query($dbname, $nsql,$handle);
$nrow =@mysql_fetch_array($nresult);//得到数据表里面的数据数量
$page_num=ceil($nrow['num']/$list_nums);if ($list_page>$page_num){$list_page=$page_num;}
$startid=(($list_page-1)*$list_nums); //以时间字段为索引
$sql = "SELECT * FROM $gb_table ORDER BY dateline DESC LIMIT $startid,$list_nums";
$result =@mysql_db_query($dbname, $sql,$handle);
mysql_close($handle);
gbheader();?>
<center>
<table width=600>
<tr>
<td align=left><?list_page($list_nums,$list_page,$list_page_nums,$nrow['num'],"index.php");?></td>
</tr>
</table>
<?php
if($nrow['num']==0){echo "<TABLE border=0 cellPadding=0 cellSpacing=0 width=600><tr><td height=300 align=center>目前无访客留言记录;单击<a href=write.php>此处签写留言</a></td></tr></table>";}
while($row=mysql_fetch_array($result)){
?>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=600>
<TBODY>
<TR>
<TD width="600"><IMG height=10 src="<?=$imgpath;?>/01.gif" width=600></TD>
</TR>
<TR>
<TD background=<?=$imgpath;?>/02.gif height=21><TABLE align=center border=0 cellPadding=0 cellSpacing=0 height=13
width=550>
<TBODY>
<TR>
<TD align=center class=tdtext width=250><?echo htmlspecialchars($row["title"]);?></TD>
<TD class=tdtext width=120> </TD>
<TD width=181><?if ($login_status==1){echo "[<A href=\"delete.php?id=".$row["id"]."\">版主删除</A>]";
echo "[<A href=\"reply.php?id=".$row["id"]."\">版主回复</A>]";
}?></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD height="1" colspan="2"><IMG height=18 src="<?=$imgpath;?>/03.gif" width=600></TD>
</TR>
<TR>
<TD background=<?=$imgpath;?>/05.gif height=78 Align=center width=600><table width="94%" align=center>
<td valign=top align=left><img class=faceimg border=1 height=64
src="<?echo $row['facepath'];?>"
style="BORDER-BOTTOM-COLOR: #ffffff; BORDER-LEFT-COLOR: #ffffff; BORDER-RIGHT-COLOR: #ffffff; BORDER-TOP-COLOR: #ffffff"
width=64>
<div align=center style="word-break:break-all">
<table style="FILTER: glow(color=#aaaaaa,direction=1)">
<?echo htmlspecialchars($row["username"]);?>
</table>
<br>
<?if ($row["sex"]=="美女"){$seximg="girl.gif";}else{$seximg="boy.gif";}?>
<img src=<?echo $seximg." alt=".$row["sex"];?>></div></td>
<TD width="470" vAlign=top><TABLE align=right border=0 cellPadding=0 cellSpacing=7 height=80
width=470>
<TBODY>
<TR>
<TD class=tdimg width=100% rowspan="4" vAlign=top><TABLE border=1 borderColor=#666666 cellPadding=0
cellSpacing=0 width=470 align=right>
<TBODY>
<TR>
<TD width=470 height=100 colspan="2" vAlign=top borderColor=#999999><TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=97% style=" table-layout:fixed;word-break:break-all">
<TBODY>
<TR>
<TD width=348><?
if ($row['icon'] >0 && $row['icon'] <=20){
$iconsql = "SELECT * FROM $icon_table WHERE bicon.iconid='$row[icon]'";
$iconresult = mysql_db_query($dbname, $iconsql);
while ($iconrow = mysql_fetch_array($iconresult)){
echo "<IMG height=15 src=\"".$iconrow[path]."\" alt=".$iconrow[title]." width=15>";
} }else{
$iconrow['path'] = "sml/19.gif";
$iconrow['title'] = "微笑";
echo "<IMG height=15 src=\"".$iconrow[path]."\" alt=".$iconrow[title]." width=15>";
//否则显示默认图片,并把图片路径保存在变量里面
}
?>
<?echo "留言于:".$row["time"];?></td>
<? if ($login_status==1){echo "<td><div align=right><a href=edit.php?id=".$row['id']." target=about:blank style=\"color=gold\" align=right>编辑 </a></div></td>";}?>
</TR>
<TR>
<TD width=100%>
<?if ($row['hide']==1){
if ($login_status==1) {echo "这里是".$row['username']."对你的一点悄悄话……<br><font color=gold>"; format_text($parseurl,$allowbbcode,$allowimages,$allowhtml,$allowsmilie,$row['booktext']);echo "</font>";}
else{echo "<a href=\"login.php?action=login\"><font color=gold>这是留给版主的悄悄话……</font></a>";}}
else{
format_text($parseurl,$allowbbcode,$allowimages,$allowhtml,$allowsmilie,$row['booktext']);
}?></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
<tr>
<TD height=22 rowspan="1" border=1 bordercolor="#CCCCCC" width=450><?if ($row['reply']==1) {
echo "<table valign=top style=\" table-layout:fixed;word-break:break-all\">";
echo "<tr> ";
echo "<td background=\"".$imgpath."/08.gif\" style=\"position:relative;right:0px;top:-2px\" width=470 height=\"20\">";
echo "版主回复于:".$row['replytime'];
echo "</td></tr><tr><TD>";?>
<?if ($row['replyicon'] > 0 && $row['replyicon']<=20){ //如果头像ID大于0则显示对应的头像图片
$iconsql = "SELECT * FROM $icon_table WHERE bicon.iconid='$row[replyicon]'";
$iconresult = mysql_db_query($dbname, $iconsql);
while($riconrow = mysql_fetch_array($iconresult)){
echo "<IMG height=15 src=\"".$riconrow[path]."\" alt=".$iconrow[title]." width=15>";}
}
else{ //否则显示默认图片,并把图片路径保存在变量里面
$riconrow['path'] = "sml/19.gif";
$riconrow['title'] = "微笑";
echo "<IMG height=15 src=\"".$riconrow[path]."\" alt=".$iconrow[title]." width=15>";}
?>
<?
format_text($parseurl,$allowbbcode,$allowimages,$allowhtml,$allowsmilie,$row['replytext']);?>
<? if ($login_status==1){echo "<br><tr><td align=right><a href=edit.php?id=".$row['id']." target=about:blank style=\"color:gold\">编辑 </a></td></tr>";}?>
<? echo" </TD></tr></table>";
}?></td>
</tr>
</tbody>
</TABLE></TD>
</TR>
</TBODY>
</TABLE></TD>
</table>
</TR>
<TR>
<TD background=<?=$imgpath;?>/07.gif height=32><TABLE align=center border=0 cellPadding=0 cellSpacing=0
width=550>
<TBODY>
<TR>
<TD width=300>来自:
<?=$row['address']?></TD>
<TD align=right width=117><? if ($row['qq'] != "") {echo "<A href=\"http://search.tencent.com/cgi-bin/friend/user_show_info?ln=".strval($row['qq'])."\" target=about:blank><IMG alt=查看QQ:".$row['username']."QQ的详细资料! border=0 height=18 src=\"qq.gif\" width=17></A> ";}
else {
echo "<IMG alt=打死我也不告诉你! border=0 height=18 src=\"qq.gif\" width=17> ";
}
?>
<? if ($row['homepage']!=""){ echo"<A href=\"".$row['homepage']."\" target=_blank><IMG alt=访问".$row['username']."的个人主页! border=0 height=16
src=\"homepage.gif\" width=16></A>";}else{echo "<IMG alt=".$row['username']."的个人主页没有填写. border=0 height=16
src=\"homepage.gif\" width=16>";}?>
<? if ($row['ipaddress']!=""){if($login_status==1){echo "<a href=lockip.php?ipaddress=".$row['ipaddress']."><IMG alt=屏蔽网友".$row['username']."的IP地址 height=15 src=\"ip.gif\"
width=13></a>";}else{echo "<IMG alt=".$row['username']."的IP地址是:".$row['ipaddress']." height=15 src=\"ip.gif\"
width=13>";}}else{echo "<IMG alt=".$row['username']."的IP地址是:未知 border=0 height=15 src=\"ip.gif\"
width=13>";}
if ($row['email'] != "") {echo "<A href=\"mailto:".$row['email']."\" target=about:blank><IMG alt=发电子邮件给 ".$row['username']." border=0 height=16 src=\"email.gif\" width=17></A> ";}?>
<A href=# target=_top><IMG
alt=返回页顶 border=0 height=15 src="top.gif"
width=15></A></TD>
<TD
width=32> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<br>
<?}?>
<table width=600>
<tr>
<td align=right><?list_page($list_nums,$list_page,$list_page_nums,$nrow['num'],"index.php");?></td>
</tr>
</table>
</center>
<?
footer();?>
[源代码打包下载]
初级程序员
by: mileegou 发表于:2014-07-21 12:03:56 顶(0) | 踩(0) 回复
赞一个~~~!
回复评论