<% '****************************************************************************************** ' Software name: Max(馬克斯) Content Management System ' Version:4.0 ' Web: http://www.maxcms.net ' Author: 石頭(maxcms2008@qq.com),yuet,長明,酒瓶 ' Copyright (C) 2005-2009 馬克斯官方 版權所有 ' 法律申明:MaxCMS程序所有代碼100%原創、未引入任何網上代碼,對一切抄襲行為、堅決嚴肅追究法律責任 '****************************************************************************************** dim searchLimitFlag,searchtime:searchLimitFlag=0:searchtime=5'searchLimitFlag為顯示搜索控制標識(0不開啟,1開啟),searchtime為搜索間隔秒數 dim action : action = getForm("action", "get") dim searchTemplatePath dim searchword,searchType,page:searchword=getForm("searchword","both") : searchType=getForm("searchtype","both") : page=getForm("page","both") '控制緩存前幾頁 Const CachePage=3 Function GetSearchPage dim i,cacheName,pSize,rsObj,whereStr,curTypeId,pCount,searchTemplateName,tempStr,searchPageStr 'if isNul(searchword) then echoMsgAndGo "請輸入搜索關鍵字",searchtime:die "" if searchLimitFlag=1 then checkSearchTimes searchTemplateName="search.html" searchTemplatePath = "/"&sitePath&"template/"&defaultTemplate&"/"&templateFileFolder&"/"&searchTemplateName pSize = getPageSizeOnCache(searchTemplatePath,"search","") : if isNul(pSize) then pSize=12 dim x:x=EscapeSql(searchword) select case clng(searchType) case -1 : whereStr=" where m_recycle=0 AND (m_name like '%"&x&"%' OR m_actor like '%"&x&"%' OR m_director like '%"&x&"%')" case 0 : whereStr=" where m_recycle=0 AND m_name like '%"&x&"%'" case 1 : whereStr=" where m_recycle=0 AND (m_actor like '%"&x&"%' OR m_director like '%"&x&"%')" case 2 : whereStr=" where m_recycle=0 AND m_publisharea like '%"&x&"%'" case 3 : whereStr=" where m_recycle=0 AND m_publishyear like '%"&x&"%'" case 4 : whereStr=" where m_recycle=0 AND m_letter = '"&UCase(searchword)&"'" case 5 : whereStr=" where m_recycle=0 AND m_lang like '%"&x&"%'" end select if ""&searchword="" then whereStr=" where 1=2" set rsObj = conn.db("select m_id from {pre}data "&whereStr,"records1") rsObj.pagesize = pSize cacheName="parse_search_" if cacheStart=1 then if cacheObj.chkCache(cacheName) then templateObj.content = cacheObj.getCache(cacheName) else parseSearchPart cacheObj.setCache cacheName,templateObj.content end if else parseSearchPart end if tempStr = templateObj.content: pCount = rsObj.pagecount tempStr=replaceStr(tempStr,"{maxcms:searchword}",searchword):tempStr=replaceStr(tempStr,"{searchpage:page}",page): tempStr=replaceStr(tempStr,"{maxcms:searchnum}",rsObj.recordcount) with templateObj : .content=tempStr : .ParsePageList "",page,pCount,"search":.parseIf() : searchPageStr = .content : end with GetSearchPage=searchPageStr rsObj.close:set rsObj = nothing End Function Sub parseSearchPart with templateObj .load(searchTemplatePath) : .parseTopAndFoot():.parseSelf():.parseGlobal():.content=replaceCurrentTypeId(.content):.parseMenuList(""):.parseAreaList():.parseTopicList():.parseVideoList():.parseNewsList() end with End Sub Sub checkSearchTimes if not isNul(getForm("searchword", "post")) then if rCookie("maxcms2_search")="ok" then echoMsgAndGo "搜索限制為"&searchtime&"秒一次",searchtime,true:die "" wCookieInTime "maxcms2_search","ok","s",searchtime 'echo " 上海快三遗漏速查 重庆时时彩官网 河南快三开奖结果50期 10倍杠杆配资 时时彩软件哪个预测好 内蒙古快3开奖走势图结果 高手只炒一只股票19年钒价2019年为何大跌 辽宁11选5交流群 彩吧论坛,论坛首页 陕西体彩十一选五玩法 11选5天津中奖规则 幸运飞艇全国统一开奖号码 甘肃快三走势图甘肃快3走势图一定牛 百度 同花顺手机炒股软件安全吗 排列五中奖规则及奖金 福彩3d和值走势连线