discuz 后台设置不同版块使用不同模板-Discuz教程下载

discuz 后台设置不同版块使用不同模板

开通本站Svip会员,全站资源免费下
转自网络,无法追寻到原始出处。亲测有效。

本功能不是选择“风格方案”,一个风格就够了。

!实现此功能需要动数据库。


操作:

1.为表pre_forum_forum添加两个字段:

ffile,主题列表模板
vfile,主题内容模板
手动添加或执行
  1. ALTER TABLE `pre_forum_forum` ADD `ffile` CHAR( 40 ) NOT NULL AFTER `styleid` , ADD `vfile` CHAR( 40 ) NOT NULL AFTER `ffile`;
复制代码
2.添加后台表单
打开source/admincp/admincp_forums.php,找到
  1. showsetting('forums_edit_extend_threadcache', 'threadcachesnew', $forum['threadcaches'], 'text');
复制代码
其下添加
  1. showsetting('forums_edit_extend_ffile', 'ffilenew', $forum['ffile'], 'text');
  2. showsetting('forums_edit_extend_vfile', 'vfilenew', $forum['vfile'], 'text');
复制代码
找到
  1. 'styleid' => $_GET['styleidnew']
复制代码
其下添加
  1. 'ffile'=>$_GET['ffilenew'],
  2. 'vfile'=>$_GET['vfilenew'],
复制代码
3.给主题列表模板增加判断
打开source/module/forum/forum_forumdisplay.php,找到
  1. include template($template);
复制代码
注释掉,其下添加
  1. if($_G['forum']['ffile'])
  2. $skinfile=$_G['forum']['ffile'];
  3. else
  4. $skinfile = $template;
  5. include template($skinfile);
复制代码
4.给主题内容模板增加判断
打开source/module/forum/forum_viewthread.php,找到
  1. include template('diy:forum/viewthread'.$sufix.':'.$_G['fid']);
复制代码
注释掉,其下添加
  1. if($_G['forum']['vfile']){
  2. include template($_G['forum']['vfile']);
  3. }
  4. else{
  5. include template('diy:forum/viewthread'.$sufix.':'.$_G['fid']);
  6. }
复制代码
5.给后台表单添加名称和说明
打开source/language/lang_admincp.php,找到
  1. forums_edit_extend_threadcache_comment
复制代码
其下添加
  1. 'forums_edit_extend_ffile' => '主题列表模板文件:',
  2. 'forums_edit_extend_ffile_comment' => '填写格式如forum/forumdisplay,为空则默认为forumdisplay',
  3. 'forums_edit_extend_vfile' => '版块内容模板文件:',
  4. 'forums_edit_extend_vfile_comment' => '填写格式如forum/viewthread,为空则默认为viewthread',
复制代码
至此修改完成。

打开后台,版块编辑,扩展设置,页面缓存系数之下有新增的表单,按说明填写即可。
1.jpg

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部