国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

基于mysql的論壇(4)

2024-07-24 12:56:48
字體:
供稿:網(wǎng)友
## index.php
<html>
<head>
<title>論壇</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>

<frameset cols="125,*" rows="*" border="0" frameborder="0">  
  <frame src="left.php" name="left" scrolling="auto" frameborder="yes" bordercolor="#000000">
  <frame src="right.htm" name="main" scrolling="auto">
</frameset>
<noframes><body bgcolor="#ffffff">

</body></noframes>
</html>
## left.php
<?php
$fp=fopen("file/counter.txt","r");
$counter=fgets($fp,8);
fclose($fp);
$counter=$counter+1;
$fp=fopen("file/counter.txt","w");
fputs($fp,$counter);
fclose($fp);
require("config.inc.php");
$sql="select * from boardinfo";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
?>
<html>
<head>
<title>版面列表</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link href="css/new.css" rel=stylesheet>
</head>

<body background="image/bg.gif" bgcolor="#ffffff">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td align="center">&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><a href="apply.php" target="main">注冊用戶</a></td>
  </tr>
  <tr>
    <td align="center"><font color="#666666">---------</font></td>
  </tr>
<?php
do
{
echo"<tr>";
echo"<td align="center"><a href="list.php?board=$sql_row[name]" target="main">$sql_row[chinesename]</a></td>";
echo"</tr>";
}while($sql_row=mysql_fetch_array($sql_result));
?>
<tr>
    <td align="center"><font color="#006666">---------</font></td>
  </tr>
  <tr>
    <td height="11">
      <script src=file/x86tree.js></script>
      <script language=javascript>
        img_t1="image/t1.gif";
        img_t2="image/t2.gif";
        tree=new treeview(0,0,640,300);
        tree.addimage(0,"image/dot.gif");
        tree.addimage(1,"image/close.gif");
        tree.addimage(2,"image/open.gif");

        m1=new nodes("m1",tree.imagelist,"論壇轉(zhuǎn)向",0,2,"");
        m1.add(new node("站點(diǎn)首頁",1,0,"<a target='_top'>"));                                                              m1.add(new node("論壇首頁",1,0,"<a href='right.htm' target='main'>"));
    tree.add2(m1);

        doc2=new nodes("doc2",tree.imagelist,"論壇功能",0,2,"-");
            doc2.add(new node("帖子查詢",1,0,"<a href='query.php' target='main'>"));
            doc2.add(new node("精華區(qū)域",1,0,"<a href='good.php' target='main'>"));
                doc2.add(new node("察看留言",1,0,"<a href='vmlogin.php' target='main'>"));
                doc2.add(new node("修改資料",1,0,"<a href='modify_l.php' target='main'>"));
                doc2.add(new node("察看資料",1,0,"<a href='userinfo.php' target='main'>"));
                doc2.add(new node("察看積分",1,0,"<a href='viewscore.php' target='main'>"));
                doc2.add(new node("論壇管理",1,0,"<a href='manage.htm' target='main'>"));
        tree.add2(doc2);

        tree.show();
        doc2.close();
        m1.close();
</script>
    </td>
  </tr>
  <tr>
    <td align="center"> <b><font color="#006666">--------</font><br>
      <?php echo "$counter"?></b></td>
  </tr>
</table>
</body>
</html>
## list.php
<?php
require("func.php");
if(empty($board)){
    $board="computer";
}
$sql="select * from boardinfo where name='$board'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
$chinesename=$sql_row[chinesename];
setcookie ("jl_forum[chinesename]",$chinesename);
$sql="select name from user where slaveboard='$board'";
$sql_result=mysql_query($sql);
?>
<html>
<head>
<title>list</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script language="javascript">
function openwin(board,id){                window.open("read.php?board="+board+"&id="+id,"","height=460,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
function post(board){                window.open("post.php?board="+board,"","height=500,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>

<body bgcolor="#ffffff" background="image/bg.gif">
<?php include "header.php";?> <br>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#ffffff">
  <tr>  
    <td height="22" width="23%" bgcolor="#eeeeee">版面:<?php
echo $chinesename;
?></td>
    <td height="22" width="41%" bgcolor="#eeeeee">版主:<?php
while ($sql_row=mysql_fetch_array($sql_result))
{
echo "$sql_row[name]"."&nbsp;";
}
# 選擇出留言紀(jì)錄;
$sql="select * from $board where slaveid=0";
$temp=mysql_query($sql);
$sum=mysql_num_rows($temp);
$totalpage=ceil($sum/$pagesize);
if ($sum==0) {
    $totalpage=1;
}
# 分頁
if($page<1 or empty($page)){
    $page=1;
}
elseif ($page>$totalpage){
         $page=$totalpage;
}
$offset=($page-1)*$pagesize;
$sql="select * from $board where slaveid=0 order by id desc limit $offset,$pagesize";
$sql_result=mysql_query($sql);
?> </td>
    <td height="22" width="13%" bgcolor="#eeeeee">貼子總數(shù):<?php echo $sum; ?></td>
    <td height="22" width="12%"><a href='javascript:post("<?php echo $board;?>")'><img src="http://edu.cnzz.cn/newsinfo/upload/200902/newtopic.jpg" width="93" height="21" border="0" alt="發(fā)新貼子"></a></td>
    <td height="22" width="11%">  
      <div align="center"><a href="<?php echo "$php_self?board=$board&page=$page";?>">刷新瀏覽</a></div>
    </td>
  </tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="1" bordercolorlight="#cccccc" bordercolordark="#ffffff">
  <tr bgcolor="#995100" align="center">
    <td width="6%"><font color="#ffffff">回應(yīng)</font></td>
    <td width="67%" bgcolor="#995100"><font color="#ffffff">主 題</font></td>
    <td width="20%"><font color="#ffffff">時(shí) 間</font></td>
    <td width="7%"><font color="#ffffff">人氣</font></td>
  </tr>
  <tr bgcolor="#ffcc99">
    <td colspan="5" height="2">&nbsp;</td>
  </tr>
  <?php
while ($sql_row=mysql_fetch_array($sql_result))
{
echo"<tr>";
echo"<td width="6%" bgcolor="#fff5dd" align="center">";
if ($sql_row[renum]!=0)
      {
       echo "<font color="#ff0000">[+$sql_row[renum]]</font>";
      }
else
{
echo "[0]";
}
  echo"</td>";
  echo"<td bgcolor="#e8fdee" width="56%"><font face="宋體"><a href='javascript:openwin("$board",$sql_row[id])' title="作者:$sql_row[writer] 大小:$sql_row[size]字節(jié)">$sql_row[title]</a></font></td>";
  echo"<td width="18%" bgcolor="#fff5dd" align="center">$sql_row[writetime]</td>";
  echo"<td width="6%" bgcolor="#e8fdee" align="center">$sql_row[hits]</td>";
  echo"</tr>";
}
?>
  <tr bgcolor="#ffcc99">
    <td colspan="5" align="center" height="2">&nbsp;</td>
  </tr>
</table>
<div align="right">
<form method="post" action="<?php echo $php_self;?>">
    共<b><?php echo $totalpage;?></b>頁 第<b><?php echo $page;?></b>頁·<?php
if ($page!=1){
     $back=$page-1;
        echo"<a href="$php_self?board=$board&page=1">首頁</a> <a href="$php_self?board=$board&page=$back">上一頁</a>";
}
if ($page==1){
       echo"首頁 上一頁";
}
if($page!=$totalpage){
    $next=$page+1;
        echo" <a href="$php_self?board=$board&page=$next">下一頁</a> <a href="$php_self?board=$board&page=$totalpage">尾頁</a>";
}
if($page==$totalpage){
        echo" 下一頁 尾頁";
}
?>·  
    <input type="submit" name="goto" value="轉(zhuǎn)到">
    <input type="text" name="page" size="2">
    頁  
  </form>
</div>
<?php include "footer.php";?>
</body>
</html>
## login.php
<?php
require "func.php";
if ($name==$admin_name and $password==$admin_password) {
    setcookie ("jl_admin[name]",$name);
    setcookie ("jl_admin[password]",$name);
    redirect2("admin.php");
}
else {
    show_error(1);
}
?>
## manage.php
<?php
require "func.php";
if (check_admin_password()) {
    switch ($job){
        case "setgood":
            set_good($jl_forum[board],$id);
            break;
        case "setnogood":
            set_no_good($jl_forum[board],$id);
            break;
        case "delete":
            del_doc($jl_forum[board],$id);
            break;
    }
echo "<h2>操作成功!</h2><br>";
?>
<html><head><title>o,k</title></head><body>
<form method="post">
      <input type="button" value=" 關(guān) 閉 " name="b1" >
</form>
</body>
</html>
<?php
}
else {
    show_error(1);
}
?>
## manage_list.php
<?php
require("func.php");
if (check_admin_password()) {
$board=$jl_forum[board];
$sql="select * from boardinfo where name='$board'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
$chinesename=$sql_row[chinesename];
setcookie ("jl_forum[chinesename]",$chinesename);
$sql="select name from user where slaveboard='$board'";
$sql_result=mysql_query($sql);
?>
<html>
<head>
<title>list</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script language="javascript">
function openwin(board,id){                window.open("manage_read.php?board="+board+"&id="+id,"","height=460,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
function post(board){                window.open("post.php?board="+board,"","height=500,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>

<body bgcolor="#ffffff" background="image/bg.gif">
<?php include "header.php";?> <br>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#d8d8e8" bordercolordark="#d8d8e8">
  <tr>  
    <td height="20" width="27%" bgcolor="#d8dde9">版面:<?php
echo $chinesename;
?>(管理)</td>
    <td height="20" width="31%" bgcolor="#d8dde9">版主:<?php
while ($sql_row=mysql_fetch_array($sql_result))
{
echo "$sql_row[name]"."&nbsp;";
}
# 選擇出留言紀(jì)錄;
$sql="select * from $board where slaveid=0";
$temp=mysql_query($sql);
$sum=mysql_num_rows($temp);
$totalpage=ceil($sum/$pagesize);
if ($sum==0) {
    $totalpage=1;
}
# 分頁
if($page<1 or empty($page)){
    $page=1;
}
elseif ($page>$totalpage){
         $page=$totalpage;
}
$offset=($page-1)*$pagesize;
$sql="select * from $board where slaveid=0 order by id desc limit $offset,$pagesize";
$sql_result=mysql_query($sql);
?> </td>
    <td height="20" width="15%" bgcolor="#d8dde9">貼子總數(shù):<?php echo $sum; ?></td>
    <td height="20" width="12%"><a href='javascript:post("<?php echo $board;?>")'><img src="http://edu.cnzz.cn/newsinfo/upload/200902/newtopic.jpg" width="92" height="21" border="0" alt="發(fā)新貼子"></a></td>
    <td height="20" align="center" width="15%"><a href="<?php echo "$php_self?board=$board&page=$page";?>">刷新瀏覽</a></td>
  </tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="1" bordercolorlight="#cccccc" bordercolordark="#cccccc">
  <tr bgcolor="#995100" align="center">
    <td width="6%"><font color="#ffffff">回應(yīng)</font></td>
    <td width="67%" bgcolor="#995100"><font color="#ffffff">主 題</font></td>
    <td width="20%"><font color="#ffffff">時(shí) 間</font></td>
    <td width="7%"><font color="#ffffff">人氣</font></td>
  </tr>
  <tr bgcolor="#ffcc99">
    <td colspan="5" height="2">&nbsp;</td>
  </tr>
  <?php
while ($sql_row=mysql_fetch_array($sql_result))
{
echo"<tr>";
echo"<td width="6%" bgcolor="#fff5dd" align="center">";
if ($sql_row[renum]!=0)
      {
       echo "<font color="#ff0000">[+$sql_row[renum]]</font>";
      }
else
{
echo "[0]";
}
  echo"</td>";
  echo"<td bgcolor="#e8fdee" width="56%"><font face="宋體"><a href='javascript:openwin("$board",$sql_row[id])' title="作者:$sql_row[writer] 大小:$sql_row[size]字節(jié)">$sql_row[title]</a></font></td>";
  echo"<td width="18%" bgcolor="#fff5dd" align="center">$sql_row[writetime]</td>";
  echo"<td width="6%" bgcolor="#e8fdee" align="center">$sql_row[hits]</td>";
  echo"</tr>";
}
?>
  <tr bgcolor="#ffcc99">
    <td colspan="5" align="center" height="2">&nbsp;</td>
  </tr>
</table>
<div align="right">
<form method="post" action="<?php echo $php_self;?>">
    共<b><?php echo $totalpage;?></b>頁 第<b><?php echo $page;?></b>頁· <?php
if ($page!=1){
     $back=$page-1;
        echo"<a href="$php_self?board=$board&page=1">首頁</a> <a href="$php_self?board=$board&page=$back">上一頁</a>";
}
if ($page==1){
       echo"首頁 上一頁";
}
if($page!=$totalpage){
    $next=$page+1;
        echo" <a href="$php_self?board=$board&page=$next">下一頁</a> <a href="$php_self?board=$board&page=$totalpage">尾頁</a>";
}
if($page==$totalpage){
        echo" 下一頁 尾頁";
}
?>·轉(zhuǎn)到第  
    <input type="text" name="page" size="2">
    頁  
  </form>
</div>
<?php include "footer.php"?>
</body>
</html>
<?php
}
else {
    show_error(4);
}
?> 


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 五大连池市| 丹巴县| 屯留县| 海南省| 五大连池市| 郎溪县| 宣汉县| 尼勒克县| 柘城县| 都匀市| 弥勒县| 多伦县| 望奎县| 昌平区| 九龙坡区| 长顺县| 上饶市| 大化| 兴山县| 府谷县| 宣汉县| 延寿县| 巴东县| 双峰县| 曲麻莱县| 平顺县| 广灵县| 肇源县| 杭州市| 介休市| 通河县| 金昌市| 天等县| 濮阳市| 望城县| 会理县| 天镇县| 饶阳县| 鄂伦春自治旗| 成安县| 鄄城县|