discuz门户的频道栏目列表页模板修改后不生效的解决方法 [复制链接]

moqu8 2017-10-5

36 0
门户的频道栏目 列表页模板 修改后不生效。缓存也清空了。只能显示新建的时候选择的模板。换其他的模板都没
有用,还是显示以前的。缓存更新了。没有开启HTML,只有伪静态。

这其实是discuz系统的一个BUG

修复方法,修改文件 source\admincp\admincp_portalcategory.php  1025行  函数 remakediytemplate
添加一句红色的代码! 
代码中只检查数据库中是否存在 目标模板栏目和 模板目录, 不判断我改变了模板名称。
如果你修改的模板是一个目录下的,始终都不会更新'common_diy_data'数据表。
以至于你修改不生效! 除非你修改的模板是两个不同的目录的!

具体原因自己看代码理解。这应该是个BUG!

function remakediytemplate($primaltplname, $targettplname, $diytplname, $olddirectory){
           global $_G;
           if(empty($targettplname)) return false;
           $tpldirectory = '';
            if(strpos($primaltplname, ':') !== false) {
                      list($tpldirectory, $primaltplname) = explode(':', $primaltplname);
           }
           $tpldirectory = ($tpldirectory ? $tpldirectory : $_G['cache']['style_default']['tpldir']);
           $newdiydata = C::t('common_diy_data')->fetch($targettplname, $tpldirectory);
           if($newdiydata) {
                      if($newdiydata['primaltplname'] == $primaltplname) return false;
           }
           $diydata = C::t('common_diy_data')->fetch($targettplname, $olddirectory);
           $diycontent = empty($diydata['diycontent']) ? '' : $diydata['diycontent'];

最新回复 (0)
返回
支持中心
邮箱:winkill2012@qqcom
新站优化中!部分功能尚未完善,敬请谅解!
支持中心