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

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

 
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);
?>

  include_once './inc/header.inc.php';?>
    <div style="margin-top:55px;">div>
    <div id="position" class="auto">
         <a href = "index.php">首页a> > 
         <a href = "list_father.php?id= echo $data_father['id'] ?>"> echo $data_father['module_name']; ?>a> > 
         <a> echo $data_son['module_name']; ?>a>
    div>
    <div id="main" class="auto">
        <div id="left">
            <div class="box_wrap">
                <h3> echo $data_son['module_name']; ?>h3>
                <div class="num">
                    今日:<span> echo $today_content; ?>span>   
                    总帖:<span> echo $all_content; ?>span>
                div>
                <div class="moderator">版主:
                    <span>
                          
                        if($data_son['member_id'] == 0){
                            echo "暂无版主";
                        }else{
                            echo $data_son['member_id'];
                        }
                        ?>
                    span>
                div>
                <div class="notice">
                     
                    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">
                         
                        $page = page($all_content);
                        echo $page['html'];
                        ?>
                    div>
                    <div style="clear:both;">div>
                div>
            div>
            <div style="clear:both;">div>
            <ul class="postsList">
                 
                /**
                 * 多表查询:
                 * 查询字段:帖子标题,发布时间,浏览数(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=" 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="#"> echo $data_content['title']; ?>a>h2>div>
                        <p>
                            楼主: echo $data_content['username'];?> 
                             echo $data_content['time'];?>    最后回复:2014-12-08
                        p>
                    div>
                    <div class="count">
                        <p>
                            回复<br /><span>41span>
                        p>
                        <p>
                            浏览<br /><span> echo $data_content['times'];?>span>
                        p>
                    div>
                    <div style="clear:both;">div>
                li>
                 } ?>  
            ul>
            <div class="pages_wrap">
                <a class="btn publish" href="">a>
                <div class="pages">
                    <a>« 上一页a>
                    <a>1a>
                    <span>2span>
                    <a>3a>
                    <a>4a>
                    <a>...13a>
                    <a>下一页 »a>
                div>
                <div style="clear:both;">div>
            div>
        div>
         include_once './inc/list_father_right.inc.php'; ?>
        <div style="clear:both;">div>
    div>


 include_once './inc/footer.inc.php'; ?>

小型bbs论坛系统开发10 前台子版块列表页_第1张图片

你可能感兴趣的:(PHP实战项目,PHP,bbs,论坛)