<% dim art set king=new kingcms king.checkplugin king.path '检查插件安装状态 set art=new article select case action case"" king_def end select set art=nothing set king=nothing ' *** Copyright © KingCMS.com All Rights Reserved *** sub king_def() dim query,i,space,rn,dp,sql,qcount,selected,tt,rs,listname,listpath,tquery tt=timer tquery=quest("query",4) space=quest("space",2) select case cstr(space) case"" query=king.likey("artkeywords",tquery) case"1" query=king.likey("artdescription",tquery) case"2" query=king.likey("artauthor",tquery) case else query=king.likey("arttitle",tquery) end select rn=quest("rn",2) if len(rn)=0 then rn=20 if int(rn)>100 then rn=100 if int(rn)<10 then rn=10 king.ol="
" '有提交搜索值的时候,显示搜索结果 if len(query)>0 then sql="select top 1000 artid,listid,arttitle,artdescription,artdate,artgrade,artpath,artauthor,artfrom from kingart where "&query&" order by artdate desc;" qcount=conn.execute("select count(artid) from kingart where artshow=1 and "&query&";")(0) king.ol="
" king.ol="

" if validate(space,2) then king.ol=" " king.ol=" " end if king.ol="" king.ol="

" king.ol="
" king.ol="
" set dp=new record dp.create sql dp.purl="search.asp?rn="&rn&"&pid=$&query="&server.urlencode(quest("query",0))&"&space="&space '有符合搜索项目的时候显示 if dp.length>=0 then king.ol="

"&replace(art.lang("tip/search"),"[***number***]",formatnumber(qcount,0,true))&"

" king.ol=dp.plist '循环显示搜索结果列表 for i=0 to dp.length set rs=conn.execute("select listname,listpath from kingart_list where listid="&dp.data(1,i)&";") if not rs.eof and not rs.bof then listname=rs(0) listpath=rs(1) end if rs.close set rs=nothing king.ol="
" king.ol="

"&keylight(htmlencode(dp.data(2,i)),tquery)&"

" king.ol="

"&keylight(htmlencode(king.lefte(dp.data(3,i),200)),tquery)&"

" king.ol="

"&htmlencode(listname)&" - "&htmlencode(dp.data(7,i))&" - "&dp.data(4,i)&"

" king.ol="
" next king.ol=dp.plist '没有项目符合搜索结果的时候显示 else king.ol="

"&art.lang("tip/noart")&"

" end if set dp=nothing king.ol="
" if validate(space,2) then king.value "guide",encode(""&king.lang("common/search")&" >> "&htmlencode(quest("query",0))) else king.value "guide",encode(king.lang("common/tag")&" >> "&htmlencode(quest("query",0))) end if '没有提交搜索值,显示搜索框 else king.ol="
" king.ol="

" king.ol="

" king.ol="

" king.ol="

" king.ol="

" king.ol="
" king.ol="
" king.value "guide",encode(king.lang("common/search")) end if king.ol="
" king.value "title",encode(tquery) king.value "inside",encode(replace(king.writeol,"[**timer**]",formatnumber(timer-tt,2,true))) king.outhtm king.stemplate,"",king.invalue end sub %>