dede 跳转属性不直接显示跳转问题
|
下面是脚本之家 jb51.cc 通过网络收集整理的代码片段。脚本之家小编现在分享给大家,也给大家做个参考。 dedecms 织梦里,有些文章需要跳转到其他页面,操作很简单,在后台选中文章的“跳转”属性,其下方会弹出“跳转网址”文本框,录入跳转到的地址,保存即可。但是,在生成页面后,发现在该文章的链接不是“跳转网址”里设置的地址,而是动态地址,类似:/plus/view.php?aid=14107。而我想让它直接链接到我设置的地址里。解决方法: 1、找到:/include/helpers/channelunit.helper.php。 2、在该文件里找到:if($rank!=0 || $ismake==-1 || $typeid==0 || $money>0),大概在 160 行。 3、将该行及该行一下部分替换: if($rank!=0 || $ismake==-1 || $typeid==0 || $money>0) { //动态文章 if($cfg_rewrite == 'Y') { return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html'; } else { return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid"; } } 替换为: if($rank!=0 || $ismake==-1 || $typeid==0 || $money>0) { //--------跳转网址不经过中间页直接显示----------------begin---by Maker Cloud global $dsql; $flag = $dsql->GetOne("select * from dede_archives where id = $aid;"); $flag = $flag['flag']; if(preg_match("/j/",$flag)) { $addontable = $dsql->GetOne("select art.id,cht.addtable from dede_arctype art left join dede_channeltype cht on art.channeltype = cht.id where art.id = $typeid"); $addtable = $addontable['addtable']; $GoUrl = $dsql->GetOne("select redirecturl from $addtable where aid = $aid"); $redirecturl = $GoUrl['redirecturl']; if($redirecturl != '') { return $redirecturl; } } //--------跳转网址不经过中间页直接显示----------------end---by Maker Cloud //动态文章 if($cfg_rewrite == 'Y') { return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html'; } else { return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid"; } } 4、重新生成即可。 以上是脚本之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。如果觉得脚本之家网站内容还不错,欢迎将脚本之家网站推荐给程序员好友。 (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
