前端到后台ThinkPHP开发整站(1)
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)的更多相关文章
- 前端到后台ThinkPHP开发整站--php开发案例
前端到后台ThinkPHP开发整站--php开发案例 总结 还是需要做几个案例,一天一个为佳,那样才能做得快. 从需求分析着手,任务体系要构建好,这样才能非常高效. 转自: 前端到后台ThinkPHP ...
- 前端到后台ThinkPHP开发整站(2)
我这次使用的ThinkPHP版本是:3.2.3版本,还有会使用到一个弹出层插件,叫 layer,官网地址是:http://layer.layui.com/.废话不多说,进入撸码环节. 1.通用方法编写 ...
- 前端到后台ThinkPHP开发整站(6)
今天终于把整个后台管理系统弄好了,其实没什么难点,只是作为一个Thinphp学习的练手项目,这个项目,现在还只能算是做了一半,还有前台展示方面的功能没有完成.先过一遍后台的功能吧! 1.首页 2.菜单 ...
- 前端到后台ThinkPHP开发整站(5)
今天周五了,这个项目做了五个晚上了,明天周末不用上班有一整天的时间来结束这个项目了,今晚主要把后台界面给弄出来了. 大概的整个后台界面就是这个样子了,接下来的工作就是搬砖了,一个个菜单功能填上去就是了 ...
- 前端到后台ThinkPHP开发整站(4)
今晚继续我的这个项目的开发,今晚也是写的不多,主要写了一个菜单管理功能的CURD方法,前端界面还没有进行编写. 菜单管理Model层的代码: <?php namespace Common\Mod ...
- 前端到后台ThinkPHP开发整站(3)
继续我的这个项目的第三晚的开发了,时间比较少,今晚写的代码不多,今晚仍然是造轮子写一个公共的控制器和一个公共的JS.直接上代码吧! 以下是一个公共的控制器,后台控制器都继承于它,构造函数中进行验证当前 ...
- 前端到后台ThinkPHP开发整站(7)
今晚我继续这个项目的前台开发,把前台的做出来了,现在项目进行一个收尾工作了,还有栏目页和一个文章页的开发,做完这两个算是完成了.说到这里感觉有点松懈了,把剩下两个功能页面做完在吹吧,先看看今天弄的代码 ...
- 前端到后台ThinkPHP开发整站(完)
久违了,今天终于抽空把最后的写完了,这是这个项目的最后一篇文章了,把前台的栏目控制器和文章内容控制器的功能实现了. 栏目控制器: <?php namespace Home\Controller; ...
- 前端资源多个产品整站一键打包&包版本管理(一)
来新公司工作的第五个月.整站资源打包管理也提上了日程. 问题: 首先.什么是整站的打包管理呢? 我们公司的几个重要产品都在同一个webapp里面,但是,不同的开发部门独立开发不同的产品,长期以来,我们 ...
随机推荐
- 使用Scribefire在博客中插入语法高亮
效果如下, 文字1 int cool void main() { cout<<"hello world!"<<endl } 文字2 经过一番折腾,终于搞定了 ...
- Java虚拟机面试重点-------------内存分配和回收策略
1 对象优先分配在Eden区 对象优先在Eden进行分配,大多数情况下,对象在新生代Eden区进行分配.当Eden区没有足够的空间进行分配时,虚拟机会发起一次Minor GC. 新生代GC(Ninor ...
- 以芯片直读方式得到的全盘镜像解析及ext4日志区域解析
之前在centos中分析了/dev/sda1下的结构,但当对象是一块以芯片直读方式作出来的全盘镜像呢? 这次以安卓手机的全盘镜像为对象,尝试按照ext4文件系统结构手动解析,加强对ext4文件系统.E ...
- Pandas数据处理实战:福布斯全球上市企业排行榜数据整理
手头现在有一份福布斯2016年全球上市企业2000强排行榜的数据,但原始数据并不规范,需要处理后才能进一步使用. 本文通过实例操作来介绍用pandas进行数据整理. 照例先说下我的运行环境,如下: w ...
- 【Mysql基本知识整理】
一.简介 1.什么是数据库? 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据. 2.关系型数据库 ...
- 【MySQL故障处理】 Seconds_Behind_Master= NULL Error_code: 1197
版本:mysql 5.6.32**错误描述:**```Error_code: 1197Last_Error: Worker 3 failed executing transaction '352aa3 ...
- GIT - 代码管理工具之命令集
GIT 是一个快速.可扩展的分布式版本控制系统,它具有极为丰富的命令集,对内部系统提供了高级操作和完全访问.它会把你的每次提交的文件的全部内容都会记录下来. GIT特点 速度 简单的设计 对非线性开发 ...
- JavaScript垃圾收集-标记清除和引用计数
JavaScript具有自动垃圾收集机制,执行环境会负责管理代码执行过程中使用的内存. 垃圾收集机制原理:垃圾收集器会按照固定的时间间隔(或代码执行中预定的收集时间), 周期性地执行这一操作:找出那些 ...
- (转)Java并发编程:Callable、Future和FutureTask
Java并发编程:Callable.Future和FutureTask 在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Runnable接口. 这2种方式都有一 ...
- (转)PL SQL Developer 使用总结
如果OS为windows 7 64位系统,Oracle版本为 Oracle 11g 64 安装PL SQL Developer 请参考 http://myskynet.blog.51cto.co ...