1.1beta房产首页的搜索的地区默认显示的是第二级的分类,下面教大家如何改成显示第一级分类。
方法:
找到source/function/function_category.php文件
搜索如下代码
- $districtsearchlist = array();
- foreach($_G['cache']['category_arealist_'.$mod]['district'] as $aid => $district) {
- foreach($district as $k => $v) {
- $districtsearchlist[$k] = $v;
- }
- }
复制代码
改为
- $citysearchlist = array();
- foreach($_G['cache']['category_arealist_'.$mod]['city'] as $aid => $city) {
- $citysearchlist[$aid] = $city;
- }
复制代码 搜索- return createhtml($sortarray, $selectarray, $districtsearchlist);
复制代码 改为
- return createhtml($sortarray, $selectarray, $citysearchlist);
复制代码
搜索
- function createhtml($sortarray, $selectarray, $districtsearchlist) {
复制代码 改为
- function createhtml($sortarray, $selectarray, $citysearchlist) {
复制代码 搜索
- foreach($districtsearchlist as $did => $district) {
- $urlhtml .= '<li><a href="house.php?mod=list&filter=all&district='.$did.'&sortid='.$sortid.'" target="_blank">'.$district.'</a></li>';
- }
复制代码 改为
- foreach($citysearchlist as $did => $city) {
- $urlhtml .= '<li><a href="house.php?mod=list&filter=all&city='.$did.'&sortid='.$sortid.'" target="_blank">'.$city.'</a></li>';
- }
复制代码
懒的可以直接下载相应编码的文件覆盖。
效果图
|