DEDEcms联动类别一般都是两级联动,怎么把这个两级的修改成一级的,我想有些同学也有这样的问题吧。那么小编就把要修改的代码和大家共享下。

首先要修改infolink.lib.php
注释掉一下代码:

/*
        $sontype = ( ($househx % 500 != 0) ? $househx : 0 );
        $toptype = ( ($househx % 500 == 0) ? $househx : ( $househx-($membertype%500) ) );
        $fields['househx'] = "<a 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 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 href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&househx={$eid}&nativeplace={$nativeplace}'".$navclass.">{$em}</a>";
            }     
        }

希望对大家有点用处吧。呵呵

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2021-06-11
  • 2021-12-21
  • 2021-12-18
  • 2021-05-05
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2022-01-06
  • 2022-12-23
  • 2021-06-26
  • 2021-05-30
  • 2021-11-30
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案