欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

我的论坛源代码(二)

程序员文章站 2022-03-14 10:00:09
主界面,也就是显示主题列表的这页。 //foxbbs.php 功能:显示论坛的主题 狐网论坛&...</div> <div class="content"> 主界面,也就是显示主题列表的这页。 <br>//foxbbs.php 功能:显示论坛的主题 <br><br><html> <br><head> <br><title>狐网论坛</title> <br><style type=text/css> <br>p {font-family: normal; font-size: 9pt; line-height: 14pt} <br>div {font-family: normal; font-size: 9pt; line-height: 14pt} <br></style> <br><link href="js/lfox.css" rel=stylesheet /link> <br><?php <br>include "linkfox.inc.php"; <br>include "info.inc.php"; <br><br>?> <br></head> <br><body bgcolor="#ffffff"> <br><? <br>$tem=$http_cookie_vars[flyfoxnet];        //这里取cookie里的信息 <br>$temp=explode("|",$tem);                  //因为用户名和密码是用"|"分隔并记录在cookie里的 <br>$cookiem=$temp[0];                        //取用户名 <br>$useinfo=cuser($cookiem,$action);         //cuser这个函数是用来判别是否从cookie中取出了信息 <br>$query="select usename from useinfo where usename='".$useinfo[0]."'"; //检查是否注册用户 <br>$req=mysql_query($query); <br>if ($req) <br>{ <br>  $usename=mysql_fetch_array($req);                            <br>    if($usename[0]==$useinfo[0]) $useinfo[0]=$usename[0];     <br>    else { <br>        $usename=1; <br>        $useinfo[0]="游客"; <br>         } <br>} <br>else $usename=1;$useinfo[0]="游客"; <br>?> <br><table width="100%" cellpadding="4" cellspacing="0" border="0"> <br>  <tr> <br>    <td height="40" rowspan="2" width="60%"> <br>      <div align="right"></div> <br>      <div align="right"></div> <br>    </td> <br>    <td height="20" width="10%"> </td> <br>    <td height="20" width="10%"> </td> <br>    <td height="20" width="10%"> </td> <br>    <td height="20" width="10%"> </td> <br>  </tr> <br>  <tr> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="reguse.php?action=xy"><img src="images/top_register.gif" width="74" height="21" border="0"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="useinfo.php?action=find"><img src="images/top_members.gif" width="74" height="21" border="0"></a></div> <br>    </td> <br>    <td height="20" width="10%"><a href="useinfo.php?action=edit"><img src="images/top_profile.gif" width="74" height="21" border="0"></a></td> <br>    <td height="20" width="10%"><a href="okey.php?d=q"><img src="images/top_logout.gif" width="74" height="21" border="0"></a></td> <br>  </tr> <br>  <tr> <br>    <td height="20" width=60%> <br>      <div align="left">当前位置:<font color="#0000ff">狐网─>狐网论坛─>主题列表</font>  <? echo "<font color='00dd00'>".$useinfo[2]."</font><font color='ff0000'>"; echo "欢迎你来到论坛!</font>"; ?></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><? echo "<a href='post.php'><img src='images/newthread.gif' width='70' height='20' border='0' alt='发布新帖'></a>";  ?></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><? if ($action==find) echo "<a href='foxbbs.php'><img src='images/dispall.gif' width='70' height='20' border='0' alt='显示所有贴子列表'></a>"; else echo "<a href='superuse.php'  target='_blank'><img src='images/super.gif' border='0' alt='管理专区,非请莫进'></a>";?></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="reguse.php?action=dl"><img src="images/dl.gif" border="0" alt="登录用户"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="http://lfox.oso.com.cn/index.php" target="_blank"><img src="images/fox.gif" border="0" alt="返回狐网首页"></a></div> <br>    </td> <br>  </tr> <br></table> <br><? echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"; <br> echo "<tr bgcolor='#000000'><td><table width='100%' border='0' cellspacing='1' cellpadding='1'>"; <br> ?>       <tr bgcolor="#229999"> <br>          <td width="5%"> <br>            <div align="center"><font color="#ffffff">状态</font></div> <br>          </td> <br>          <td width="5%"> <br>            <div align="center"><font color="#ffffff">表情</font></div> <br>          </td> <br>          <td width="30%"> <br>            <div align="center"><font color="#ffffff">主    题</font></div> <br>          </td> <br>          <td width="25%"> <br>            <div align="center"><font color="#ffffff">作  者</font></div> <br>          </td> <br>          <td width="5%"> <br>            <div align="center"><font color="#ffffff">回复</font></div> <br>          </td> <br>          <td width="5%"> <br>            <div align="center"><font color="#ffffff">人气</font></div> <br>          </td> <br>          <td width="25%"> <br>            <div align="center"><font color="#ffffff">最后回复时间</font></div> <br>          </td> <br>        </tr> <br>        <?php <br>$imgnum=20;          //点击次数,准备改状态图 <br>if (!$user) $user="all"; <br>$query="select count(*) from foxbbs";   //首先计算总的论题数 <br>$req=mysql_query($query); <br>if ($req) <br>{ <br>     $row=mysql_fetch_array($req); <br>     $num=$row[0]; <br>     if (!$rows) $rows=10;                                //控制每页显示条数 <br>     if (!$l) $l=1;                                       //设定排序方式 <br>     if ($num/$rows<1) $page=1;                           //计算总页数 <br>     else if($num/$rows==floor($num/$rows)) $page=$num/$rows; <br>     else $page=floor($num/$rows)+1; <br>     if (!$dpage) $dpage=1;                                //当前显示的页数 <br>     if ($dpage>$page) $dpage=$page;                       //不能超过最大页数 <br>     if ($dpage==1) $tem=0;                                //控制当前页应该显示的信息 <br>     else $tem=($dpage-1)*$rows; <br>     if ($l==2) $s="hfnum"; <br>     else if ($l==3) $s="djnum"; <br>     else $s="id"; <br>     for ($i=0;$i<$rows;$i++)     //根据设定的每页行数来取记录 <br>       { <br>        $tem1=$tem+1; <br>        if($action==find) $query="select * from foxbbs where usename='".$user."' order by $s desc limit $tem,$tem1"; <br>        else $query="select * from foxbbs order by $s desc limit $tem,$tem1";    <br>        $req=mysql_query($query); <br>           if ($req) <br>              { <br>              $bbs=mysql_fetch_array($req);        //看有没有回复时间,如果没有就取发帖时间代替回复时间 <br>              if ($bbs[3]) <br>              { <br>              if (!$bbs[8]) $bbs[8]=$bbs[4]." ".$bbs[1]; <br>              else $bbs[8]=$bbs[8]." ".$bbs[10]; <br><br>              if (substr($bbs[4],0,-8)==date(y年n月j日)&&$bbs[6]<$imgnum&&$bbs[12]!=1)                           // 如果是当天的帖子 <br>              $img="images/newfolder.gif"; <br><br>              else if(substr($bbs[4],0,-8)==date(y年n月j日)&&$bbs["djnum"]>=$imgnum&&$bbs[12]!=1)  //如果是当天,并且点击数上10 <br>              $img="images/newhotfolder.gif"; <br><br>              else if(substr($bbs[4],0,-8)!=date(y年n月j日)&&$bbs[6]>=$imgnum&&$bbs[12]!=1)  //如果不是当天,但点击上20 <br>              $img="images/hotfolder.gif"; <br><br>              else if($bbs[12]==1) $img="images/lock.gif";   //已锁 <br>              else $img="images/folder.gif"; <br>              echo "<tr bgcolor='#eeeeee'>"; <br>              echo "<td width='5%'><div align='center'><img src='".$img."'></div></td>"; <br>              echo "<td width='5%'><div align='center'><img src='images/".$bbs[2].".gif'></div></td>"; <br>              echo "<td width='30%'><div align='left'>"; <br>              if ($bbs[12]==1) echo $bbs[3]."</div></td>"; <br>              else echo "<a href='dispbbs.php?id=".$bbs[0]."&use=".$bbs[1]."'>".$bbs[3]."</a></div></td>"; <br>              echo "<td width='25%'><div align='center'>".$bbs[1]."</div></td>"; <br>              echo "<td width='5%'><div align='center'>".$bbs[7]."</div></td>"; <br>              echo "<td width='5%'><div align='center'>".$bbs[6]."</div></td>"; <br>              echo "<td width='25%'><div align='left'>".$bbs[8]."</div></td></tr>"; <br>              } <br>              } <br>       $tem++; <br>     } <br>} <br>echo "<tr><td colspan='7'>"; <br>echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"; <br>echo "<tr>"; <br>echo "<td height='15' width='100%' colspan='3' bgcolor='#229999'><div align='left'><font color='ffffff'>|===> "; <br>if($page==1) <br>  { <br>     echo "[上一页]  [下一页]"; <br>} <br><br>else if ($dpage==1)   //如果当前在第一页 <br>  { <br>     $u=$dpage+1; <br>     echo "[上一页]  <a href='foxbbs.php?dpage=".$u."&rows=".$rows."&l=".$l."&user=".$user."'>[下一页]</a>"; <br>   } <br>else if($dpage>1&&$dpage<$page)   //如果当前在中间页 <br>  { <br>     $u=$dpage+1; <br>     $d=$dpage-1; <br>     echo "<a href='foxbbs.php?dpage=".$d."&rows=".$rows."&l=".$l."&user=".$user."'>[上一页]</a>  <a href='foxbbs.php?dpage=".$u."&rows=".$rows."&l=".$l."&user=".$user."'>[下一页]</a>"; <br>  } <br>else if($dpage==$page)  //如果当前在最后一页 <br>  { <br>     $d=$dpage-1; <br>     echo "<a href='foxbbs.php?dpage=".$d."&rows=".$rows."&l=".$l."&user=".$user."'>[上一页]</a>  [下一页]"; <br>  } <br>echo "</font></div></td>"; <br>echo "</tr></table></td></tr></table></td></tr></table>"; <br>echo "<div align='center'>论题数:".$num." 当前第".$dpage."页/共有".$page."页<select style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' name='dpage' onchange='javascript:location.href=this.options[this.selectedindex].value'>"; <br>for ($i=1;$i<=$page;$i++) <br>{ <br>  if ($i==$dpage) echo "<option value='foxbbs.php?dpage=".$i."&rows=".$row."&l=".$l."&user=".$user."' selected>第".$i."页</option>"; <br>  else echo "<option value='foxbbs.php?dpage=".$i."&rows=".$rows."&l=".$l."'>第".$i."页</option>"; <br>} <br>echo "</select>"; <br>echo "<select style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' name='dpage' onchange='javascript:location.href=this.options[this.selectedindex].value'>"; <br>echo "<option value='' selected>选择排序方式</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=".$rows."&user=".$user."&l=1'>安发贴时间排序</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=".$rows."&user=".$user."&l=3'>安点击数排序</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=".$rows."&user=".$user."&l=2'>安回复数排序</option>"; <br>echo "</select>"; <br>echo "<select style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' name='dpage' onchange='javascript:location.href=this.options[this.selectedindex].value'>"; <br>echo "<option value='' selected>选择每页显示行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=5&l=".$l."&user=".$user."'>每页五行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=10&l=".$l."&user=".$user."'>每页十行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=15&l=".$l."&user=".$user."'>每页十五行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=20&l=".$l."&user=".$user."'>每页二十行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=25&l=".$l."&user=".$user."'>每页二十五行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=30&l=".$l."&user=".$user."'>每页三十行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=35&l=".$l."&user=".$user."'>每页三十五行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=40&l=".$l."&user=".$user."'>每页四十行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=45&l=".$l."&user=".$user."'>每页四十五行</option>"; <br>echo "<option value='foxbbs.php?dpage=".$dpage."&rows=50&l=".$l."&user=".$user."'>每页五十行</option>"; <br>echo "</select>"; <br>$query="select count(*) from useinfo";       //统计注册用户数 <br>$req=mysql_query($query); <br>$usenum=mysql_fetch_array($req); <br>$query="select usename from useinfo order by useid desc limit 0,1";   //查找最新注册的用户,因为id是自增的,所以可以根据id来判断,最大的也就是最新的。 <br>$req=mysql_query($query); <br>$newuse=mysql_fetch_array($req); <br>echo "  目前共有成员[<font color='ff0000'>".$usenum[0]."</font>]名/最新加盟[<font color='ff0000'>".$newuse[0]."</font>]"; <br><br>?> <br><table width="100%" border="0" cellspacing="0" cellpadding="0"> <br>  <tr> <br>    <td height="30"> </td> <br>  </tr> <br>  <tr> <br>    <td height="30"> <br>      <table width="100%" border="0" cellspacing="0" cellpadding="0"> <br>        <tr> <br>          <td height="20" width="20%"> <br>            <div align="left">状态说明:</div> <br>          </td> <br>          <td height="20" width="20%"> <br>            <div align="left"></div> <br>          </td> <br>          <td height="20"> </td> <br>          <td height="20"> </td> <br>        </tr> <br>        <tr> <br>          <td height="20" width="25%"> <br>            <div align="left"><img src="images/newfolder.gif" width="14" height="11"> <br>              当天产生新论题</div> <br>          </td> <br>          <td height="20" width="25%"> <br>            <div align="left"><img src="images/newhotfolder.gif" width="14" height="17"> <br>              当天回复最高的论题</div> <br>          </td> <br>          <td height="20" width="25%"> <br>            <div align="left"><img src="images/folder.gif" width="14" height="11"> <br>              一天以前的论题</div> <br>          </td> <br>          <td height="20" width="25%"> <br>            <div align="left"><img src="images/hotfolder.gif" width="14" height="17"> <br>              总计回复超过50个的论题</div> <br>          </td> <br>        </tr> <br>        <tr> <br>          <td height="20" width="25%"> <br>            <div align="left"><img src="images/lock.gif" width="12" height="15"> <br>              已被关闭的主题 </div> <br>          </td> <br>          <td height="20" width="25%"> <br>            <div align="left"></div> <br>          </td> <br>          <td height="20" width="25%"> <br>            <div align="left"></div> <br>          </td> <br>          <td height="20" width="25%"> <br>          <tr><td colspan="4" height="100"><div align="center"><font color="ff0000">★论坛说明★</font></div><br><div align="left"> <br>            1、此论坛只有注册用户才能发贴,如果您没注册,可以游客身份,查看、回复贴子,但是不能发帖。<br> <br>            2、发帖用户将对论坛内所发的言论负全部责任,回本论坛主要是以情感方面为话题,(在技术论坛出来以前,可以适当地讨论技术方面的问题),如果站长一旦发现有用户使用本论坛讨论其它无关话题,将会立即加锁。(本站将相继推出其它论坛)<br> <br>            3、我还没想到。呵呵…… <br>          </div></td></tr> <br>            <div align="left"></div> <br><br>        <tr><td height="70"></td></tr> <br>        <tr> <br>          <td height="20" colspan="4"> <br>            <div align="center">< <a href="mailto:hllinyu@netease.com">与我联系</a> |─| <a href="mailto:hllinyu@netease.com">flyfox@net</a> ></div> <br>          </td> <br>        </tr> <br>        <tr><td height="20"></td></tr> <br>        <tr> <br>          <td height="20" colspan="4"> <br><br>            <div align="center"><font color="#6666ff">飞狐工作室制作开发</font></div> <br>          </td> <br>        </tr> <br>      </table> <br>    </td> <br>  </tr> <br></body> <br></html>  </div> <div class="info-pre-next"> <p> 上一篇: <a href="/article/177234.html"> 一个连接两个不同MYSQL数据库的PHP程序 </a> </p> <p> 下一篇: <a href="/article/177236.html"> 镜像基本操作: 导入镜像 导出镜像 启动镜像 </a> </p> </div> <div class="wz_tuijian"> <p> 推荐阅读 </p> <ul> <li> <a href="/article/2324527.html" target="_blank" title="我的论坛源代码(八)"> <h2> 我的论坛源代码(八) </h2> </a> </li> <li> <a href="/article/2324440.html" target="_blank" title="我的论坛源代码(十)"> <h2> 我的论坛源代码(十) </h2> </a> </li> <li> <a href="/article/2324418.html" target="_blank" title="我的论坛源代码(五)"> <h2> 我的论坛源代码(五) </h2> </a> </li> <li> <a href="/article/2322467.html" target="_blank" title="在一个php中,我定义了两个表单,当第一个表单提交后,生成了第二个表单,提交第二个表单后,就取不到第一个表单的数据了,该怎么办?"> <h2> 在一个php中,我定义了两个表单,当第一个表单提交后,生成了第二个表单,提交第二个表单后,就取不到第一个表单的数据了,该怎么办? </h2> </a> </li> <li> <a href="/article/2303702.html" target="_blank" title="有一个二维数组,我想取出其中一个key的集合,并计算总和"> <h2> 有一个二维数组,我想取出其中一个key的集合,并计算总和 </h2> </a> </li> <li> <a href="/article/2303087.html" target="_blank" title="怎样给PHP源代码加密?PHP二进制加密与解密的解决办法_php实例"> <h2> 怎样给PHP源代码加密?PHP二进制加密与解密的解决办法_php实例 </h2> </a> </li> <li> <a href="/article/2296900.html" target="_blank" title="我的ECshop二次开发从零开始"> <h2> 我的ECshop二次开发从零开始 </h2> </a> </li> <li> <a href="/article/2205817.html" target="_blank" title="一个模仿oso的php论坛程序源码(之二)第1/3页"> <h2> 一个模仿oso的php论坛程序源码(之二)第1/3页 </h2> </a> </li> <li> <a href="/article/2190395.html" target="_blank" title="我是如何通过论坛推广产品的?"> <h2> 我是如何通过论坛推广产品的? </h2> </a> </li> <li> <a href="/article/2095186.html" target="_blank" title="我是让你扫描我微信的二维码"> <h2> 我是让你扫描我微信的二维码 </h2> </a> </li> </ul> </div> </article> </div> </main> <footer><div class="box"><div class="ft_nav"><div class="ft_about"><p>关于网站</p><ul><li><a href="/sitemap.xml" target="_blank" title="网站地图">网站地图</a></li><li><a href="/list/2/" title="最新程序员文章站">最新程序员文章站</a></li></ul></div><div class="ft_contact"><ul><li>本站所有数据收集于网络如有侵犯到您的权益,请联系我们进行下架处理。</li><li class="email_show"></li></ul></div></div><div class="copyright"><div class="cr_left"><p> 备案号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20058927号</a></p><p>© Copyright © 2020-2022 www.superweb999.com 程序员文章站. </p></div></div></div></footer> </body> </html>