php开发论坛系统(2)
retie.php
<?php include("conn.php"); $page=(isset($_GET['page']))?$_GET['page']:"1"; $zq=(isset($_GET['zq']))?$_GET['zq']:"热帖"; ?> <style type="text/css"> <!-- a:link { text-decoration: none; color: #3333CC; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; color: #FF0000; } .style1 { font-size: 13px; font-family: "宋体"; font-weight: normal; } .style2 { font-size: 14px; font-family: "宋体"; } body { background-color: #EFF3FF; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <div align="center"><?php include("head.php");?></div> <p> </p> <table width="476"> <div class="container"> <ul class="nav nav-tabs"> <li class="nav-item"> <a class="nav-link active" href="retie.php" rel="external nofollow" rel="external nofollow" rel="external nofollow" >本页</a> </li> <li class="nav-item"> <a class="nav-link" href="index2.php" rel="external nofollow" rel="external nofollow" rel="external nofollow" >主页</a> </li> <li class="nav-item"> <a class="nav-link" href="login.php" rel="external nofollow" rel="external nofollow" >登录</a> </li> <li class="nav-item"> <a class="nav-link" href="register.php" rel="external nofollow" rel="external nofollow" >注册</a> </li> <table width="776" border="0" align="center" cellpadding="0" cellspacing="0" background=""> <tr> <td width="109" height="25" background=""> </td> <td width="638" align="right" valign="middle"><div align="center"><marquee direction="left" scrollamount="1" scrolldelay="7" onMouseOver="this.stop();" onMouseOut="this.start();"> <img src="timg.jpg" width="19" height="18"><span class="style1">欢迎访问东河论坛网站!</span> <?php echo date("Y-m-d H:i:s")?> </marquee></div></td> <td width="29" > </td> </tr> </table> </ul> </div> </table> <table width="776" height="30" border="0" align="center" cellpadding="0" cellspacing="0" background="timg.jpg"> <tr> <td height="30" align="center"><h2><p class="text-muted"><?php echo $zq;?>专区 </p></h2></td> <td width="584"> </td> </tr> </table> <?php $page_size=5; //每页显示4条记录 $query="select * from tb_zqlb where zq='".$zq."'"; //从数据库中查询所有符合条件的数据 $result=mysqli_query($conn,$query); $message_count=mysqli_num_rows($result); //变量表示查询出结果的数量 if($message_count>0){ ?> <table width="776" height="30" border="1" align="center" cellpadding="1" cellspacing="1" class="table-hover"> <thead> <tr align="center"> <td width="51" height="26" class="style1"><p class="text-muted"><h6>状态</h6></p></td> <!--<td width="54" class="style1"><p class="text-muted"><h6>心情</h6></p></td> --> <td width="381" class="style1"><p class="text-muted"><h6>主 题</h6></p></td> <td width="79" class="style1"><p class="text-muted"><h6>作者</h6></p></td> <td width="76" class="style1"><p class="text-muted"><h6>回复/人气</h6></p></td> <td width="135" class="style1"><p class="text-muted"><h6>发表时间</h6></p></td> </tr> </thead> <?php $page_count=ceil($message_count/$page_size); //变量表示按照每页1条记录显示共有多个页 $offset=($page-1)*$page_size; //变量表示下一页的记录数是从那条记录开始的 $query="select * from tb_zqlb where zq='".$zq."' order by id desc limit $offset ,$page_size "; $result=mysqli_query($conn,$query); while($myrow=mysqli_fetch_array($result)){ ?> <tr> <td width="51" height="30" align="center"><img src="timg.jpg" width="16" height="16"></td> <!--<td width="54" align="center"><img src="images.php?recid=<?php echo $myrow['xq'];?>" width="20" height="20"></td>--> <td width="381" align="center" class="style1"><a href="luntanzhubannr.php?zhuti=<?php echo urlencode($myrow['zhuti']);?> &recid=<?php echo $myrow['id'];?>"><?php echo $myrow['zhuti'];?></a></td> <td width="79" align="center" class="style1"><a href="luntanzhubannr.php?zhuti=<?php echo urlencode($myrow['zhuti']);?> &recid=<?php echo $myrow['id'];?>"><?php echo $myrow['username'];?></a></td> <td width="76" align="center" class="style1"> <?php $quer="select count(*) as hfjl from tb_hflb where ljid='".$myrow['id']."'"; $resul=mysqli_query($conn,$quer); $row=mysqli_fetch_array($resul); $hfjl=$row['hfjl']; echo $hfjl; ?> /<?php echo $myrow['fwjl'];?> </td> <td width="135" align="center" class="style1"><?php echo $myrow['fbsj'];?></td> </tr> <?php } ?> </table> <table width="776" height="40" border="0" align="center" cellpadding="0" cellspacing="0" background="timg.jpg"> <tr> <td height="20" colspan="3"> </td> </tr> <tr> <td width="240" height="20"> </td> <td width="480"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr class="style1"> <td width="40%">页次:<?php echo $page;?> /<?php echo $page_count;?>页 记录:<?php echo $message_count;?>条</td> <td width="50%"> 分页: <a href='retie.php?zq=<?php echo urlencode($zq);?>&page=1'>首页</a> <?php if($page >= 2){ ?> <a href="retie.php?zq=<?php echo urlencode($zq);?>&page=<?php echo $page-1;?>" rel="external nofollow" >上一页</a> <?php } if($page < $page_count){ ?> <a href="retie.php?zq=<?php echo urlencode($zq);?>&page=<?php echo $page+1;?>" rel="external nofollow" >下一页</a> <?php } if($page <= $page_count){ ?> <a href="retie.php?zq=<?php echo urlencode($zq);?>&page=<?php echo $page_count;?>" rel="external nofollow" >尾页</a> <?php } ?> </td> </tr> </table></td> <td width="56"> </td> </tr> </table> <?php }else{ ?> <div align="center">无数据!</div> <?php } ?> <p> </p><p> </p><p> </p><p> </p> <div class="jumbotron text-center" style="margin-bottom:0"> <p> <div id = "footer"> <dl> <dt><a href = "#">关于我们</a> || <a href = "#">产品目录</a> || <a href = "#">反馈问题</a> || <a href = "#">广告合作</a> || <a href = "#">联系我们</a></dt> <dd>Copyright © 2019 - 2024 donghe.com All Rights Reserverd <br/>东河公司 版权所有 京 ICP 备 200000000 号 </dd> </dl> </div> </p> </div>
内容版权声明:除非注明,否则皆为本站原创文章。