在论坛看到、自己也碰到好多次添加不了企业模板的情况、不是点击提交按钮没反应,就是出错报错、
现在把解决办法给公布一下、
打开/phpcms/templates/default/yp/companytplnames.php这个文件
<?php
return array (
1 =>
array (
'id' => 1,
'title' => '默认模板',
'dir' => 'com_default',
'thumb' => 'http:/域名/statics/images/yp/demo_default.jpg',
'aid' => '1549',
'defaulttpl' => 1,
'groups' => '2,6,4,5,16,17',
),
);
?>
上面就是默认的
添加新的效果如下
<?php
return array (
1 =>
array (
'id' => 1,
'title' => '默认模板',
'dir' => 'com_default',
'thumb' => 'http://域名/statics/images/yp/demo_default.jpg',
'aid' => '1549',
'defaulttpl' => 1,
'groups' => '2,6,4,5,16,17',
),
2 =>
array (
'id' => 2,
'title' => 'VIP会员',
'dir' => 'com_a',
'thumb' => 'http://域名/uploadfile/2011/0906/20110906103446918.jpg',
'aid' => '190',
'defaulttpl' => 0,
'groups' => '5',
),
);
?>
title就是模板名称
dir是模板文件夹的名字
thumb就是模板的缩略图,做展示用的
aid是附件表中模板缩略图的aid
defaulttpl是否为默认模板(一般为0)
'groups' 使用权限(可以使用这套模板的会员组ID。这里可以随便写,因为添加后,在后台可以管理的)
添加好之后,保存文件
再去到/phpcms/templates/default/yp/ 这个目录,建立和“dir”这个变量的值一样的文件夹,用于存放企业模板。
/statics/yp/这个目录也要建立一个相同的文件夹,用于存放CSS、JS等样式文件