PHPCMS 二次开发 房产模块 第一天

PHPCMS 二次开发 房产模块 应公司的要求,需要在两个月之内做出来一套全新的房产网站。经过数日的研究和分析,对房产类网站有了一个大概的了解。从而断定,在规

PHPCMS 二次开发 房产模块


应公司的要求,需要在两个月之内做出来一套全新的房产网站。经过数日的研究和分析,对房产类网站有了一个大概的了解。从而断定,在规定的时间内完成任务是一件很苛刻的要求。想来想去,最后还是在PHPCMS上做扩展。添加一个房产模块。

准备工作:
首先 服务器的选择。我是在WINDOWS SERVER 2003下 APACHE + PHP + MYSQL
大家可以自己去选择安装

其次 PHPCMS下载,貌似现在的PHPCMS已经出到了SP4了,而且自从顶级BOSS离开之后,本人也一直在关注TOPCMS 。呵呵,感觉他们有很多相同的地方哦。毕竟UI和架构都是同一个人吧。

第三步:
数据库机构导入。我们的数据库是针对于我们这次开发的安居网的需求而设计的。所以可能不是通用性的。我们主要针对的是新房和楼盘。下面就是其中之一的SQL,当然下面也省去了一部分字段。但是应该够用了。

 

代码
createtable anju_housing(
housingid mediumint(
8) unsigned notnull auto_increment comment '楼盘ID',
housingname
varchar(200) notnull comment '楼盘名称',
housingstatus mediumint(
8) unsigned notnull comment '楼盘状态',
thumbnail
char(200) null comment '缩略图地址',
videourl
char(200) null comment '视频URL地址',
areaid
smallint(5) unsigned notnull comment '所属区域',
housingaddress
varchar(200) notnull comment '楼盘地址',
bus
varchar(200) null comment '公交线路',
opentime
int(10) unsigned null comment '开盘时间',

primarykey(housingid)
)ENGINE
= MYISAM CHARACTERSET utf8 comment ='楼盘基本资料表'

 

 

在MYSQL里面运行,或者直接在PHPMYSQL里面导入都OK。

第四步:
在PHPCMS根目录下面建立文件夹 house
新建 house/install/mysql.sql

内容如下:

代码
INSERTINTO `phpcms_module` (`module`, `name`, `path`, `url`, `iscore`, `version`, `author`, `site`, `email`, `description`, `license`, `faq`, `tagtypes`, `setting`, `listorder`, `disabled`, `publishdate`, `installdate`, `updatedate`)
VALUES ('house', '房产', 'house/', '', 0, '1.0.0.0', 'http://5igo.net.cn/', 'http://www.33zhu.com/', '', '房产模块', '', '', '', '', 0, 0, '2010-05-21', '2010-05-21', '2010-05-21');

 

 



新建 house/install/extention.inc.php
内容如下:记住下面是SQL语句,而在这个文件里面需要把这个SQL变成PHP代码

代码
INSERTINTO phpcms_menu(parentid,name,image,url,description,target,style,js,groupids,roleids,isfolder,isopen,listorder,userid,keyid) VALUES (5, '房产模块', '', '', '', 'right', '', '', '', '', 1, 0, 0, 0,'house')

 

 


下面的'916'是上句中插入的房产模块的PARENTID

代码
INSERTINTO phpcms_menu(parentid,name,image,url,description,target,style,js,groupids,roleids,isfolder,isopen,listorder,userid,keyid) VALUES (916, '添加楼盘', '', '?mod=house&file=house&action=add', '', 'right', '', '', '', '', 0, 0, 0, 0,'house')

 

 



新建 house/install/config.inc.php
内容如下:

1 <?php
2  $module="house";
3  $modulename="房产";
4  $introduce="房产模块";
5  $author= http://5igo.net.cn/;
6 $authorsite= http://www.33zhu.com/;
7 $authoremail= binbin3056@163.com;
8 ?>

 

 



以下文件可以新建,空着那里。
新建admin/templates //存放管理模板
新建admin/admin.inc.php
新建admin/house.inc.php
新建include/common.inc.php
新建include/house.class.php

敲完这些之后,在PHPCMS后台系统管理->模块管理->添加模块->操作。
运行完全之后提示成功之后,房产模块也就成功安装了。


第一天结束。

您可能有感兴趣的文章
PHPCMS后台框架如何实现思路

phpcms模板

国内外主要的PHP开源CMS系统分析

phpcms数据库操作

phpcms模块开发简易好代码教程