str="" <% 'on error resume next if trim(Application("ConnectionString"))="" or trim(Application("ConnectionString"))<>"driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;" then Application("ConnectionString")="driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;" end if Function LinkURLs(strInput) Dim iCurrentLocation Dim iLinkStart Dim iLinkEnd Dim strLinkText Dim strOutPut strLinkText="" strOutput="" iCurrentLocation=1 Do while Instr(iCurrentLocation,strInput,"[url]",1)<>0 iLinkStart=Instr(iCurrentLocation,strInput,"[url]",1) iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/url]",1) If iLinkEnd=0 then iLinkEnd=len(strINput)+1 select case Mid(strInput,iLinkEnd-1,1) case ".","!","?" iLinkEnd=iLinkEnd-1 end select stroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation) strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/url]","") strOutput=strOutput & "" & strLinkText & "" iCurrentLocation=iLinkEnd Loop strOutput=strOutput & Mid(strInput,iCurrentLocation) LinkURLs=replace(strOutput,"[/url]","",1,-1,1) End Function Function LinkIMGs(strInput) Dim iCurrentLocation Dim iLinkStart Dim iLinkEnd Dim strLinkText Dim strOutPut strLinkText="" strOutput="" iCurrentLocation=1 Do while Instr(iCurrentLocation,strInput,"[img]",1)<>0 iLinkStart=Instr(iCurrentLocation,strInput,"[img]",1) iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/img]",1) If iLinkEnd=0 then iLinkEnd=len(strINput)+1 select case Mid(strInput,iLinkEnd-1,1) case ".","!","?" iLinkEnd=iLinkEnd-1 end select stroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation) strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/img]","") strOutput=strOutput & "" iCurrentLocation=iLinkEnd Loop strOutput=strOutput & Mid(strInput,iCurrentLocation) LinkIMGs=replace(strOutput,"[/img]","",1,-1,1) End Function Function LinkEmail(strInput) Dim iCurrentLocation Dim iLinkStart Dim iLinkEnd Dim strLinkText Dim strOutPut strLinkText="" strOutput="" iCurrentLocation=1 Do while Instr(iCurrentLocation,strInput,"[email]",1)<>0 iLinkStart=Instr(iCurrentLocation,strInput,"[email]",1) iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/email]",1) If iLinkEnd=0 then iLinkEnd=len(strINput)+1 select case Mid(strInput,iLinkEnd-1,1) case ".","!","?" iLinkEnd=iLinkEnd-1 end select stroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation) strLinkText=replace(Mid(strInput,iLinkStart+7,iLinkEnd-iLinkStart-7),"[/email]","") strOutput=strOutput & "" & strLinkText & "" iCurrentLocation=iLinkEnd Loop strOutput=strOutput & Mid(strInput,iCurrentLocation) LinkEmail=replace(strOutput,"[/email]","",1,-1,1) End Function function encrypt(ecode) Dim texts dim i for i=1 to len(ecode) texts=texts & chr(asc(mid(ecode,i,1))+i) next encrypt = texts end function function UBB(str) str=LinkURLs(str) str=LinkIMGs(str) str=LinkEmail(str) UBB=str end function function invert(str) invert=replace(replace(replace(replace(str,"<","<"),">",">"),"
","")," "," ") end function kind=request("kind") typeid=request("typeid") borderid=request("borderid") n=trim(request("n")) if n="" or IsNumeric(n)=false then n=12 end if set rs=server.createobject("adodb.recordset") if kind="img" then if borderid="" or IsNumeric(borderid)=false then sql="select top 1 * from news where imgsize<>0 and audit=1 order by ntime DESC" else sql="select top 1 * from news where borderid=" & cstr(borderid) & " and imgsize<>0 and audit=1 order by ntime DESC" end if end if if kind="hot" then if typeid="" then sql="select top " & n & " * from news where audit=1 order by ntime DESC" else sql="select top " & n & " * from news where typeid=" & cstr(typeid) & " and audit=1 order by ntime DESC" end if end if if kind="" then if borderid="" or IsNumeric(borderid)=false then sql="select top " & n & " * from news where typeid=" & cstr(typeid) & " and audit=1 order by ntime DESC" else sql="select top " & n & " * from news where borderid=" & cstr(borderid) & " and audit=1 order by ntime DESC" end if end if rs.open sql,conn,1,1 if not rs.eof and not rs.bof then if kind="img" then%> str=str + "" <%else %> str=str + "" <% do while not rs.eof %> str=str+"" <% rs.movenext loop if typeid="" and kind="" then set rs1=server.createobject("adodb.recordset") rs1.open "select typeid from border where borderid=" & cstr(borderid),conn,1,1 typeid=rs1("typeid") end if if kind="" then%> str=str+"" <%end if%> str=str + "" <% end if end if rs.close set rs=nothing %> str=str+ "
<%=trim(rs("topic"))%>
<%=rs("topic")%>
"+"\" target=_self><%if cstr(rs("imgsize")) <>0 then%>[ͼ]\ <%end if%><%=trim(rs("topic"))%>
¸ü¶à..  
" document.write (str)