1、前言:
 我个人从来没有写过博客文章,作为一个程序员没有自己的博客算是一个合格的程序员,所以我地想想也要经营起一个的博客,做一个小项目,写这博客算就做这个项目的一个项目笔记吧!现在自学着ThinkPHP,就借此框架做一个CMS系统。废话不多说了,赶紧进入学习了。
 
2、需求分析:
 功能分析:
  一、登录退出功能。
  二、菜单功能:涉及前端菜单导航设置。
  三、文章管理:文章编写,编辑插件掌握,异步图片上传。
  四、推荐位管理:让用户自行设定首页推荐文章显示的设定。
  五、用户管理:管理后台登录的用户和权限管理。
  六、基本管理:也就是配置管理,用于修改操作网站的头部关键字,和设置是否进行生成缓存与是否自动备份数据库。

3、表设计:

CREATE DATABASE `tp_cms`;

CREATE TABLE `cms_admin`(
`admin_id` mediumint(6) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(20) not null default '' COMMENT '管理员ID',
`password` varchar(32) not null default '' COMMENT '密码',
`last_login_ip` varchar(15) default '0' COMMENT '最后登录IP',
`last_login_time` int(10) unsigned default '0' comment '最后登录时间',
`email` varchar(40) default '' comment '邮箱地址',
`real_name` varchar(50) not null default '' comment '真实姓名',
`status` tinyint(1) not null default '1' comment '状态',
primary key (`admin_id`),
key `user_name` (`user_name`)
)COMMENT='后台用户表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; create table `cms_menu` (
`menu_id` smallint(6) unsigned not null auto_increment comment '菜单ID',
`name` varchar(40) not null default '' comment '菜单名',
`parentid` smallint(6) not null default '0' comment '父级菜单',
`m` varchar(20) not null default '',
`c` varchar(20) not null default '',
`f` varchar(20) not null default '',
`listorder` smallint(6) unsigned not null default '0' comment '序号',
`status` tinyint(1) unsigned not null default '1' comment '状态',
`type` tinyint(1) unsigned not null default '0' comment '类型',
primary key (`menu_id`),
key `listorder` (`listorder`),
key `parentid` (`parentid`),
key `module` (`m`,`c`,`f`)
)COMMENT='菜单表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8; create table `cms_news` (
`news_id` mediumint(8) unsigned not null auto_increment comment '新闻ID',
`catid` smallint(5) unsigned not null default '0' comment '栏目ID',
`title` varchar(80) not null default '标题',
`small_title` varchar(30) not null default '小标题',
`title_font_color` varchar(250) default null comment '标题颜色',
`thumb` varchar(100) not null default '' comment '主题',
`keywords` char(40) not null default '' comment '关键字',
`description` varchar(250) not null comment '文章描述',
`listorder` tinyint(3) unsigned not null default '0' comment '序号',
`status` tinyint(1) not null default '1' comment '状态',
`copyfrom` varchar(250) default null comment '文章来源',
`user_name` char(20) not null comment '用户',
`create_time` int(10) unsigned not null default '0' comment '创建时间',
`update_time` int(10) unsigned not null default '0' comment '更新时间',
`count` int(10) unsigned not null default '0' comment '总数',
primary key (`news_id`),
key `listorder`(`listorder`),
key `catid`(`catid`)
)COMMENT='新闻文章主表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8; create table `cms_news_content`(
`id` mediumint(8) unsigned not null auto_increment comment 'Id',
`news_id` mediumint(8) unsigned not null comment '新闻ID',
`content` mediumtext not null comment '内容',
`create_time` int(10) unsigned not null default '0' comment '创建时间',
`update_time` int(10) unsigned not null default '0' comment '更新时间',
primary key (`id`),
key `news_id` (`news_id`)
)COMMENT='新闻文章内容副表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8; create table `cms_position`(
`id` smallint(5) unsigned not null auto_increment comment 'id',
`name` char(30) not null default '' comment '名称',
`status` tinyint(1) not null default '1' comment '状态',
`description` char(100) default null comment '描述',
`create_time` int(10) unsigned not null default '0' comment '创建时间',
`update_time` int(10) unsigned not null default '0' comment '更新时间',
primary key (`id`)
)COMMENT='推荐位管理表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8; create table `cms_position_content`(
`id` smallint(5) unsigned not null auto_increment comment 'id' comment 'id',
`positon_id` int(5) unsigned not null comment '推荐表ID',
`title` varchar(30) not null default '' comment '标题',
`thumb` varchar(100) not null default '' comment '主题',
`url` varchar(100) default null comment '地址',
`news_id` mediumint(8) unsigned not null comment '新闻ID',
`listorder` tinyint(3) unsigned not null default '0' comment '排序ID',
`status` tinyint(1) not null default '1' comment '状态',
`create_time` int(10) unsigned not null default '0' comment '创建时间',
`update_time` int(10) unsigned not null default '0' comment '更新时间',
primary key (`id`),
key `positon_id` (`positon_id`)
)COMMENT='推荐位内容表' ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8;

  今天第一天写到这里,已经22点33分了,不要熬夜容易长痘,今天先把表设计好,明天进行编码!

前端到后台ThinkPHP开发整站(1)的更多相关文章

  1. 前端到后台ThinkPHP开发整站--php开发案例

    前端到后台ThinkPHP开发整站--php开发案例 总结 还是需要做几个案例,一天一个为佳,那样才能做得快. 从需求分析着手,任务体系要构建好,这样才能非常高效. 转自: 前端到后台ThinkPHP ...

  2. 前端到后台ThinkPHP开发整站(2)

    我这次使用的ThinkPHP版本是:3.2.3版本,还有会使用到一个弹出层插件,叫 layer,官网地址是:http://layer.layui.com/.废话不多说,进入撸码环节. 1.通用方法编写 ...

  3. 前端到后台ThinkPHP开发整站(6)

    今天终于把整个后台管理系统弄好了,其实没什么难点,只是作为一个Thinphp学习的练手项目,这个项目,现在还只能算是做了一半,还有前台展示方面的功能没有完成.先过一遍后台的功能吧! 1.首页 2.菜单 ...

  4. 前端到后台ThinkPHP开发整站(5)

    今天周五了,这个项目做了五个晚上了,明天周末不用上班有一整天的时间来结束这个项目了,今晚主要把后台界面给弄出来了. 大概的整个后台界面就是这个样子了,接下来的工作就是搬砖了,一个个菜单功能填上去就是了 ...

  5. 前端到后台ThinkPHP开发整站(4)

    今晚继续我的这个项目的开发,今晚也是写的不多,主要写了一个菜单管理功能的CURD方法,前端界面还没有进行编写. 菜单管理Model层的代码: <?php namespace Common\Mod ...

  6. 前端到后台ThinkPHP开发整站(3)

    继续我的这个项目的第三晚的开发了,时间比较少,今晚写的代码不多,今晚仍然是造轮子写一个公共的控制器和一个公共的JS.直接上代码吧! 以下是一个公共的控制器,后台控制器都继承于它,构造函数中进行验证当前 ...

  7. 前端到后台ThinkPHP开发整站(7)

    今晚我继续这个项目的前台开发,把前台的做出来了,现在项目进行一个收尾工作了,还有栏目页和一个文章页的开发,做完这两个算是完成了.说到这里感觉有点松懈了,把剩下两个功能页面做完在吹吧,先看看今天弄的代码 ...

  8. 前端到后台ThinkPHP开发整站(完)

    久违了,今天终于抽空把最后的写完了,这是这个项目的最后一篇文章了,把前台的栏目控制器和文章内容控制器的功能实现了. 栏目控制器: <?php namespace Home\Controller; ...

  9. 前端资源多个产品整站一键打包&包版本管理(一)

    来新公司工作的第五个月.整站资源打包管理也提上了日程. 问题: 首先.什么是整站的打包管理呢? 我们公司的几个重要产品都在同一个webapp里面,但是,不同的开发部门独立开发不同的产品,长期以来,我们 ...

随机推荐

  1. 亲测有效!一种完美动态阈值白平衡算法 Java实现。

    几年没发文了,重新拿起技术! 最近做图像处理,要自动处理颜色平衡问题,很多什么直方图优化之类的,都不完美.所以在博客园找到了这个前辈的文章. http://www.cnblogs.com/Images ...

  2. Object-C知识点 (一) 常用知识点

    Object-C常用的知识点,以下为我在实际开发中用到的知识点,但是又想不起来,需要百度一下的知识点 #pragma mark -- isKindOfClass与isMemberOfClass isK ...

  3. JQuery实战——页面进度条效果

    今早逛阮一峰大神的博客 ECMAScript 6 入门 时候看到页面顶部有个进度条显示当前浏览的进度,如图: 顶部进度条会根据当前页面高度进行宽度调整,实战一番,视觉使用animated方法实现.下面 ...

  4. Spring Security 概念基础 验证流程

    Spring Security 概念基础 验证流程 认证&授权 认证:确定是否为合法用户 授权:分配角色权限(分配角色,分配资源) 认证管理器(Authentication Manager) ...

  5. spring +springmvc+mybatis组合applicationContext.xml文件配置

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  6. Storm集群安装部署步骤

    本文以Twitter Storm官方Wiki为基础,详细描述如何快速搭建一个Storm集群,其中,项目实践中遇到的问题及经验总结,在相应章节以"注意事项"的形式给出. 1. Sto ...

  7. 使用gulp实现文件压缩及浏览器热加载

    一.安装gulp 首先,你要安装过nodejs,如果没有安装过的同学请自行下载.  先再命令行里输入   npm install gulp -g   下载gulp 二.创建gulp项目 创建一个你需要 ...

  8. Spring Security @PreAuthorize 拦截无效

    1. 在使用spring security的时候使用注解,@PreAuthorize("hasAnyRole('ROLE_Admin')") 放在对方法的访问权限进行控制失效,其中 ...

  9. 多元线性回归模型的特征压缩:岭回归和Lasso回归

    多元线性回归模型中,如果所有特征一起上,容易造成过拟合使测试数据误差方差过大:因此减少不必要的特征,简化模型是减小方差的一个重要步骤.除了直接对特征筛选,来也可以进行特征压缩,减少某些不重要的特征系数 ...

  10. HDU 2203 亲和串(KMP)

    题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=2203 题目: 亲和串 Time Limit: 3000/1000 MS (Java/Others)   ...