Dedecms联动类型两级变一级的方法
2010-06-11 21:11
246 查看
DEDEcms联动类别一般都是两级联动,怎么把这个两级的修改成一级的,我想有些同学也有这样的问题吧。那么小编就把要修改的代码和大家共享下。
首先要修改infolink.lib.php
注释掉一下代码:
首先要修改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>";
}
}
*/
换成$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>";
}
}
希望对大家有点用处吧。呵呵
{
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>";
}
}
相关文章推荐
- 织梦dedecms系统首页调用分类信息联动类别(地区,类型等)的方法如下
- DEDECMS首页循环调用一级栏目和二级栏目的实现方法
- dedecms自定义表单解决联动类型
- dedecms联动类别的图文使用方法
- DedeCMS 新建模型自定义联动类别调用及修改方法
- asp.net mvc 两级分类联动方法示例
- 两级联动select刷新后其值保持不变的实现方法
- DedeCMS 友情链接按分类网站类型调用的方法
- dedecms5.7 联动类型无法显示
- DEDECMS自定义联动类别调用及修改方法
- 织梦dedecms怎么调用自定义联动类型
- dedecms前台会员无法上传图片类型的解决方法
- asp.net mvc 两级分类联动方法示例
- 黄聪:DEDECMS联动调用时提示“你设定了字段为联动类型,但系统中没找到与你定义的字段名相同的联动组名!”
- dedecms 根据key取得联动类型(enum)值
- 织梦dedecmsV5.7联动类型无法显示的处理方法
- 织梦DEDECMSV5.7联动类型无法显示的处理方法
- 黄聪:dedecms联动类型里,知道枚举值,如何转换为枚举名
- dedecms织梦内容模型加入联动类型后不显示
- 织梦dedecms调用一级、二级栏目方法