1、系统概要说明html
(1) 头部导航条算法
(2) 中间主显示区域布局数据库
(3) 底部导航条数据结构
2、网站结构设计数据库设计
(4) 未登陆时:首页、发布、搜索、登陆、注册功能(Ps:此时点击发布,自动跳转到登陆页面)布局
(5) 登陆后:发布、设置、我的信息、注销功能post
(1) 用户的发布、点赞、评论总览网站
(2) 发布详情ui
(3) 文章分类与显示url
3、模块详细设计
(1) 我的信息
{% extends 'yonghufather.html' %} {% block yonghubody %} <h3 class="text-center">我的信息</h3> <ul class="list-unstyled nav1"> <li style="background-color: #ffdedf">用户:{{ username }}</li> <li style="background-color: #8bb3ff">编号:{{ userid }}</li> <li style="background-color: #feffac">昵称:{{ nickname }}</li> <li style="background-color: #b0ffbe">头像: {% if img is none%} <img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3298685419,1477967578&fm=27&gp=0.jpg" style="width: 100px"> {% else %} <img src="/static/{{ img }}" style="width: 100px"> {% endif %} <form action="{{ url_for('uploadLogo',user_id=userid) }}"method="post" enctype="multipart/form-data"> <input type="file" name="logo" required> <button type="submit">上传头像</button> </form> </li> <li style="background-color: #ffb664">文章:{{ fabus|length }}篇</li> <li style="background-color: #ffacde">评论:{{ comments|length }}条</li> <li style="background-color: #b89dff">收藏文章:{{ shoucang|length }}篇</li> </ul> {% endblock %}
(2) 发布信息
1 {% extends 'yonghufather.html' %} 2 3 {% block yonghubody %} 4 5 <div> 6 <h3 class="text-center">所有发布信息({{ fabus|length }})</h3> 7 <ul class="list-unstyled"> 8 {% for foo in fabus %} 9 <li class="list-group-item"> 10 <a href="{{ url_for('yonghu',username_id=foo.author_id,tag=1) }}"><span 11 class="glyphicon glyphicon-bell"></span>{{ foo.author.username }}</a> 12 <span class="badge">{{ foo.creat_time }}</span> 13 <span class="badge pull-right">{{ foo.leixing }}</span> 14 <h4 class="text-center"><a href="{{ url_for('fabuview',fabu_id=foo.id) }}">{{ foo.title }}</a> 15 </h4> 16 17 <br> 18 <p>{{ foo.detail }}</p> 19 </li> 20 {% endfor %} 21 </ul> 22 <br> 23 <br> 24 <br> 25 </div> 26 27 {% endblock %}
(3) 评论信息
1 {% extends 'yonghufather.html' %} 2 3 {% block yonghubody %} 4 5 <div> 6 <h3 class="text-center">所有评论信息({{ comments|length }})</h3> 7 <ul class="list-unstyled"> 8 {% for foo in comments %} 9 <li class="list-group-item"> 10 <a href="{{ url_for('yonghu',username_id=foo.author_id,tag=1) }}"><span 11 class="glyphicon glyphicon-bell"></span>{{ foo.author.username }}</a> 12 <span class="badge pull-right">{{ foo.creat_time }}</span> 13 <p>{{ foo.detail }}</p> 14 <br> 15 </li> 16 {% endfor %} 17 </ul> 18 <br> 19 <br> 20 <br> 21 </div> 22 23 {% endblock %}
(4) 收藏文章
1 {% extends 'yonghufather.html' %} 2 3 {% block yonghubody %} 4 5 <div> 6 <h3>收藏文章({{ shoucang|length }})</h3> 7 <hr> 8 <table class="table table-bordered"> 9 <thead> 10 <tr> 11 <th>文章</th> 12 <th>做者</th> 13 </tr> 14 </thead> 15 <tbody> 16 {% for foo in shoucang %} 17 <tr> 18 <td><a href="{{ url_for('fabuview',fabu_id=foo.fabu.id) }}">{{ foo.fabu.title }}</a>   <em>浏览:{{ foo.fabu.yuedu }}   评论:{{ foo.fabu.comments |length }}   点赞:{{ foo.fabu.dianzangs |length }}</em></td> 19 <td><a href="{{ url_for('yonghu',username_id=foo.author.id,tag=1) }}">{{ foo.author.username }}</a></td> 20 </tr> 21 {% endfor %} 22 </tbody> 23 </table> 24 <br> 25 <br> 26 <br> 27 </div> 28 29 {% endblock %}
4、数据库设计
储存用户的帐号与密码,密码在数据库中隐藏,只有管理员身份才能查看。注册成功时,帐号与密码就会被录入数据库中;登陆要依据数据库中的用户表。
2.发布内容表
表中的信息包括标题、详情和文章类型。
3.点赞表
录入的是用户的点赞状况,主要是统计点赞数量。
4.评论表
录入的是用户的评论状况。
5.收藏表
录入的是用户的收藏状况,主要是统计收藏数量
5、系统实现的关键算法与数据结构
可经过某些关键词对发布的内容进行搜索,包含这些关键词的内容都被筛选出来,不包含的内容不显示在首页。
限制条件主要是用在对用户名、密码的限制,包括用户名的组成元素,密码的组成元素。
6、成品展现