本解决方案是在DEDECMS5.7中测试过的,当文档设置为跳转并添加跳转网址后如何不经过中转页而直接可以用标签arcurl在底层模板中显示redirecturl跳转网址。
找到DedeCMS文件:/include/helpers/channelunit.helper.php中,第157行处开始修改:
修改前:
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 oictoglobal $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 oicto//动态文章if($cfg_rewrite == ‘Y’){return $GLOBALS["cfg_plus_dir"]."/view-".$aid.’-1.html';}else{return $GLOBALS[‘cfg_phpurl’]."/view.php?aid=$aid";}}