小型bbs论坛系统开发10 前台子版块列表页

来源:互联网 发布:淘宝微淘需要收费吗 编辑:程序博客网 时间:2024/05/17 09:23

写了一天,改了很多页面,已经累到暴毙。bug真的好多..
一句话形容,苦中作乐。

<?php include_once './inc/config.inc.php';include_once './inc/mysql.inc.php';include_once './inc/tool.inc.php';include_once './inc/page.inc.php';$cssArray[] = 'style/public.css';$cssArray[] = 'style/list.css';$webTitle = '子板块列表页';$link = sql_connect();$member_id = is_login($link);// 判断$_GET数据合法性if(!isset($_GET['id']) || empty($_GET['id']) || !is_numeric($_GET['id'])){    skip('index.php','error','id参数不合法!');}$query = "select id,module_name,father_module_id,info,member_id from sfk_son_module where id ={$_GET['id']}";$result_son = sql_execute($link,$query);if(mysqli_num_rows($result_son) != 1){    skip('index.php','error','该子版块不存在');}$data_son = mysqli_fetch_assoc($result_son);$query = "select id,module_name from sfk_father_module where id = {$data_son['father_module_id']}";$result_father = sql_execute($link,$query);$data_father = mysqli_fetch_assoc($result_father);$query = "select count(*) from sfk_content where module_id = {$_GET['id']}";$all_content = sql_num($link,$query);$query = "select count(*) from sfk_content where module_id = {$_GET['id']} and time > curdate()";$today_content = sql_num($link,$query);?><!-- 加载头部 --><?php  include_once './inc/header.inc.php';?>    <div style="margin-top:55px;"></div>    <div id="position" class="auto">         <a href = "index.php">首页</a> &gt;          <a href = "list_father.php?id=<?php echo $data_father['id'] ?>"><?php echo $data_father['module_name']; ?></a> &gt;          <a><?php echo $data_son['module_name']; ?></a>    </div>    <div id="main" class="auto">        <div id="left">            <div class="box_wrap">                <h3><?php echo $data_son['module_name']; ?></h3>                <div class="num">                    今日:<span><?php echo $today_content; ?></span>&nbsp;&nbsp;&nbsp;                    总帖:<span><?php echo $all_content; ?></span>                </div>                <div class="moderator">版主:                    <span>                        <?php                          if($data_son['member_id'] == 0){                            echo "暂无版主";                        }else{                            echo $data_son['member_id'];                        }                        ?>                    </span>                </div>                <div class="notice">                    <?php                     if(empty($data_son['info'])){                        echo '暂无介绍';                    }else{                        echo $data_son['info'];                    }                    ?>                </div>                <div class="pages_wrap">                    <a class="btn publish" href=""></a>                    <div class="pages">                        <?php                         $page = page($all_content);                        echo $page['html'];                        ?>                    </div>                    <div style="clear:both;"></div>                </div>            </div>            <div style="clear:both;"></div>            <ul class="postsList">                <?php                 /**                 * 多表查询:                 * 查询字段:帖子标题,发布时间,浏览数(sfk_content),会员名,头像(sfk_member)                 * 查询条件:所有隶属于当前父板块下的所有子版块                 * 避免错误:笛卡尔集                 */                $query = "select s_c.title,s_c.time,s_c.times,s_m.id,s_m.username,s_m.photo                          from sfk_content s_c,sfk_member s_m                          where s_c.module_id = {$_GET['id']}                          and s_m.id = s_c.member_id {$page['limit']}";                $result_content = sql_execute($link,$query);                while($data_content = mysqli_fetch_assoc($result_content)){                ?>                <li>                    <div class="smallPic">                        <a href="#">                            <img width="45" height="45"src="<?php if($data_content['photo'] != 0)                            {echo $data_content['photo'];}else{echo "style/photo.jpg";} ?>">                        </a>                    </div>                    <div class="subject">                        <div class="titleWrap"><h2><a href="#"><?php echo $data_content['title']; ?></a></h2></div>                        <p>                            楼主:<?php echo $data_content['username'];?>&nbsp;                            <?php echo $data_content['time'];?>&nbsp;&nbsp;&nbsp;&nbsp;最后回复:2014-12-08                        </p>                    </div>                    <div class="count">                        <p>                            回复<br /><span>41</span>                        </p>                        <p>                            浏览<br /><span><?php echo $data_content['times'];?></span>                        </p>                    </div>                    <div style="clear:both;"></div>                </li>                <?php } ?>              </ul>            <div class="pages_wrap">                <a class="btn publish" href=""></a>                <div class="pages">                    <a>« 上一页</a>                    <a>1</a>                    <span>2</span>                    <a>3</a>                    <a>4</a>                    <a>...13</a>                    <a>下一页 »</a>                </div>                <div style="clear:both;"></div>            </div>        </div>        <?php include_once './inc/list_father_right.inc.php'; ?>        <div style="clear:both;"></div>    </div><!-- 加载底部 --><?php include_once './inc/footer.inc.php'; ?>

这里写图片描述

0 0