首先数据库模型:文章表,评论表 (以文章ID关联),文章分类表;数据结构: id,content,title,status,time,description,keyword,author,class_id,source,img,sort(文章表);
id,article_id,content,uid,time(评论表);
id,class_id,class_name,parent_id(分类表);
文章显示:列表和详情
列表:select * from 文章表 where status =1 order by id desc limit 0,30
详情:selec * from 文章表 where id=$article_id
评论:select * from 评论表 where article_id = $article_id
数据出来后,(控制器写方法查询,通过php对应函数复制到控制器模板文件view展示数据)展示到对应前边页面上就可以了,整个代码写下来这里是递交不咧哦的
控制器:articleController.php( actionlist(),actiondetail(),actiongetconmmit(),actiongetclass()) db.class.php (conn(),getList(),getbyid() getcommitbyaid()) view(list.php,detail.php)
自己写吧,这样才能有提升