dede 跳转属性直接显示跳转网址

织梦里,有些文章需要跳转到其他页面,操作很简单,在后台选中文章的“跳转”属性,其下方会弹出“跳转网址”文本框,录入跳转到的地址,保存即可。但是,在生成页面后,发现在该文章的链接不是“跳转网址”里设置的地址,而是动态地址,类似:/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 oicto
   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 oicto
//动态文章
if($cfg_rewrite == 'Y')
{
return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html';
}
else
{
return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid";
}
        }
4、重新生成即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值