前端到后台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里面,但是,不同的开发部门独立开发不同的产品,长期以来,我们 ...
随机推荐
- c# ProxyServer 代理服务器 不是很稳定
/**C# Programming Tips & Techniquesby Charles Wright, Kris Jamsa Publisher: Osborne/McGraw-Hill ...
- java项目(非ssm等框架)下的quartz定时器任务
第一步:引包 要使用Quartz,必须要引入以下这几个包: 1.log4j-1.2.16 2.quartz-2.1.7 3.slf4j-api-1.6.1.jar 4.slf4j-log4j12-1. ...
- 从源码的角度看Activity是如何启动的
欢迎访问我的个人博客,原文链接:http://wensibo.top/2017/07/03/Binder/ ,未经允许不得转载! 大家好,今天想与大家一起分享的是Activity.我们平时接触的最多的 ...
- Javascript之学习笔记每日更新
1.输出文本 document.write(Date());输出当前时间 2.使用Jacascript改变HTML元素 //定义一个p标签,此p标签带有id元素 <p id="demo ...
- centos7使用cobbler(2.8)批量部署操作系统之一
一. 批量部署操作系统的前提 要想批量部署操作系统,得具备以下条件: 客户机支持pxe网络引导 服务器端和客户端建立网络通信(DHCP) 服务器端要有可供客户机开机引导的引导文件 服务器端的可引 ...
- 字符的读写函数:fgetc()和fputc()
fgetc(); 功能: 从文件中读取字符. 头文件: #include <stdio.h> 函数原型:int fgetc(FILE *stream); 返 ...
- hdu_5964:平行四边形
打重现赛时,一点思路也没有,然后又看到这题AC数那么少,就直接放弃了.今天重新看了看,借鉴了下别人的,发现此题应该算是一道可解题. 看上去,这题的ans是同时有两个点作为自变量的函数(然而n^2复杂度 ...
- Java虚拟机--垃圾收集
Java虚拟机 1. JVM运行时数据区域 参考书籍:<深入理解Java虚拟机:JVM高级特性与最佳实践,第二版> 资料参考:http://blog.csdn.net/nms312/art ...
- spring默认欢迎页设置
简单配置的方式,直接展示静态网页,不经过Controller. web.xml 中什么没有配置任何有关欢迎页的信息!其实这时等效于如下配置:这个会由Web容器最先访问! //-未指定欢迎页时,缺省等于 ...
- 创建PDF模板,java添加内容、导出下载PDF
本文主要内容是:用java在pdf模板中加入数据,图片. 废话不多说,举个非常简单的例子: 首先创建word文档,导出PDF. 用 软件adobe acrobat打开,操作步骤如图: 在指定位置添加文 ...