<% '****************************************************************************************** ' 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开奖结果彩票控 世界股票指数有哪些 时时彩万能缩水手机版 上海快三专家预测号 股票融资买入额什么意思 免费精准8码中特公开 北京赛车公式走势规律 北京快3跨度形态势图 体彩内蒙古11选5玩法 如何选择快乐十分10个好方法 20选5群英会走势图 河北快3开奖结果公告 新浪股票群 捕鱼达人3旧版本去哪里下载 2020体育彩票开奖结果 广东十一选五高手