DEDEcms联动类别一般都是两级联动,怎么把这个两级的修改成一级的呢?我跟大家分享下现实方法:
1.首先要修改infolink.lib.php
注释掉一下代码:
/*
$sontype = ( ($househx % 500 != 0) ? $househx : 0 );
$toptype = ( ($househx % 500 == 0) ? $househx : ( $househx-($membertype%500) ) );
$fields['househx'] = "<a rel="nofollow noopener noreferrer" href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&househx={$toptype}&nativeplace={$nativeplace}'><b>{$em_househxs[$toptype]}</b></a> ";
下级显示不显示
foreach($em_househxs as $eid=>$em)
{
if($eid < $toptype+1 || $eid > $toptype+499) continue;
if($eid == $househx) {
$fields['househx'] .= " <b>{$em}</b>";
}
else {
$fields['househx'] .= " <a rel="nofollow noopener noreferrer" href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&househx={$eid}&nativeplace={$nativeplace}'>{$em}</a>";
}
}
*/
换成
foreach($em_househxs as $eid=>$em)
{
if($eid % 500 != 0) continue;
if(isset($_GET['househx']))
{
$navclass=$_GET['househx'];
if ($navclass==$eid)
{
$navclass=' style=color:#ff0000';
}
$fields['househx'] .= " <a rel="nofollow noopener noreferrer" href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&househx={$eid}&nativeplace={$nativeplace}'".$navclass.">{$em}</a>";
}
}
即可!
<script type="text/javascript"> document.body.oncopy = function (){ setTimeout(function (){ var text = clipboardData.getData("text"); if (text){ texttext = text + "rn本文转载于DeDeCms模板中心(genban.org)- 织梦模板 DEDECMS企业模板 DEDECMS仿站 dede模板下载:http://www.genban.org-原文链接:"+location.href; clipboardData.setData("text", text); } },100) } </script>
到此这篇关于Dedecmsv5.7联动类型两级变一级的如何解决方法就介绍到这了。在我的生命中,从未遭受过失败,我所遇到的,都是暂时的挫折罢了。更多相关Dedecmsv5.7联动类型两级变一级的如何解决方法内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!