代码拉取完成,页面将自动刷新
<?php
include_once('inc/config.php');
include_once('inc/mysql.inc.php');
include_once('inc/tool.inc.php');
include_once('inc/page.inc.php');
$link = connect();
$template['title'] = '父板块列表页';
$template['css'] = array('static/style/public.css', 'static/style/list.css');
//父板块id
$id = $_GET['id']?$_GET['id']:0;
//当日发帖数
$sumD = 0;
//总发帖数
$sumAll = 0;
$sql = "select * from bbs_father_module where id = $id";
$res = execute($link,$sql);
$dataF = mysqli_fetch_assoc($res);
$sqlCount = "select count(*) count from bbs_son_module where father_module_id = {$dataF['id']}";
$sCount = num($link,$sqlCount);
$pageS = page($sCount,1,3);
$sql1 = "select * from bbs_son_module where father_module_id = {$dataF['id']}";
$res1 = execute($link,$sql1);
$sql = "select * from bbs_son_module where father_module_id = {$dataF['id']} limit {$pageS['limit']}";
$res = execute($link,$sql);
$time = time()-3600;
while($dataS1 = mysqli_fetch_assoc($res1)){
$sqlAll = "select count(*) from bbs_content where module_id = {$dataS1['id']}";
$countAll = num($link,$sqlAll);
echo $countAll;
$sumAll += $countAll;
$sql = "select count(*) count from bbs_content where module_id = {$dataS1['id']} and time > $time";
$resC = execute($link,$sql);
$count = intval(mysqli_fetch_assoc($resC)['count']);
$sumD += $count;
}
?>
<?php include_once('public/head.php'); ?>
<div id="position" class="auto">
<a href="">首页</a> > <a href=""><?php echo $dataF['name'];?></a>
</div>
<div id="mains" class="auto">
<div id="left">
<div class="box_wrap">
<h3><?php echo $dataF['name'];?></h3>
<div class="num">
今日:<span><?php echo $sumD;?></span>
总帖:<span><?php echo $sumAll;?></span>
<div class="moderator">子板块:
<?php while($dataS = mysqli_fetch_assoc($res)){
?>
<a href="son_module_list.php?id=<?php echo $dataS['id'];?>"><?php echo $dataS['name'];?></a>
<?php }?>
</div>
</div>
<div class="pages_wrap">
<a href="publish.php?fid=<?php echo $dataF['id'];?>" class="btn publish"></a>
<div class="pages">
<?php
echo $pageS['html'];?>
</div>
</div>
</div>
<div style="clear: both;"></div>
<ul class="postslist">
<?php
$conCount = 0;
$sql = "select * from bbs_son_module where father_module_id = {$_GET['id']}";
$res = execute($link,$sql);
while($dataS = mysqli_fetch_assoc($res)){
$sql2 = "select c.*,m.name,m.photo,m.id mid from bbs_content c,bbs_member m where c.module_id = {$dataS['id']} and m.id = c.member_id ";
$res2 = execute($link,$sql2);
while($dataC = mysqli_fetch_assoc($res2)){
//最后回复
$sqlLastRe = "select time from bbs_reply where content_id = {$dataC['id']} order by time desc limit 0,1";
$resLastRe = execute($link,$sqlLastRe);
$lasteRe = mysqli_fetch_assoc($resLastRe);
//回复总数
$sqlCountRe = "select count(*) from bbs_reply where content_id = {$dataC['id']}";
$countRe = num($link,$sqlCountRe);
?>
<li>
<div class="smallPic">
<a href="member.php?id=<?php echo $dataC['mid'];?>"><img width='42' src="<?php echo $dataC['photo']?$dataC['photo']:'static/images/photo.png';?>" alt=""></a>
<span><?php echo $dataC['name'];?></span>
</div>
<div class="subject">
<div class="titleWrap"><a href="">[<?php echo $dataC['title'];?>]</a><a href=""><?php echo $dataC['content'];?></a></div>
<p>
楼主:<?php echo $dataC['name'];?> <?php echo date('Y-m-d',$dataC['time']);?> 最后回复:<?php echo $lasteRe?date('Y-m-d',$lasteRe['time']):'此贴暂没有回复';?>
</p>
</div>
<div class="count">
<p>
回复:<br><span><?php echo $countRe;?></span>
</p>
</div>
<div class="count">
<p>
浏览:<br><span><?php echo $dataC['times']?$dataC['times']:0;?></span>
</p>
</div>
<div style="clear: both;"></div>
</li>
<?php }}?>
</ul>
<div class="pages_wrap">
<a href="" class="btn publish"></a>
<div class="pages">
<a href=""><上一页</a>
<a href="">1</a>
<a href="">2</a>
<a href="">3</a>
<a href="">..4</a>
<a href="">下一页></a>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div class="right">
<div class="classList">
<div class="title">板块列表</div>
<ul class="listWrap">
<?php
$sqlF = "select * from bbs_father_module";
$resFAll = execute($link,$sqlF);
while($dataFAll = mysqli_fetch_assoc($resFAll)){
?>
<li>
<h2><a href="father_module_list.php?id=<?php echo $dataFAll['id'];?>"><?php echo $dataFAll['name'];?></a></h2>
<ul>
<?php
$sqlSR = "select * from bbs_son_module where father_module_id = {$dataFAll['id']}";
$resSR = execute($link,$sqlSR);
while($dataSR = mysqli_fetch_assoc($resSR)){
?>
<li>
<h3><a href="son_module_list.php?id=<?php echo $dataSR['id'];?>"><?php echo $dataSR['name'];?></a></h3>
</li>
<?php }?>
</ul>
</li>
<?php }?>
</ul>
</div>
</div>
</div>
<?php include_once('public/foot.php'); ?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。