发布时间:2023-07-31 17:19:26
来源:互联网
.
这是一篇很有收藏价值的文章《织梦cms联动两级变一级的办法》,在开发过程对大家很有帮助,小编结合实例代码给大家介绍的非常详细,需要的朋友可以参考下
织梦模板的联动类型两级可以变一级的,相信大家都很需要吧,现在就来说一下如何修改文件,找到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>";
}
} |
本文织梦cms联动两级变一级的办法到此结束。人永远不能停止梦想。梦想是心灵的养料,就像饭菜是身体的给养。人生路上我们常会看见自己的梦想破碎了,渴望落空了,但我们仍需做梦。小编再次感谢大家对我们的支持!