<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% dim king,action:action=request("action") set king=new kingcms king.head 0,0 select case action case"","besttopic" king_def case else king.error("system/error") end select king_outhtm set king=nothing 'def *** *** www.KingCMS.com *** *** sub king_def() dim menuid,tmphtm,tmphtmlist,menupath,insidehtm,outhtm dim rs,data,i,j,invalue,themetype,info,topicattrib,topiclist,topicid dim pagenumber,insql,sql,bbstype,zebra dim jsnumber,jshtm,vmenupath,intmplist dim topiccount,topicpagecount,listhtm,invalues,isbot dim tpagecount isbot=king.robot() menuid=l1ll(1,8) sql="menutitle,menulanguage,menupath,menukeyword,menudescription,menuid1"'5 sql=sql&",menuname,bbsmaster,menutmplist,menutmp,bbstype"'10 if action="besttopic" then insql=" and topicbest=1 " set rs=conn.execute("select "&sql&" from kingmenu where menuid="&menuid&";") if not rs.eof and not rs.bof then data=rs.getrows() if ll11("0,1",data(10,0)) and king.pid<=7 and action="" then response.redirect king.inst&data(2,0)&"/index"&king.ext end if else king.error("system/error") end if set rs=nothing if isbot=false then select case cstr(data(10,0)) case"2" king.range 1,0 case"3" king.range 4,0 end select end if set rs=conn.execute("select hotreply from kingsystem where systemname='KingCMS';")'0 if not rs.bof and not rs.eof then info=rs.getrows() else king.error("system/error") end if set rs=nothing pagenumber=king.getlist(data(9,0),"bbs","number") king.language=data(1,0) tmphtmlist=data(8,0) menupath=data(2,0) bbstype=data(10,0) if action="" and cstr(data(10,0))="0" then if king.pid=1 then response.redirect king.inst&menupath&"/index"&king.ext elseif king.pid<=7 then response.redirect king.inst&menupath&"/index"&king.pid&king.ext end if end if king.rn=20 jsnumber=king.getlist(data(8,0),"bbs","number"):if II11(jsnumber,2) then king.rn=jsnumber zebra=king.getlist(data(8,0),"bbs","zebra") jshtm=king.getlist(data(8,0),"bbs",0) intmplist=king.getlist(data(8,0),"bbs",1) sql="topicid,bbstitle,topictype,bbscontent,topiclock,topichit,topicreply,topicup,topicbest,bbsimg,"'9 sql=sql&"sysdate,lastdate,lastpostuser,lastpostdate,isvote,userid,username,topicicon,menuid"'18 king.open "select "&sql&" from kingtopic where topicdel=0 and (menuid="&menuid&" or topicup=2) "&insql&" order by topicup desc,lastpostdate desc,topicid desc;",king.page&"?pid=$&rn="&king.rn&"&action="&action&"&/"&menuid&king.ext, king.rn for i=0 to king.length topicid=king.data(0,i) invalue="topictitle:"&I11II(htmlencode(king.data(1,i))) if cstr(king.data(4,i))="1" then'锁定 themetype="lock" else if datediff("h",king.data(10,i),tnow)<=8 then themetype="new" else themetype="old"'8小时内是否有回复贴 if king.data(6,i)>=info(0,0) then themetype=themetype&"hot" else themetype=themetype'多余10个帖子,就是热门 end if invalue=invalue&"|type:"'图标 if cstr(king.data(17,i))<>"0" then invalue=invalue&"|icon:"'帖子类型? end if invalue=invalue&"|reply:"&king.data(6,i)'回复数 invalue=invalue&"|hit:"&king.data(5,i)'查看次数 invalue=invalue&"|topicuser:"&I11II(htmlencode(king.data(16,i)))'作者 invalue=invalue&"|topicprofile:"&I11II(king.inst&king.path&"/user.asp?userid="&king.data(15,i))'作者信息 invalue=invalue&"|topicdate:"&I11II(king.data(10,i))'创贴时间 if ll11("2",king.data(7,i)) then'如果是总置顶贴,需要重新计算menupath值 set rs=conn.execute("select menupath,bbstype from kingmenu where menuid="&king.data(18,i)&";") if not rs.eof and not rs.bof then vmenupath=rs(0) bbstype=rs(1) else king.error("system/error") end if rs.close set rs=nothing else vmenupath=data(2,0) bbstype=data(10,0) end if if ll11("0,1",bbstype)=true then invalue=invalue&"|topicpath:"&I11II(king.inst&vmenupath&"/"&III11(king.data(10,i))&"/"&topicid&king.ext) if lllll("../"&vmenupath&"/"&III11(king.data(10,i))&"/"&topicid&king.ext)=false then king_sub10_page topicid,0 else invalue=invalue&"|topicpath:"&I11II(king.inst&king.path&"/topic.asp?/"&topicid&king.ext) end if '属性 if cstr(king.data(7,i))="2" then topicattrib=" " else topicattrib="" if cstr(king.data(7,i))="1" then topicattrib=topicattrib&" " if cstr(king.data(14,i))="1" then topicattrib=topicattrib&" " if cstr(king.data(8,i))="1" then topicattrib=topicattrib&" " if len(king.data(9,i))>0 then if ll11("jpeg,jpg,gif,png,bmp",lIl(king.data(9,i))) then topicattrib=topicattrib&"" else topicattrib=topicattrib&"" end if end if if king.data(2,i)<>"" then invalue=invalue&"|topictype:["&I11II(king.data(2,i))&"]" end if '( 1 2 ..5 ) topiclist=lllllI(king.inst&vmenupath&"/"&III11(king.data(10,i))&"/"&topicid,king.data(6,i),pagenumber,bbstype)'路径,总回贴数 ' tpagecount=(king.data(6,i)+1)/pagenumber ' if tpagecount>int(tpagecount) then tpagecount=int(tpagecount)+1 ' if tpagecount>1 then ' topiclist="(" ' for j=1 to tpagecount ' topiclist=topiclist&""&j&"" ' next ' topiclist=topiclist&")" ' else ' topiclist="" ' end if 'topic.asp?pid=2&/1066.htm invalue=invalue&"|topiclist:"&I11II(topiclist) invalue=invalue&"|topicattrib:"&I11II(topicattrib) invalue=invalue&"|lastuser:"&I11II(htmlencode(king.data(12,i)))'回复作者 invalue=invalue&"|lastprofile:"&I11II(king.inst&king.path&"/user.asp?username="&server.urlencode(king.data(12,i)))'回复者信息 invalue=invalue&"|lastdate:"&I11II(king.data(13,i))'最后回复 if i mod zebra=0 then invalue=invalue&"|zebra:0" else invalue=invalue&"|zebra:F" end if insidehtm=insidehtm&king.createhtm(jshtm,invalue) next topiccount=king.count topicpagecount=int(topiccount/king.rn):if (topiccount/king.rn)>topicpagecount then topicpagecount=topicpagecount+1'总页数 if action="" and ll11("0,1",data(10,0)) then listhtm=III1("/topiclist.asp?pid=$&rn="&king.rn&"&/"&menuid&king.ext,king.pid,topicpagecount,menupath)'url参数,pid当前页数,总页数 else listhtm=king.plist end if 'sql="menutitle,menulanguage,menupath,menukeyword,menudescription,menuid1"'5 'sql=sql&",menuname,bbsmaster,menutmplist,menutmp,bbstype"'10 invalues="title:"&I11II(htmlencode(data(0,0)))'页面总参数 invalues=invalues&"|keyword:"&I11II(htmlencode(king.cls(data(3,0)))) invalues=invalues&"|guide:"&I11II(king.guide(data(5,0))&data(6,0)) invalues=invalues&"|description:"&I11II(htmlencode(king.cls(data(4,0)))) invalues=invalues&"|addtopic:"&I11II("") invalues=invalues&I11II("") invalues=invalues&"|addvote:"&I11II("") invalues=invalues&I11II("") invalues=invalues&"|pagelist:"&I11II(listhtm) if action="" then invalues=invalues&"|besttopic:"&I11II("") invalues=invalues&I11II("") else if ll11("0,1",data(10,0)) then invalues=invalues&"|besttopic:"&I11II("") else invalues=invalues&"|besttopic:"&I11II("") end if invalues=invalues&I11II("") end if invalues=invalues&"|now:"&I11II(tnow) if len(data(7,0))>0 then invalues=invalues&"|masters:"&I11II(data(7,0)) else invalues=invalues&"|masters:"&I11II(king.lang("common/none")) end if outhtm=replace(tmphtmlist,intmplist,insidehtm) outhtm=king.create(outhtm,invalues,0) response.write outhtm ol="" end sub 'outhtm *** *** www.KingCMS.com *** *** sub king_outhtm() l403 end sub%>