发布时间:2021-01-09 17:43:03
dede v57跳转网址直接链接到真实静态地址的修改方法
dede v57跳转网址直接链接到真实静态地址而非直接中转的PHP文件修改方法:1、打开根目录下:include/helpers/channelunit.helper.php 文件,
2、找到:
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)
{
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;
}
}
//动态文章
if($cfg_rewrite == 'Y')
{
return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html';
}
else
{
return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid";
}
}
//---后来我添加的结束----