<% '****************************************************************************************** ' 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 " 江苏11选5任三玩法推荐 2013棋牌评测网 河北排列五开奖结果19274期 快乐十分开奖结果一定牛 381818白小姐中特+开奖一 欧美股市即时行情 加拿大28预测 12技巧揭密绝中奖 云南11选5 香港五分彩人工计划