国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

DedeCms分類信息聯動篩選,省級與地市分開聯動

2024-07-12 09:06:04
字體:
來源:轉載
供稿:網友

DedeCms分類信息聯動篩選,省級與地市分開聯動,注意:只適用于5.6版,其它版本沒有測試,只應用于分類信息模型。其它聯動可參照修改。

可能標題說的不是很清楚,下面以圖為示例:

DedeCms分類信息聯動篩選,省級與地市分開聯動

如上圖所示,默認是顯示北京的區縣,當點擊上海市時,地市處顯示上海的縣區。這下大家伙明白了吧!

現在開始代碼修改操作,只需要修改一個文件。

打開/include/taglib/infolink.lib.php,找到:

Copy to ClipboardLiehuo.Net Codes引用的內容:[www.CUOxin.com]
//地區鏈接 if(empty($nativeplace)) { foreach($em_nativeplaces as $eid=>$em) { if($eid % 500 != 0) continue; $fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>/r/n"; } } else { $sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 ); $toptype = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplace%500) ) ); $fields['nativeplace'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'><b>{$em_nativeplaces[$toptype]}</b></a> >> "; foreach($em_nativeplaces as $eid=>$em) { if($eid < $toptype+1 || $eid > $toptype+499) continue; if($eid == $nativeplace) { $fields['nativeplace'] .= " <b>{$em}</b>/r/n"; } else { $fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>/r/n"; } } } 

把上面注釋掉,然后在下面添加如下代碼:

Copy to ClipboardLiehuo.Net Codes引用的內容:[www.CUOxin.com]foreach($em_nativeplaces as $eid=>$em) { if($eid % 500 != 0) continue; $fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}'>{$em}</a>/r/n"; } //地區鏈接 if(empty($nativeplace)) { foreach($em_nativeplaces as $eid=>$em) { if($eid > 999 ) continue; $fields['diqu'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}'>{$em}</a>/r/n"; } } else { $sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 ); $toptype = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplace%500) ) ); foreach($em_nativeplaces as $eid=>$em) { if($eid < $toptype+1 || $eid > $toptype+499) continue; if($eid == $nativeplace) { $fields['diqu'] .= " <b><a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}'>{$em}</a></b>/r/n"; } else { $fields['diqu'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}'>{$em}</a>/r/n"; } } } 

保存就可以了。謝謝閱讀烈火網提供的DedeCMS教程。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 绥宁县| 获嘉县| 伊宁市| 营口市| 奉化市| 凤山市| 抚州市| 鸡西市| 定结县| 贞丰县| 杂多县| 许昌县| 巩留县| 扶风县| 肃北| 嘉义市| 车险| 大埔区| 景谷| 印江| 桃江县| 额敏县| 柘荣县| 汝南县| 庆元县| 三穗县| 大关县| 新河县| 瑞丽市| 乌兰浩特市| 婺源县| 巩义市| 镇巴县| 监利县| 当阳市| 汨罗市| 寻甸| 辉南县| 慈利县| 个旧市| 五常市|