您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
基于mysql的论坛(4)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:35:29
## 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,"论坛转向",0,2,"");
        m1.Add(new Node("站点首页",1,0,"<a href='http://www.jlbusiness.com' 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("精华区域",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;";
}
# 选择出留言纪录;
$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">贴子总数:<?php echo $sum; ?></td>
    <td height="22" width="12%"><a href='javascript:post("<?php echo $board;?>")'><img src="image/newtopic.jpg" width="93" height="21" border="0" alt="发新贴子"></a></td>
    <td height="22" width="11%">  
      <div align="center"><a href="<?p

[1] [2] [3] 下一页


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |