EmpireCMS的使用

2018-06-22 05:26:44来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

1.下载安装empirecms

下载完成后解压将upload目录整体上传到服务器,并更名为empirecms_test

更改目录文件的权限:

chmod -R 777 empirecms_test

配置好web服务器可以访问empirecms_test:

server {
root C:/Users/liudaoqiang/project_test/empirecms_tes;
index index.php index.html;
server_name dev.empirecms_test.com;
# set $yii_bootstrap "index.html";
set $yii_bootstrap "index.php";

charset utf-8;

location / {
index $yii_bootstrap;
try_files $uri $uri/ $yii_bootstrap?$args;
if (!-e $request_filename) {
rewrite (.*) /index.php/$1;
}
}

location ~ ^/(protected|framework|nbproject|themes/\w+/views) {
deny all;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}

location ~ .*\.(js|css)?$ {
expires 7d;
}

#avoid processing of calls to unexisting static files by yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {

fastcgi_split_path_info ^(.+\.php)(.*)$;

#let yii catch the calls to unexising PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}

#fastcgi_next_upstream error timeout invalid_header http_500 http_503 http_404;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;

#PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;

}

location ~ /\.ht {
deny all;
}
}

 在hosts文件中加入该域名:

127.0.0.1     dev.empirecms_test.com

启动php-fpm及nginx:

@echo off
echo Starting PHP FastCGI...
RunHiddenConsole.exe D:/php5/php-cgi.exe -b 127.0.0.1:9000 -c D:/php5/php.ini
Exit

start  nginx

nginx -s reload

访问dev.empirecms_test.com/e/install安装empirecms,完成数据库表结构的导入和后台管理员账号的配置:

访问dev.empirecms_test.com/e/admin登录后台管理系统初始化内置的测试数据:

刷新完毕后,发现在empirecms_test的根目录下多了 article, download, flash, news, movie, photo等目录

访问前台首页dev.empirecms_test.com/index.html

 删除dev.empirecms_test.com/e/install目录,防止再次被安装覆盖:

 

 

2.empirecms模块的扩展开发:

新建数据表:

查看新建的数据表:

通过navicate查看数据表:

经过需求分析为数据表新增字段:

 

 

 修改字段的显示顺序:

增加系统模型:

查看已经增加的系统模型:

增加栏目(使用新生成的系统模型):

 

 

增加信息(在刚才生成的栏目的添加):

在后台查看刚生成的信息:

在前台查看添加项目栏目信息的表单:

 点击我要投稿

 导入与导出系统模型:

导出的模型其实为创建模型相关的数据表和相关联数据的脚本:

<?php
if(!defined('InEmpireCMS'))
{
exit();
}
?><?php
$empire->query(str_replace("phome_ecms_project",$dbtbpre."ecms_".$tbname,SetCreateTable("CREATE TABLE `phome_ecms_project` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`ttid` smallint(5) unsigned NOT NULL DEFAULT '0',
`onclick` int(10) unsigned NOT NULL DEFAULT '0',
`plnum` mediumint(8) unsigned NOT NULL DEFAULT '0',
`totaldown` mediumint(8) unsigned NOT NULL DEFAULT '0',
`newspath` char(20) NOT NULL DEFAULT '',
`filename` char(36) NOT NULL DEFAULT '',
`userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`username` char(20) NOT NULL DEFAULT '',
`firsttitle` tinyint(1) NOT NULL DEFAULT '0',
`isgood` tinyint(1) NOT NULL DEFAULT '0',
`ispic` tinyint(1) NOT NULL DEFAULT '0',
`istop` tinyint(1) NOT NULL DEFAULT '0',
`isqf` tinyint(1) NOT NULL DEFAULT '0',
`ismember` tinyint(1) NOT NULL DEFAULT '0',
`isurl` tinyint(1) NOT NULL DEFAULT '0',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`lastdotime` int(10) unsigned NOT NULL DEFAULT '0',
`havehtml` tinyint(1) NOT NULL DEFAULT '0',
`groupid` smallint(5) unsigned NOT NULL DEFAULT '0',
`userfen` smallint(5) unsigned NOT NULL DEFAULT '0',
`titlefont` char(14) NOT NULL DEFAULT '',
`titleurl` char(200) NOT NULL DEFAULT '',
`stb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`fstb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`restb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`keyboard` char(80) NOT NULL DEFAULT '',
`title` char(100) NOT NULL DEFAULT '',
`newstime` int(10) unsigned NOT NULL DEFAULT '0',
`titlepic` char(120) NOT NULL DEFAULT '',
`member_id` int(8) NOT NULL DEFAULT '0',
`member_name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `newstime` (`newstime`),
KEY `ttid` (`ttid`),
KEY `firsttitle` (`firsttitle`),
KEY `isgood` (`isgood`),
KEY `ispic` (`ispic`),
KEY `useridis` (`userid`,`ismember`),
KEY `member_id` (`member_id`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_data_1",$dbtbpre."ecms_".$tbname."_data_1",SetCreateTable("CREATE TABLE `phome_ecms_project_data_1` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`keyid` char(255) NOT NULL DEFAULT '',
`dokey` tinyint(1) NOT NULL DEFAULT '0',
`newstempid` smallint(5) unsigned NOT NULL DEFAULT '0',
`closepl` tinyint(1) NOT NULL DEFAULT '0',
`haveaddfen` tinyint(1) NOT NULL DEFAULT '0',
`infotags` char(80) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_index",$dbtbpre."ecms_".$tbname."_index",SetCreateTable("CREATE TABLE `phome_ecms_project_index` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`checked` tinyint(1) NOT NULL DEFAULT '0',
`newstime` int(10) unsigned NOT NULL DEFAULT '0',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`lastdotime` int(10) unsigned NOT NULL DEFAULT '0',
`havehtml` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `checked` (`checked`),
KEY `newstime` (`newstime`),
KEY `truetime` (`truetime`,`id`),
KEY `havehtml` (`classid`,`truetime`,`havehtml`,`checked`,`id`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_doc",$dbtbpre."ecms_".$tbname."_doc",SetCreateTable("CREATE TABLE `phome_ecms_project_doc` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`ttid` smallint(5) unsigned NOT NULL DEFAULT '0',
`onclick` int(10) unsigned NOT NULL DEFAULT '0',
`plnum` mediumint(8) unsigned NOT NULL DEFAULT '0',
`totaldown` mediumint(8) unsigned NOT NULL DEFAULT '0',
`newspath` char(20) NOT NULL DEFAULT '',
`filename` char(36) NOT NULL DEFAULT '',
`userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`username` char(20) NOT NULL DEFAULT '',
`firsttitle` tinyint(1) NOT NULL DEFAULT '0',
`isgood` tinyint(1) NOT NULL DEFAULT '0',
`ispic` tinyint(1) NOT NULL DEFAULT '0',
`istop` tinyint(1) NOT NULL DEFAULT '0',
`isqf` tinyint(1) NOT NULL DEFAULT '0',
`ismember` tinyint(1) NOT NULL DEFAULT '0',
`isurl` tinyint(1) NOT NULL DEFAULT '0',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`lastdotime` int(10) unsigned NOT NULL DEFAULT '0',
`havehtml` tinyint(1) NOT NULL DEFAULT '0',
`groupid` smallint(5) unsigned NOT NULL DEFAULT '0',
`userfen` smallint(5) unsigned NOT NULL DEFAULT '0',
`titlefont` char(14) NOT NULL DEFAULT '',
`titleurl` char(200) NOT NULL DEFAULT '',
`stb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`fstb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`restb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`keyboard` char(80) NOT NULL DEFAULT '',
`title` char(100) NOT NULL DEFAULT '',
`newstime` int(10) unsigned NOT NULL DEFAULT '0',
`titlepic` char(120) NOT NULL DEFAULT '',
`member_id` int(8) NOT NULL DEFAULT '0',
`member_name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `newstime` (`newstime`),
KEY `ttid` (`ttid`),
KEY `firsttitle` (`firsttitle`),
KEY `isgood` (`isgood`),
KEY `ispic` (`ispic`),
KEY `useridis` (`userid`,`ismember`),
KEY `member_id` (`member_id`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_doc_data",$dbtbpre."ecms_".$tbname."_doc_data",SetCreateTable("CREATE TABLE `phome_ecms_project_doc_data` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`keyid` char(255) NOT NULL DEFAULT '',
`dokey` tinyint(1) NOT NULL DEFAULT '0',
`newstempid` smallint(5) unsigned NOT NULL DEFAULT '0',
`closepl` tinyint(1) NOT NULL DEFAULT '0',
`haveaddfen` tinyint(1) NOT NULL DEFAULT '0',
`infotags` char(80) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_doc_index",$dbtbpre."ecms_".$tbname."_doc_index",SetCreateTable("CREATE TABLE `phome_ecms_project_doc_index` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`checked` tinyint(1) NOT NULL DEFAULT '0',
`newstime` int(10) unsigned NOT NULL DEFAULT '0',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`lastdotime` int(10) unsigned NOT NULL DEFAULT '0',
`havehtml` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `checked` (`checked`),
KEY `newstime` (`newstime`),
KEY `truetime` (`truetime`,`id`),
KEY `havehtml` (`classid`,`truetime`,`havehtml`,`checked`,`id`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_check",$dbtbpre."ecms_".$tbname."_check",SetCreateTable("CREATE TABLE `phome_ecms_project_check` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`ttid` smallint(5) unsigned NOT NULL DEFAULT '0',
`onclick` int(10) unsigned NOT NULL DEFAULT '0',
`plnum` mediumint(8) unsigned NOT NULL DEFAULT '0',
`totaldown` mediumint(8) unsigned NOT NULL DEFAULT '0',
`newspath` char(20) NOT NULL DEFAULT '',
`filename` char(36) NOT NULL DEFAULT '',
`userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`username` char(20) NOT NULL DEFAULT '',
`firsttitle` tinyint(1) NOT NULL DEFAULT '0',
`isgood` tinyint(1) NOT NULL DEFAULT '0',
`ispic` tinyint(1) NOT NULL DEFAULT '0',
`istop` tinyint(1) NOT NULL DEFAULT '0',
`isqf` tinyint(1) NOT NULL DEFAULT '0',
`ismember` tinyint(1) NOT NULL DEFAULT '0',
`isurl` tinyint(1) NOT NULL DEFAULT '0',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`lastdotime` int(10) unsigned NOT NULL DEFAULT '0',
`havehtml` tinyint(1) NOT NULL DEFAULT '0',
`groupid` smallint(5) unsigned NOT NULL DEFAULT '0',
`userfen` smallint(5) unsigned NOT NULL DEFAULT '0',
`titlefont` char(14) NOT NULL DEFAULT '',
`titleurl` char(200) NOT NULL DEFAULT '',
`stb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`fstb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`restb` tinyint(3) unsigned NOT NULL DEFAULT '1',
`keyboard` char(80) NOT NULL DEFAULT '',
`title` char(100) NOT NULL DEFAULT '',
`newstime` int(10) unsigned NOT NULL DEFAULT '0',
`titlepic` char(120) NOT NULL DEFAULT '',
`member_id` int(8) NOT NULL DEFAULT '0',
`member_name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `newstime` (`newstime`),
KEY `ttid` (`ttid`),
KEY `firsttitle` (`firsttitle`),
KEY `isgood` (`isgood`),
KEY `ispic` (`ispic`),
KEY `useridis` (`userid`,`ismember`),
KEY `member_id` (`member_id`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_project_check_data",$dbtbpre."ecms_".$tbname."_check_data",SetCreateTable("CREATE TABLE `phome_ecms_project_check_data` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`classid` smallint(5) unsigned NOT NULL DEFAULT '0',
`keyid` char(255) NOT NULL DEFAULT '',
`dokey` tinyint(1) NOT NULL DEFAULT '0',
`newstempid` smallint(5) unsigned NOT NULL DEFAULT '0',
`closepl` tinyint(1) NOT NULL DEFAULT '0',
`haveaddfen` tinyint(1) NOT NULL DEFAULT '0',
`infotags` char(80) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_infoclass_project",$dbtbpre."ecms_infoclass_".$tbname,SetCreateTable("CREATE TABLE `phome_ecms_infoclass_project` (
`classid` int(10) unsigned NOT NULL DEFAULT '0',
`zz_title` text NOT NULL,
`z_title` varchar(255) NOT NULL DEFAULT '',
`qz_title` varchar(255) NOT NULL DEFAULT '',
`save_title` varchar(10) NOT NULL DEFAULT '',
`zz_titlepic` text NOT NULL,
`z_titlepic` varchar(255) NOT NULL DEFAULT '',
`qz_titlepic` varchar(255) NOT NULL DEFAULT '',
`save_titlepic` varchar(10) NOT NULL DEFAULT '',
`zz_newstime` text NOT NULL,
`z_newstime` varchar(255) NOT NULL DEFAULT '',
`qz_newstime` varchar(255) NOT NULL DEFAULT '',
`save_newstime` varchar(10) NOT NULL DEFAULT '',
`zz_member_id` text NOT NULL,
`z_member_id` varchar(255) NOT NULL,
`qz_member_id` varchar(255) NOT NULL,
`save_member_id` varchar(10) NOT NULL,
`zz_member_name` text NOT NULL,
`z_member_name` varchar(255) NOT NULL,
`qz_member_name` varchar(255) NOT NULL,
`save_member_name` varchar(10) NOT NULL,
PRIMARY KEY (`classid`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query(str_replace("phome_ecms_infotmp_project",$dbtbpre."ecms_infotmp_".$tbname,SetCreateTable("CREATE TABLE `phome_ecms_infotmp_project` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`classid` int(10) unsigned NOT NULL DEFAULT '0',
`oldurl` char(200) NOT NULL DEFAULT '',
`checked` tinyint(1) NOT NULL DEFAULT '0',
`tmptime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`username` char(20) NOT NULL DEFAULT '',
`truetime` int(10) unsigned NOT NULL DEFAULT '0',
`keyboard` char(100) NOT NULL DEFAULT '',
`title` char(100) NOT NULL DEFAULT '',
`newstime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`titlepic` char(120) NOT NULL DEFAULT '',
`member_id` int(8) NOT NULL DEFAULT '0',
`member_name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `classid` (`classid`),
KEY `checked` (`checked`)
) TYPE=MyISAM",$ecms_config['db']['dbchar'])));

$empire->query("insert into ".$dbtbpre."enewstable(tbname,tname,tsay,isdefault,datatbs,deftb,yhid,mid,intb) values('$tbname','项目数据表','项目数据表',0,',1,','1',0,0,'0');");
$tid=$empire->lastid();
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('title','标题','text','\r\n<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#DBEAF5\">\r\n<tr> \r\n <td height=\"25\" bgcolor=\"#FFFFFF\">\r\n <?=\$tts?\"<select name=''ttid''><option value=''0''>标题分类</option>\$tts</select>\":\"\"?>\r\n <input type=text name=title value=\"<?=ehtmlspecialchars(stripSlashes(\$r[title]))?>\" size=\"60\"> \r\n <input type=\"button\" name=\"button\" value=\"图文\" onclick=\"document.add.title.value=document.add.title.value+''(图文)'';\"> \r\n </td>\r\n</tr>\r\n<tr> \r\n <td height=\"25\" bgcolor=\"#FFFFFF\">属性: \r\n <input name=\"titlefont[b]\" type=\"checkbox\" value=\"b\"<?=\$titlefontb?>>粗体\r\n <input name=\"titlefont[i]\" type=\"checkbox\" value=\"i\"<?=\$titlefonti?>>斜体\r\n <input name=\"titlefont[s]\" type=\"checkbox\" value=\"s\"<?=\$titlefonts?>>删除线\r\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;颜色: <input name=\"titlecolor\" type=\"text\" value=\"<?=stripSlashes(\$r[titlecolor])?>\" size=\"10\"><a onclick=\"foreColor();\"><img src=\"../data/images/color.gif\" width=\"21\" height=\"21\" align=\"absbottom\"></a>\r\n </td>\r\n</tr>\r\n</table>\r\n','标题',0,1,1,'\r\n <tr bgcolor=\"#FFFFFF\"> \r\n <td height=\"22\" valign=\"top\"><strong>[!--enews.name--]正则:</strong><br>\r\n (<input name=\"textfield\" type=\"text\" id=\"textfield\" value=\"[!--title--]\" size=\"20\">)</td>\r\n <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\r\n <tr> \r\n <td><textarea name=\"add[zz_title]\" cols=\"60\" rows=\"10\" id=\"textarea\"><?=ehtmlspecialchars(stripSlashes(\$r[zz_title]))?></textarea></td>\r\n </tr>\r\n <tr> \r\n <td><input name=\"add[z_title]\" type=\"text\" id=\"add[z_title]\" value=\"<?=stripSlashes(\$r[z_title])?>\">\r\n (如填写这里,将为字段的值)</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n',1,'CHAR','100',1,$tid,'$tbname',0,'',0,0,0,'\r\n<input name=\"title\" type=\"text\" size=\"42\" value=\"<?=\$ecmsfirstpost==1?\"\":DoReqValue(\$mid,''title'',stripSlashes(\$r[title]))?>\">\r\n',0,'',0,'60','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('special.field','特殊属性','','\r\n<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#DBEAF5\">\r\n <tr>\r\n <td height=\"25\" bgcolor=\"#FFFFFF\">信息属性: \r\n <input name=\"checked\" type=\"checkbox\" value=\"1\"<?=\$r[checked]?'' checked'':''''?>>\r\n 审核 &nbsp;&nbsp; 推荐 \r\n <select name=\"isgood\" id=\"isgood\">\r\n <option value=\"0\">不推荐</option>\r\n <?=\$ftnr[''igname'']?>\r\n </select>\r\n &nbsp;&nbsp; 头条 \r\n <select name=\"firsttitle\" id=\"firsttitle\">\r\n <option value=\"0\">非头条</option>\r\n <?=\$ftnr[''ftname'']?>\r\n </select></td>\r\n </tr>\r\n <tr> \r\n <td height=\"25\" bgcolor=\"#FFFFFF\">关键字&nbsp;&nbsp;&nbsp;: \r\n <input name=\"keyboard\" type=\"text\" size=\"52\" value=\"<?=stripSlashes(\$r[keyboard])?>\">\r\n <font color=\"#666666\">(多个请用&quot;,&quot;隔开)</font></td>\r\n </tr>\r\n <tr> \r\n <td height=\"25\" bgcolor=\"#FFFFFF\">外部链接: \r\n <input name=\"titleurl\" type=\"text\" value=\"<?=stripSlashes(\$r[titleurl])?>\" size=\"52\">\r\n <font color=\"#666666\">(填写后信息连接地址将为此链接)</font></td>\r\n </tr>\r\n</table>\r\n','特殊属性',0,1,0,'\r\n\r\n',2,'','0',0,$tid,'$tbname',0,'',0,0,0,'\r\n<input name=\"keyboard\" type=\"text\" size=42 value=\"<?=stripSlashes(\$r[keyboard])?>\">\r\n<font color=\"#666666\">(多个请用&quot;,&quot;隔开)</font>\r\n',0,'',0,'','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('titlepic','标题图片','img','\r\n<input name=\"titlepic\" type=\"text\" id=\"titlepic\" value=\"<?=\$ecmsfirstpost==1?\"\":ehtmlspecialchars(stripSlashes(\$r[titlepic]))?>\" size=\"45\">\r\n<a onclick=\"window.open(''ecmseditor/FileMain.php?type=1&classid=<?=\$classid?>&infoid=<?=\$id?>&filepass=<?=\$filepass?>&sinfo=1&doing=1&field=titlepic<?=\$ecms_hashur[ehref]?>'','''',''width=700,height=550,scrollbars=yes'');\" title=\"选择已上传的图片\"><img src=\"../data/images/changeimg.gif\" border=\"0\" align=\"absbottom\"></a> \r\n','标题图片',0,1,1,'\r\n <tr bgcolor=\"#FFFFFF\"> \r\n <td height=\"22\" valign=\"top\"><strong>[!--enews.name--]正则:</strong><br>\r\n ( \r\n <input name=\"textfield\" type=\"text\" id=\"textfield\" value=\"[!--titlepic--]\" size=\"20\">\r\n )</td>\r\n <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\r\n <tr>\r\n <td>附件前缀 \r\n <input name=\"add[qz_titlepic]\" type=\"text\" id=\"add[qz_titlepic]\" value=\"<?=stripSlashes(\$r[qz_titlepic])?>\"> \r\n <input name=\"add[save_titlepic]\" type=\"checkbox\" id=\"add[save_titlepic]\" value=\" checked\"<?=\$r[save_titlepic]?>>\r\n 远程保存 </td>\r\n </tr>\r\n <tr> \r\n <td><textarea name=\"add[zz_titlepic]\" cols=\"60\" rows=\"10\" id=\"add[zz_titlepic]\"><?=ehtmlspecialchars(stripSlashes(\$r[zz_titlepic]))?></textarea></td>\r\n </tr>\r\n <tr> \r\n <td><input name=\"add[z_titlepic]\" type=\"text\" id=\"titlepic5\" value=\"<?=stripSlashes(\$r[z_titlepic])?>\">\r\n (如填写这里,这就是字段的值)</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n',3,'CHAR','120',1,$tid,'$tbname',0,'',0,0,0,'\r\n<input type=\"file\" name=\"titlepicfile\" size=\"45\">\r\n',0,'',0,'60','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('newstime','发布时间','text','\r\n<input name=\"newstime\" type=\"text\" value=\"<?=\$r[newstime]?>\"><input type=button name=button value=\"设为当前时间\" onclick=\"document.add.newstime.value=''<?=\$todaytime?>''\">\r\n','发布时间',0,1,1,'\r\n <tr bgcolor=\"#FFFFFF\"> \r\n <td height=\"22\" valign=\"top\"><strong>[!--enews.name--]正则:</strong><br>\r\n (<input name=\"textfield\" type=\"text\" id=\"textfield\" value=\"[!--newstime--]\" size=\"20\">)</td>\r\n <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\r\n <tr> \r\n <td><textarea name=\"add[zz_newstime]\" cols=\"60\" rows=\"10\" id=\"textarea\"><?=ehtmlspecialchars(stripSlashes(\$r[zz_newstime]))?></textarea></td>\r\n </tr>\r\n <tr> \r\n <td><input name=\"add[z_newstime]\" type=\"text\" id=\"add[z_newstime]\" value=\"<?=stripSlashes(\$r[z_newstime])?>\">\r\n (如填写这里,将为字段的值)</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n',4,'INT','11',1,$tid,'$tbname',0,'',1,0,0,'\r\n\r\n',0,'',0,'','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('member_id','会员ID','select','<select name=\\\\\"member_id\\\\\" id=\\\\\"member_id\\\\\"><option value=\\\\\"\\\\\"<?=\$r[member_id]==\\\\\"\\\\\"?\\\\'' selected\\\\'':\\\\''\\\\''?>></option></select>','',1,1,1,'\r\n <tr bgcolor=\\\\\"#FFFFFF\\\\\"> \r\n <td height=\\\\\"22\\\\\" valign=\\\\\"top\\\\\"><strong>[!--enews.name--]正则:</strong><br>\r\n (<input name=\\\\\"textfield\\\\\" type=\\\\\"text\\\\\" id=\\\\\"textfield\\\\\" value=\\\\\"[!--member_id--]\\\\\" size=\\\\\"20\\\\\">)</td>\r\n <td><table width=\\\\\"100%\\\\\" border=\\\\\"0\\\\\" cellspacing=\\\\\"1\\\\\" cellpadding=\\\\\"3\\\\\">\r\n <tr> \r\n <td><textarea name=\\\\\"add[zz_member_id]\\\\\" cols=\\\\\"60\\\\\" rows=\\\\\"10\\\\\" id=\\\\\"textarea\\\\\"><?=ehtmlspecialchars(stripSlashes(\$r[zz_member_id]))?></textarea></td>\r\n </tr>\r\n <tr> \r\n <td><input name=\\\\\"add[z_member_id]\\\\\" type=\\\\\"text\\\\\" id=\\\\\"add[z_member_id]\\\\\" value=\\\\\"<?=stripSlashes(\$r[z_member_id])?>\\\\\">\r\n (如填写这里,将为字段的值)</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n',5,'INT','8',1,$tid,'$tbname',0,'',1,0,1,'<select name=\\\\\"member_id\\\\\" id=\\\\\"member_id\\\\\"><option value=\\\\\"\\\\\"<?=\$r[member_id]==\\\\\"\\\\\"?\\\\'' selected\\\\'':\\\\''\\\\''?>></option></select>',0,'',0,'','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsf(f,fname,fform,fhtml,fzs,isadd,isshow,iscj,cjhtml,myorder,ftype,flen,dotemp,tid,tbname,savetxt,fvalue,iskey,tobr,dohtml,qfhtml,isonly,linkfieldval,samedata,fformsize,tbdataf,ispage,adddofun,editdofun,qadddofun,qeditdofun,linkfieldtb,linkfieldshow,editorys,issmalltext,fmvnum) values('member_name','会员名称','text','<input name=\\\\\"member_name\\\\\" type=\\\\\"text\\\\\" id=\\\\\"member_name\\\\\" value=\\\\\"<?=\$ecmsfirstpost==1?\\\\\"\\\\\":ehtmlspecialchars(stripSlashes(\$r[member_name]))?>\\\\\" size=\\\\\"\\\\\">\r\n','',1,1,1,'\r\n <tr bgcolor=\\\\\"#FFFFFF\\\\\"> \r\n <td height=\\\\\"22\\\\\" valign=\\\\\"top\\\\\"><strong>[!--enews.name--]正则:</strong><br>\r\n (<input name=\\\\\"textfield\\\\\" type=\\\\\"text\\\\\" id=\\\\\"textfield\\\\\" value=\\\\\"[!--member_name--]\\\\\" size=\\\\\"20\\\\\">)</td>\r\n <td><table width=\\\\\"100%\\\\\" border=\\\\\"0\\\\\" cellspacing=\\\\\"1\\\\\" cellpadding=\\\\\"3\\\\\">\r\n <tr> \r\n <td><textarea name=\\\\\"add[zz_member_name]\\\\\" cols=\\\\\"60\\\\\" rows=\\\\\"10\\\\\" id=\\\\\"textarea\\\\\"><?=ehtmlspecialchars(stripSlashes(\$r[zz_member_name]))?></textarea></td>\r\n </tr>\r\n <tr> \r\n <td><input name=\\\\\"add[z_member_name]\\\\\" type=\\\\\"text\\\\\" id=\\\\\"add[z_member_name]\\\\\" value=\\\\\"<?=stripSlashes(\$r[z_member_name])?>\\\\\">\r\n (如填写这里,将为字段的值)</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n',6,'VARCHAR','64',1,$tid,'$tbname',0,'',0,0,1,'<input name=\\\\\"member_name\\\\\" type=\\\\\"text\\\\\" id=\\\\\"member_name\\\\\" value=\\\\\"<?=\$ecmsfirstpost==1?\\\\\"\\\\\":DoReqValue(\$mid,\\\\''member_name\\\\'',stripSlashes(\$r[member_name]))?>\\\\\" size=\\\\\"\\\\\">\r\n',0,'',0,'','0','0','','','','','','','0','0','');");
$empire->query("insert into ".$dbtbpre."enewsmod(mname,mtemp,mzs,cj,enter,tempvar,sonclass,searchvar,tid,tbname,qenter,mustqenterf,qmtemp,listandf,setandf,listtempvar,qmname,canaddf,caneditf,definfovoteid,showmod,usemod,myorder,orderf,isdefault,listfile,printtempid) values('项目系统模型','<table width=\\\\''100%\\\\'' align=center cellpadding=3 cellspacing=1 bgcolor=\\\\''#DBEAF5\\\\''><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>标题</td><td bgcolor=\\\\''ffffff\\\\''>[!--title--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>特殊属性</td><td bgcolor=\\\\''ffffff\\\\''>[!--special.field--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>标题图片</td><td bgcolor=\\\\''ffffff\\\\''>[!--titlepic--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>发布时间</td><td bgcolor=\\\\''ffffff\\\\''>[!--newstime--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>会员ID</td><td bgcolor=\\\\''ffffff\\\\''>[!--member_id--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>会员名称</td><td bgcolor=\\\\''ffffff\\\\''>[!--member_name--]</td></tr></table>','','标题<!--field--->title<!--record-->标题图片<!--field--->titlepic<!--record-->发布时间<!--field--->newstime<!--record-->会员ID<!--field--->member_id<!--record-->会员名称<!--field--->member_name<!--record-->','标题<!--field--->title<!--record-->特殊属性<!--field--->special.field<!--record-->标题图片<!--field--->titlepic<!--record-->发布时间<!--field--->newstime<!--record-->会员ID<!--field--->member_id<!--record-->会员名称<!--field--->member_name<!--record-->','标题<!--field--->title<!--record-->标题图片<!--field--->titlepic<!--record-->发布时间<!--field--->newstime<!--record-->会员ID<!--field--->member_id<!--record-->会员名称<!--field--->member_name<!--record-->','',',title,',$tid,'$tbname','标题<!--field--->title<!--record-->特殊属性<!--field--->special.field<!--record-->标题图片<!--field--->titlepic<!--record-->发布时间<!--field--->newstime<!--record-->会员ID<!--field--->member_id<!--record-->会员名称<!--field--->member_name<!--record-->',',title,','<table width=100% align=center cellpadding=3 cellspacing=1 bgcolor=#DBEAF5><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>标题</td><td bgcolor=\\\\''ffffff\\\\''>[!--title--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>特殊属性</td><td bgcolor=\\\\''ffffff\\\\''>[!--special.field--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>标题图片</td><td bgcolor=\\\\''ffffff\\\\''>[!--titlepic--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>发布时间</td><td bgcolor=\\\\''ffffff\\\\''>[!--newstime--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>会员ID</td><td bgcolor=\\\\''ffffff\\\\''>[!--member_id--]</td></tr><tr><td width=\\\\''16%\\\\'' height=25 bgcolor=\\\\''ffffff\\\\''>会员名称</td><td bgcolor=\\\\''ffffff\\\\''>[!--member_name--]</td></tr></table>','',0,'标题<!--field--->title<!--record-->标题图片<!--field--->titlepic<!--record-->发布时间<!--field--->newstime<!--record-->会员ID<!--field--->member_id<!--record-->会员名称<!--field--->member_name<!--record-->','项目',',title,titlepic,newstime,member_id,member_name,',',title,titlepic,newstime,member_id,member_name,',0,0,0,0,'',0,'',0);");
$mid=$empire->lastid();
?>

 

3.empirecms的栏目管理

前台菜单定制:

可以使用一个前台菜单,则在后台生成一个对应的栏目

在后台创建栏目时选择是否显示到导航时选择是

前台页面公共尾部:

可以在后台的模板/公共模板变量/管理模板变量

 

修改footer变量即可

 

自定义列表模板并使用自定义的列表模板:

首先在后台的模板/列表模板/管理列表模板 中复制一模板,并重命名

修改该列表模板的代码

例:

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:PHP 代码优化测试【Benchmark数据测试】

下一篇:PHP学习之旅——PHP环境搭建