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

📄 index.php

📁 八星瓢虫留言本特点:采用PHP+Access数据库实现
💻 PHP
字号:
<?php
include_once("include/conn.php");
include_once("include/config.php");
include_once("include/function.php");
switch ($action)
{
case "add":
  header ("location:add.php");
  break;
case "manage":
  header ("location:manage.php");
  break;
case "setup":
  header ("location:setup.php");
  break;
case "exit":
  setcookie("admin_id");
  setcookie("admin_login");
  alert("退出成功!","index.php");
  break;
default:
  break;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?php echo $cfg_name; ?></title>
<link href="skin/<?php echo $cfg_skin; ?>.css" rel="stylesheet" type="text/css">
<meta name="keywords" content="<?php echo $cfg_keywords; ?>">
<meta name="description" content="<?php echo $cfg_description; ?>">
</head>

<body>
<!--顶部导航开始-->
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="20"><img src="skin/<?php echo $cfg_skin; ?>/top_left.gif" width="30" height="20"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/top_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/top_right.gif" width="30" height="20"></td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" class="td_border">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="35%" align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><font class="txt_bold">您的IP:</font><?php echo getip(); ?></td>
          </tr>
          <tr>
            <td><font class="txt_bold">操作系统:</font><?php echo getos(); ?></td>
          </tr>
        </table></td>
        <td align="right">
        <a href="?action=add"><img src="images/ico_add.gif" width="60" height="50" border="0" style="margin-top:3px; margin-bottom:3px; margin-right:10px; cursor:hand" onMouseOver="this.style.filter='gray()'" onMouseOut="this.style.filter=''"></a>
        <?php if($_COOKIE["admin_login"]==""){ ?>
        <a href="?action=manage"><img  src="images/ico_manage.gif" width="60" height="50" border="0" style="margin-top:3px; margin-bottom:3px; margin-right:10px; cursor:hand" onMouseOver="this.style.filter='gray()'" onMouseOut="this.style.filter=''"></a>
        <?php } ?>
        <?php if($_COOKIE["admin_login"]!=""){ ?>
        <a href="?action=setup"><img  src="images/ico_setup.gif" width="60" height="50" border="0" style="margin-top:3px; margin-bottom:3px; margin-right:10px; cursor:hand" onMouseOver="this.style.filter='gray()'" onMouseOut="this.style.filter=''"></a>
        <a href="?action=exit"><img  src="images/ico_exit.gif" width="60" height="50" border="0" style="margin-top:3px; margin-bottom:3px; margin-right:10px; cursor:hand" onMouseOver="this.style.filter='gray()'" onMouseOut="this.style.filter=''"></a> </td>
        <?php } ?>
     </tr>
    </table></td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="15"><img src="skin/<?php echo $cfg_skin; ?>/bom_left.gif" width="30" height="15"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/bom_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/bom_right.gif" width="30" height="15"></td>
  </tr>
</table>
<!--顶部导航结束-->
<!--留言内容开始-->
<?php
$list_rs = @new COM("ADODB.RecordSet") or die ("创建记录集失败!");
if ($cfg_check==0)
{
  $list_rs->Open("select * from gb_main order by id desc",$conn,1,1);}
else
{
  $list_rs->Open("select * from gb_main where gb_show=1 order by id desc",$conn,1,1);
}

if ($list_rs->EOF)
{
  $pagecount=1;
  $i=0;
  $rssum=0;
  echo "<div align=\"center\"><p><font color=\"#FF0000\"><b>暂无留言!</b></font></p></div>";
}
else
{
  $page=intval($_GET["page"]);
  if ($page<=0 || $page==""){$page=1;}
  $list_rs->PageSize=$cfg_page;
  $pagesize=$list_rs->PageSize;
  $pagecount=$list_rs->PageCount();
  if ($page>$pagecount) {$page=1;}
  $list_rs->AbsolutePage=$page;
  $rssum=$list_rs->recordcount;
  $i=0;
  do
  {
  $id=$list_rs->Fields["id"]->Value;
  $gb_title=$list_rs->Fields["gb_title"]->Value;
  $gb_user=$list_rs->Fields["gb_user"]->Value;
  $gb_face=$list_rs->Fields["gb_face"]->Value;
  $gb_from=$list_rs->Fields["gb_from"]->Value;
  $gb_oicq=$list_rs->Fields["gb_oicq"]->Value;
  $gb_homepage=$list_rs->Fields["gb_homepage"]->Value;
  $gb_email=$list_rs->Fields["gb_email"]->Value;
  $gb_emote=$list_rs->Fields["gb_emote"]->Value;
  $gb_secret=$list_rs->Fields["gb_secret"]->Value;
  $gb_content=$list_rs->Fields["gb_content"]->Value;
  $gb_show=$list_rs->Fields["gb_show"]->Value;
  $gb_datetime=$list_rs->Fields["gb_datetime"]->Value;
  $gb_ip=$list_rs->Fields["gb_ip"]->Value;
  $gb_reply=$list_rs->Fields["gb_reply"]->Value;
  $gb_replytime=$list_rs->Fields["gb_replytime"]->Value;
  if ($gb_emote!="") {$gb_emote="<img src=\"images/emot/$gb_emote\" width=\"19\" height=\"19\">";}
  if ($gb_email!="") {$gb_email="<a href=\"mailto:$gb_email\"><img src=\"images/usr_email.gif\" width=\"16\" height=\"16\" style=\"margin-right:5px;cursor:hand\" border=\"0\"></a>";}
  if ($gb_homepage!="") {$gb_homepage="<a href=\"$gb_homepage\" target=\"_blank\"><img src=\"images/usr_home.gif\" width=\"14\" height=\"14\" style=\"margin-right:5px;cursor:hand\" border=\"0\"></a>";}
  if ($gb_oicq!="") {$gb_oicq="<a href=\"http://wpa.qq.com/msgrd?V=1&Uin=" .$gb_oicq ."&Menu=yes\" target=\"_blank\"><img src=\"images/usr_qq.gif\" width=\"15\" height=\"15\" style=\"margin-right:5px;cursor:hand\" border=\"0\"></a>";}
  if ($gb_from=="") {$gb_from="不详";}
  if ($gb_face!="") {$gb_face="<img src=\"images/face/$gb_face\" border=\"0\" style=\"float:left; margin:10px\">";}
  if ($gb_secret==1)
  {
    if ($_COOKIE["admin_login"]!="")
    {$gb_content="<font color=\"#FF0000\"><b>以下为隐藏留言</b></font><br>".$gb_content;}
    else
    {$gb_content="<font color=\"#FF0000\">隐藏留言,只有管理员可见!</font>";}
  }
?>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="20"><img src="skin/<?php echo $cfg_skin; ?>/top_left.gif" width="30" height="20"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/top_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/top_right.gif" width="30" height="20"></td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" class="td_border">
  <tr>
    <td align="center"><table width="98%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="22" class="line_bg">〖主题〗<?php echo $gb_emote; ?> <b><font color="#0000FF"><?php echo $gb_title; ?></font></b></td>
      </tr>
      <tr>
        <td height="25"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="50%">&nbsp;作者:<?php echo $gb_user; ?>&nbsp;&nbsp;来自:<?php echo $gb_from; ?></td>
            <td align="right">
            <img alt="发布于:<?php echo $gb_datetime; ?>" src="images/usr_addtime.gif" width="16" height="15" style="margin-right:5px;cursor:hand" border="0">
            <?php echo $gb_email; ?>
            <?php echo $gb_homepage; ?>
            <img alt="IP:<?php echo $gb_ip; ?>" src="images/usr_ip.gif" width="13" height="15" style="margin-right:5px;cursor:hand" border="0">
            <?php echo $gb_oicq; ?>
            <?php if($_COOKIE["admin_login"]!=""){ ?>
              <a href="manage.php?action=setdel&id=<?php echo $id; ?>" title="删除留言">删除</a>
              <?php if ($gb_show!=1){ ?>
              <a href="manage.php?action=setpass&id=<?php echo $id; ?>" title="通过审核"><font color="#FF0000">未审</font></a>
              <?php }else{ ?>
              <a href="manage.php?action=notpass&id=<?php echo $id; ?>" title="取消审核">已审</a>
              <?php } ?>
              <?php if ($gb_reply!=""){ ?>
              <a href="reply.php?action=reply&id=<?php echo $id; ?>" title="修改回复">回复</a>
              <?php }else{ ?>
              <a href="reply.php?action=reply&id=<?php echo $id; ?>" title="回复留言"><font color="#0000FF">回复</font></a>
              <?php } ?>
            <?php } ?>
            </td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td style="padding:2px;">
        <?php echo $gb_face; ?>
        <span style="line-height:200%; width:100%; word-wrap: break-word">
        <?php echo $gb_content; ?>
        </span>
        </td>
      </tr>
      <?php if ($gb_reply!=""){ ?>
      <tr>
        <td class="line_reply">
        <span style="margin-left:23px; line-height:200%">
        〖站长回复〗<?php echo $gb_reply; ?>
        <font color="#999999">[<?php echo $gb_replytime; ?>]</font>
        </span>        
        </td>
      </tr>
      <?php } ?>
      <tr>
        <td height="3"></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="15"><img src="skin/<?php echo $cfg_skin; ?>/bom_left.gif" width="30" height="15"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/bom_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/bom_right.gif" width="30" height="15"></td>
  </tr>
</table>
<?php
  $i=$i+1;
  if ($i>=$cfg_page){break;}
  $list_rs->movenext();
  } while (!$list_rs->EOF);
}
$list_rs->close();
$list_rs=null;
?>
<!--留言内容结束-->

<!--分页开始-->
<div align="center">
页次:<b><?php echo $page; ?></b>/<b><?php echo $pagecount; ?></b>页&nbsp;&nbsp;本页<b><?php echo $i; ?></b>篇留言&nbsp;&nbsp;共<b><?php echo $rssum; ?></b>篇留言
&nbsp;
<?php
if ($page<2)
{
  echo "首页 上一页&nbsp;";
}
else
{
  $tmpPageNo = $page-1; 
  echo "<a href=\"?page=1\">首页</a>&nbsp;";
  echo "<a href=\"?page=".$tmpPageNo."\">上一页</a>&nbsp;"; 
}
if (($pagecount-$page)<1)
{
  echo "下一页 尾页";
}
else
{
  $tmpPageNo = $page+1; 
  echo "<a href=\"?page=".$tmpPageNo."\">下一页</a>&nbsp;"; 
  echo "<a href=\"?page=".$pagecount."\">尾页</a>"; 
}
?>
</div>
<!--分页结束-->
</body>
</html>
<?php
$conn->close();
$conn=null;
?>

⌨️ 快捷键说明

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