dede地区联动搜索 彻底解决办法,织梦技术
导读:织梦技术织梦技术本例以文章模型为列子0 添加 联动类型 地区1 plus/search.php ?php require_once(dirname(__FILE__)./../织梦模板网站dede手机模板。
本例以文章模型为列子 0 添加 联动类型 地区
1 plus/search.php <?php require_once(dirname(__FILE__)."/../include/common.inc.php"); require_once(DEDEINC."/arc.searchview.class.php");
$pagesize = (isset($pagesize) && is_numeric($pagesize)) ? $pagesize : 10; $typeid = (isset($typeid) && is_numeric($typeid)) ? $typeid : 0; $nativeplace = (isset($nativeplace) && is_numeric($nativeplace)) ? $nativeplace : 0; $channeltype = (isset($channeltype) && is_numeric($channeltype)) ? $channeltype : 0; $kwtype = (isset($kwtype) && is_numeric($kwtype)) ? $kwtype : 1; $mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;
if(!isset($orderby)) $orderby=”; else $orderby = eregi_replace(‘[^a-z]‘,”,$orderby);
if(!isset($searchtype)) $searchtype = ‘titlekeyword’; else $searchtype = eregi_replace(‘[^a-z]‘,”,$searchtype);
if(!isset($keyword)) $keyword = ”;
$oldkeyword = $keyword;
$keyword = FilterSearch(stripslashes($keyword));
//查找栏目信息 if(empty($typeid)) { $typenameCacheFile = DEDEROOT.’/data/cache/typename.inc’; if(!file_exists($typenameCacheFile) || filemtime($typenameCacheFile) < time()-(3600*24) ) { $fp = fopen(DEDEROOT.’/data/cache/typename.inc’, ‘w’); fwrite($fp, "<"."?php\r\n"); $dsql->SetQuery("Select id,typename From `ym_arctype`"); $dsql->Execute(); while($row = $dsql->GetArray()) { fwrite($fp, "\$typeArr[{$row['id']}] = ‘{$row['typename']}’;\r\n"); } fwrite($fp, ‘?’.'>’); fclose($fp); } //引入栏目缓存并看关键字是否有相关栏目内容 require_once($typenameCacheFile); if(isset($typeArr) && is_array($typeArr)) { foreach($typeArr as $id=>$typename) { $keywordn = str_replace($typename, ‘ ‘, $keyword); if($keyword != $keywordn) { $keyword = $keywordn; $typeid = $id; break; } } } }
声明: 本文由我的SEOUC技术文章主页发布于:2023-07-18 ,文章dede地区联动搜索 彻底解决办法,织梦技术主要讲述解决办法,标签,织梦网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_28900.html