<%
'================================================
'函数名：CreatedTextFiles
'作  用：写入文件的函数
'参  数：FileName -文件路径, body_内容
'================================================
Function CreatedTextFiles(FileName,body)
On Error Resume Next
If InStr(FileName, ":") = 0 Then FileName = Server.MapPath(FileName)
	Dim oStream
	Set oStream = CreateObject("ADODB.Stream")
	oStream.Type = 2 '设置为可读可写
	oStream.Mode = 3 '设置内容为文本
	oStream.Charset = "utf-8"
	oStream.Open
	oStream.Position = oStream.Size
	oStream.WriteText body
	oStream.SaveToFile FileName, 2
	oStream.Close
	Set oStream = Nothing
	If Err.Number <> 0 Then Err.Clear
	End Function
'================================================

   '最新贴子
function newsell(num,relid,le,he,ee)
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if

If saytk=100 Then response.write"<ul class=""alst"">"
  dim g,rs10
 if relid3<>0 then
gettest="where yc=0 and bbsid="&relid1&""
else
gettest="where yc=0"
end if

        set rs10 = server.createobject("adodb.recordset")
          rs10.open"select id,name,rc,bbsid from sell "&gettest&" order by id desc",conn,1,1
          If rs10.eof Then 
            response.write("还没有帖子！<br/>")
                  else
            rs10.Move(0)

                  g=1
            do while ((not rs10.EOF) and g <=num)
			If saytk=100 Then response.write"<li>"
if le="" or le=False then le=13 
If he=1 Then response.write ubbimg(ubblese9)
               response.write"<a href='/bbs/topic.asp?tid="&rs10("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
			   response.write left(UBB(rs10("name")),CLng(le))&"</a>"

			   If ee=1 then

			                  dim reCount10
               reCount10=conn.execute("Select count(ID) from [relist] where tid="&rs10("id"))(0)
			   response.write "(<a href=""/bbs/relist.asp?tid="&rs10("id")&"&amp;bbsid="&rs10("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount10&"</a>"
			   response.write"/"&rs10("rc")&")"
			   End if


			   response.write"<br/>"
			   If saytk=100 Then response.write"</li>"
                  rs10.MoveNext
                      g=g+1
                            loop
                   end If
				   If saytk=100 Then response.write"</ul>"

rs10.close
set rs10=nothing
end Function
'=================================
    '最热贴子
function hotsell(num,relid,le,he,ee)

  dim rsh10
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if

If saytk=100 Then response.write"<ul class=""alst"">"

 if relid3<>0 then
gettest="where yc=0 and bbsid="&relid1
else
gettest="where yc=0"
end if

        set rsh10 = server.createobject("adodb.recordset")
          rsh10.open"select id,name,rc,bbsid from sell "&gettest&" order by rc desc",conn,1,1
          If rsh10.eof Then 
            response.write("还没有帖子！<br/>")
                  else
            rsh10.Move(0)

                  g=1
            do while ((not rsh10.EOF) and g <=num)
			If saytk=100 Then response.write"<li>"

if le="" or le=False then le=13 
If he=1 Then response.write ubbimg(ubblese22)

               response.write"<a href='/bbs/topic.asp?tid="&rsh10("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
			   response.write left(UBB(rsh10("name")),CLng(le))&"</a>"

               If ee=1 Then
               Dim reCount11
               reCount11=conn.execute("Select count(ID) from [relist] where tid="&rsh10("id"))(0)
			   response.write "(<a href=""/bbs/relist.asp?tid="&rsh10("id")&"&amp;bbsid="&rsh10("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount11&"</a>"
			   response.write"/"&rsh10("rc")&")"
			   End if
			   response.write"<br/>"

			   If saytk=100 Then response.write"</li>"
                  rsh10.MoveNext
                      g=g+1
                            loop
                   end If
				   If saytk=100 Then response.write"</ul>"

rsh10.close
set rsh10=nothing
end Function
'=================================
'同城新帖
function newselll(num,relid,le,he,ee)
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if

  dim g,rs10

if le="" or le=False then le=13
If saytk=100 Then response.write"<ul class=""alst"">"
if relid3<>0 then
gettest="where yc=0 and bbsid="&relid1
else
gettest="where yc=0"
end if
        set rs10 = server.createobject("adodb.recordset")
          rs10.open"select id,bbsid,name,rc from sell "&gettest&" order by id desc",conn,1,1
          If rs10.eof Then 
            
                  else
            rs10.Move(0)

                  g=1
            do while ((not rs10.EOF) and g <=num)
			If saytk=100 Then response.write"<li>"

               response.write"[城]<a href='/bbs/topic.asp?tid="&rs10("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs10("name")),CLng(le))&"</a>"

			   If ee=1 then
               reCount10=conn.execute("Select count(ID) from [relist] where tid="&rs10("id"))(0)
			   response.write "(<a href=""/bbs/relist.asp?tid="&rs10("id")&"&amp;bbsid="&rs10("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount10&"</a>"
			   response.write"/"&rs10("rc")&")"
			   End If
			   response.write"<br/>"

			   If saytk=100 Then response.write"</li>"
                  rs10.MoveNext
                      g=g+1
                            loop
                   end If
If saytk=100 Then response.write"</ul>"
rs10.close
set rs10=nothing
end Function


   '回复动态

function relsell(num,relid,le,he,ee)
  dim h,rs11,rs111
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if


  dim g,rs10
 if relid3<>0 then
gettest="where yc=0 and bbsid="&relid1
else
gettest="where yc=0"
end if

        set rs11 = server.createobject("adodb.recordset")
          rs11.open"select id,name,rc,fname,bbsid from sell "&gettest&" order by retime desc",conn,1,1


          If rs11.eof Then 
            response.write("还没有帖子！<br/>")
                  else
            rs11.Move(0)

                  h=1
            do while ((not rs11.EOF) and h <=num)
If saytk=100 Then response.write"<div style='padding-left:15px;'><dt style='background:url(/main/img/indexbg.gif) 0 -474px no-repeat;padding-left:6px;'>"
if le="" or le=False then le=13 
If he=1 Then response.write ubbimg(ubblese10)
response.write "<a href='/bbs/topic.asp?tid="&rs11("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"

response.write left(UBB(rs11("name")),CLng(le))
response.write "</a><br/>"


If saytk=100 And ee=1 Then response.write"</dt></div>"

If ee=1 then
dim reCount
reCount=conn.execute("Select count(ID) from [relist] where tid="&rs11("id"))(0)
If saytk=100 Then response.write"<div style='padding-left:22px;'>"
response.write ubb(rs11("fname"))&"/阅"&ubb(rs11("rc"))&"/复"
if reCount<=0 then
response.write reCount
else
response.write "<a href=""/bbs/relist.asp?tid="&rs11("id")&"&amp;bbsid="&rs11("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount&"</a>"
end if
response.write"<br/>"
End if

If saytk=100 And ee<>1 Then response.write"</dt>"
If saytk=100 Then response.write"</div>"

                  rs11.MoveNext
                      h=h+1
                            loop
                   end if

rs11.close
set rs11=nothing
end function


   '最新精华
function jjsell(num,relid,le,he,ee)
If saytk=100 Then response.write"<ul class=""ulhot"">"
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if
 if relid3<>0 then
gettest="where yc=0 and jj=1 and bbsid="&relid1
else
gettest="where yc=0 and jj=1"
end if

        set rs12 = server.createobject("adodb.recordset")
          rs12.open"select id,bbsid,name,rc from sell "&gettest&" order by ID desc",conn,1,1
          If rs12.eof Then 
            response.write("没有精华帖子！努力啊。<br/>")
                  else
            rs12.Move(0)

                  q=1
            do while ((not rs12.EOF) and q <=num)
If saytk=100 Then response.write"<li>"
if le="" or le=False then le=13 
If he=1 Then response.write ubbimg(ubblese23)

               response.write"<a href='/bbs/topic.asp?tid="&rs12("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs12("name")),CLng(le))&"</a>"

			   If ee=1 then
               reCount12=conn.execute("Select count(ID) from [relist] where tid="&rs12("id"))(0)
			   response.write "(<a href=""/bbs/relist.asp?tid="&rs12("id")&"&amp;bbsid="&rs12("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount12&"</a>"
			   response.write"/"&rs12("rc")&")"
			   End If
			   response.write"<br/>"

			   If saytk=100 Then response.write"</li>"
                  rs12.MoveNext
                      q=q+1
                            loop
                   end If
If saytk=100 Then response.write"</ul>"
rs12.close
set rs12=nothing
end function

'随机帖子
function sjsell(num,relid,le,he,ee)
If saytk=100 Then response.write"<ul class=""alst"">"
relid2=relid
relid3=Replace(relid2,"|","")
 if instr(relid,"|")>0 then
relid1=Replace(relid,"|"," or bbsid=")
else
relid1=relid
end if

dim rs33
if relid3<>0 then
gettest="where yc=0 and bbsid="&relid1
else
gettest="where yc=0"
end if


'if relid<>0  then 
'gettest="where yc=1 and bbsid="&relid
'end if
		 set rs33 = server.createobject("adodb.recordset")
		 if dateSQl="1" then
		 
		 Randomize 
		'--- 得到总得记录数 
		dim countid 
		countid=conn.execute("select count(id) from sell")(0) 
		'--- 获得随机数 
		dim rndid 
		rndid=int(rnd*countid) 
		rndid=rndid+1
		rs33.open"select top "&num&" id,bbsid,name,rc from sell "&gettest&" and id in (select top "&rndid&" id from sell) order by id desc",conn,1,1
Else
        
        rs33.open"select top "&num&" id,bbsid,name,rc from sell "&gettest&" order by newid()",conn,1,1
 end if 
 while not rs33.EOF

 if le="" or le=False then le=13 
 If saytk=100 Then response.write"<li>"
If he=1 Then response.write ubbimg(ubblese11)
              response.write"<a href='/bbs/topic.asp?tid="&rs33("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs33("name")),CLng(le))&"</a>"

			  If ee=1 Then
			  Dim reCount14
               reCount14=conn.execute("Select count(ID) from [relist] where tid="&rs33("id"))(0)
			   response.write "(<a href=""/bbs/relist.asp?tid="&rs33("id")&"&amp;bbsid="&rs33("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount14&"</a>"
			   response.write "/"
			   response.write rs33("rc")
			   response.write ")"
			   End If

			   response.write"<br/>"

If saytk=100 Then response.write"</li>"
 rs33.MoveNext
  Wend
If saytk=100 Then response.write"</ul>"
rs33.close
set rs33=nothing
end function




   '最新相片
function photosell(num,relid)
  dim p,rs13
        set rs13 = server.createobject("adodb.recordset")
          rs13.open"select id,files from upfile where smallstr=1  and photoview=0 order by ID desc",conn,1,1
          If rs13.eof Then 
            response.write("")
                  else
            rs13.Move(0)

                  p=1
            do while ((not rs13.EOF) and p <=num)
response.write("<a href='/bbs/photoview.asp?id=" & rs13("id") & "&amp;saytk="&saytk&"&amp;sid="& sid &"'><img src='/bbs/" & rs13("files") & "' name='相片'  width='65' height='60'   longdesc='/bbs/" & rs13("files") & "' /></a>")

                  rs13.MoveNext
                      p=p+1
                            loop
                   end If
response.write("<br/>")
                rs13.close
        set rs13=nothing
end function




   '最新相片
function newphoto(num,relid)
 
        set rs13 = server.createobject("adodb.recordset")
          rs13.open"select id,files from upfile where smallstr=1  and photoview=0 order by ID desc",conn,1,1
          If rs13.eof Then 
            response.write("")
                  else
            rs13.Move(0)

                  p=1
            do while ((not rs13.EOF) and p <=num)
response.write("<a href='/bbs/photoview.asp?id=" & rs13("id") & "&amp;saytk="&saytk&"&amp;sid="& sid &"'><img src='/bbs/" & rs13("files") & "' name='相片' width='65' height='60'   longdesc='/bbs/" & rs13("files") & "' /></a>")
if p=3 then
response.write("<br/>")
end if
if p=6 then
response.write("<br/>")
end if
if p=9 then
response.write("<br/>")
end if
if p=12 then
response.write("<br/>")
end if
if p=15 then
response.write("<br/>")
end if
if p=18 then
response.write("<br/>")
end if
if p=21 then
response.write("<br/>")
end if
if p=24 then
response.write("<br/>")
end if
                  rs13.MoveNext
                      p=p+1
                            loop
                   end if
                rs13.close
        set rs13=nothing
end function

'随机相片
function sjphoto(num,relid)

dim rs44
'if relid<>0 then
gettest="where smallstr=1 and photoview=0"
'else
'gettest="where smallstr=1"
'end if
        set rs44 = server.createobject("adodb.recordset")
			 if dateSQl="1" then
		 
		 Randomize 
		'--- 得到总得记录数 
		
		countid=conn.execute("select count(id) from upfile")(0) 
		'--- 获得随机数 

		rndid=int(rnd*countid) 
		rndid=rndid+1
		
		
		
		
		rs44.open"select top "&num&" id,files from upfile "&gettest&" and id in (select top "&rndid&" id from upfile) order by id desc",conn,1,1
		else
        rs44.open"select top "&num&" * from upfile "&gettest&" order by NEWID()",conn,1,1
		end if
  while not rs44.EOF
              response.write("<a href='/bbs/photoview.asp?id=" & rs44("id") & "&amp;saytk="&saytk&"&amp;sid="& sid &"'><img src='/bbs/" & rs13("files") & "' name='图' width='65' height='60' longdesc='/bbs/" & rs13("files") & "' /></a>")
 rs44.MoveNext
  wend
                rs44.close
        set rs33=nothing
end function


'随机短信
function sjsms(num,le,he)
If saytk=100 Then response.write"<ul class=""ulhot"">"
if le="" or le=False then le=13 
dim sjs1conn
set sjs1conn=Createobject("ADODB.connection")
sjs1conn.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/sms_shujuku/saytk_sms")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
sjs1conn.open

       dim rssjs1
sjs1=num 
a=1
Do While a<=sjs1
set rssjs1 = server.createobject("adodb.recordset")
        
sqls1="select id,name from xywap_sms_list"
        rssjs1.open sqls1,sjs1conn,1,1
if rssjs1.recordcount <= 0 then
'       response.write"还没有短信！<br/>"
       else        
 randomize
sjj=int(rnd()*rssjs1.recordcount)+1
rssjs1.absoluteposition=sjj
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese12)
 response.write"<a href='/qtwap/sms/view.asp?id="&rssjs1("ID")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&UBB(left(rssjs1("name"),CLng(le)))&"</a>"
If saytk=100 Then 
response.write"</LI>"
Else
response.write"<br/>"
End if
end if
a=a+1
Loop
If saytk=100 Then response.write"</ul>"
rssjs1.close
set rssjs1=nothing
sjs1conn.close   
set sjs1conn=nothing
end function
 



'随机笑话
function xhsj(num,le,he)
If saytk=100 Then response.write"<ul class=""ulhot"">"
if le="" or le=False then le=13 
dim xh2conns
set xh2conns=Createobject("ADODB.connection")
xh2conns.connectionString="DBQ="&server.mappath("/shujuku/chajianshujuku/xhdq/saytk_xhdq")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
xh2conns.open

       dim rsxhsj
sjxh=num 
a=1
Do While a<=sjxh
set rsxhsj = server.createobject("adodb.recordset")
        sqlxh="select id,tel from jiudian"
        rsxhsj.open sqlxh,xh2conns,1,1
if rsxhsj.recordcount <= 0 then
'       response.write"还没有笑话！<br/>"
       else        
 randomize
sjj=int(rnd()*rsxhsj.recordcount)+1
rsxhsj.absoluteposition=sjj
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese13)
  response.write"<a href='/xhdq/view0.asp?id="&rsxhsj("ID")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&UBB(left(rsxhsj("tel"),CLng(le)))&"</a><br/>"
If saytk=100 Then response.write"</LI>"

end if
a=a+1
loop


If saytk=100 Then response.write"</ul>"
rsxhsj.close
set rsxhsj=nothing 
xh2conns.close
Set xh2conns=nothing
end function
 
'最新短信
function sms1(num,le,he) 
if le="" or le=False then le=13 
If saytk=100 Then response.write"<ul class=""alst"">"
dim s1conns
set s1conns=Createobject("ADODB.connection")
s1conns.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/sms_shujuku/saytk_sms")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
s1conns.open

        dim rss11,gass1   
 set rss11=Server.CreateObject("ADODB.Recordset")
  rss11.open "select id,name, from [xywap_sms_list] order by id desc",s1conns,1,1
if rss11.eof then 


response.write"暂无短信！<br/>"
                  else
            rss11.Move(0)
                  gass1=1
do while ((not rss11.EOF) and gass1 <=num) 
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese12)
response.write "<a href='/qtwap/sms/view.asp?id="&rss11("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rss11("name")),CLng(le))&"..</a><br/>"
If saytk=100 Then response.write"</LI>"
rss11.MoveNext
gass1=gass1+1
Loop                         
end If
If saytk=100 Then response.write"</ul>"
 rss11.close
 set rss11=Nothing
s1conns.close
Set s1conns=nothing
end function
'最新笑话
function xhdq1(num,le,he)
if le="" or le=False then le=13 
If saytk=100 Then response.write"<ul class=""alst"">"
dim xh1conns
set xh1conns=Createobject("ADODB.connection")
xh1conns.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/xhdq/saytk_xhdq")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
xh1conns.open
        dim rsxh1,gasxh1
   
 set rsxh1=Server.CreateObject("ADODB.Recordset")
  rsxh1.open "select id,tel from jiudian order by id desc",xh1conns,1,1
if rsxh1.eof then       
response.write"暂无笑话！<br/>"

                  else
            rsxh1.Move(0)
                  gasxh1=1
            do while ((not rsxh1.EOF) and gasxh1 <=num)
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese13)
response.write "<a href='/xhdq/view0.asp?id="&rsxh1("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rsxh1("tel")),CLng(le))&"</a><br/>"
If saytk=100 Then response.write"</LI>"


                  rsxh1.MoveNext
                      gasxh1=gasxh1+1
                            loop
                   end If
          If saytk=100 Then response.write"</ul>"        
rsxh1.close
set rsxh1=nothing
xh1conns.close
end function


'历史今天


function today(num,le,he)
if le="" or le=False then le=13 
If saytk=100 Then response.write"<ul class=""ulhot"">"
dim todayconns
set todayconns=Createobject("ADODB.Connection")
todayconns.ConnectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/history/saytk_history")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
todayconns.open
p=cint(request.QueryString("p"))
if p="" or p<1 then p=1
dim m,dd,d,c
	m=trim(request("mm"))
	dd=trim(request("dd"))
	d=split(date(),"-")
	if m="" or dd="" then 
		c=cstr(d(1)) &"-"& cstr(d(2))
	else
		c=cstr(m) &"-"& cstr(dd)
	end if

dim j,today1
today1=num 
set rstoday=Server.CreateObject("ADODB.Recordset")
rsstr="select demo,title from title where dates='"&c&"' order by id desc"
rstoday.open rsstr,todayconns,1,1
 If rstoday.eof Then 
response.write("暂无历史内容！<br/>")
else

rstoday.Move(0)
j=1

do while ((not rstoday.EOF) and j <=num)
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese14)
response.write""&rstoday("demo")&"<a href='/bbs/history/?saytk="&saytk&"&amp;sid="&sid&"'>"&left(rstoday("title"),CLng(le))&"</a><br/>"
If saytk=100 Then response.write"</LI>"
rstoday.MoveNext
j=j+1
Loop

end If
If saytk=100 Then response.write"</ul>"
rstoday.close
set rstoday=nothing
 todayconns.close    
end function


'聊天发言框
function roomksfy()

if saytk=>2 Then

Response.write "<form name=""form"" method=""post"" action=""/bbs/chat/chatsendok.asp?sid="&sid&"&amp;saytk="&saytk&""">"
%>
<input type="text" name="Chat" size="24" value=""/><br/>
<%
response.write "<input type=""hidden"" name=""ID"" value="""&saytkls&"""/>"
response.write "<input type=""hidden"" name=""TM"" value=""40""/>"
response.write "<input type=""hidden"" name=""Pa"" value=""10""/>"
response.write "<input type=""submit"" name=""Submit"" value=""快速发言""/></form>"

else
Response.write "<input type=""text"" emptyok=""true"" name=""Chat"&left(suijie,4)&"""/>"&chr(13)
Response.write "<anchor>快速发言"&chr(13)
Response.write "<go href=""/bbs/chat/chatsendok.asp?sid="&sid&"&amp;saytk="&saytk&""" method=""post"">"&chr(13)
Response.write "<postfield name=""ID""   value="""&saytkls&"""/>"&chr(13)
Response.write "<postfield name=""Chat"" value=""$(Chat)""/>"&chr(13)
Response.write "<postfield name=""TM""   value=""40""/>"&chr(13)
Response.write "<postfield name=""Pa"" value=""10""/>"&chr(13)
Response.write "</go></anchor>"
Response.write ""&chr(13)
end if


end function

'社区菜单
Function bbskjcd()

if myid<>0 then
if newguest > 0 then
Response.write "<img src='/bbs/xi.gif' alt='.' /><a href='/bbs/msgview.asp?url=" & Replace(Replace(R_url(), "sid=", "sidoo="), "&", "@@") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>您有(" & newguest & ")条新消息</a><br/>" & Chr(13)
end if
myfr= conn.execute("Select count(ID) from [myfriend] where cid="&myid)(0)
response.write "<a href='/bbs/show.asp?saytk="&saytk&"&amp;sid="&sid&"'>空间</a>|<a href='/bbs/mymsg.asp?saytk="&saytk&"&amp;sid="&sid&"'>信箱</a>(<a href='/bbs/msgview.asp?url=" & Replace(Replace(R_url(), "sid=", "sidoo="), "sid=", "sidoo=") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&newguest&"</a>)|<a href='/bbs/get.asp?action=f&amp;saytk="&saytk&"&amp;sid="&sid&"'>好友</a>(<a href='/bbs/myfriend.asp?saytk="&saytk&"&amp;sid="&sid&"'>"&myfr&"</a>)|<a href='/bbs/qian.asp?saytk="&saytk&"&amp;sid="&sid&"'>签到</a>" & Chr(13)
Else
response.write "<a href='/bbs/login.asp?sid="&sid&"&amp;saytk="&saytk&"'>登陆/注册</a>"
end if

end Function


'标题和编辑UBB
function ubb(str)
	str=trim(str)
	if IsNull(str) then exit Function
	str=replace(str,"[标识]","saytk=[saytk]&sid=[sid]")
	str = Replace(str, CHR(34), "&quot;")
	str = replace(str, ">", "＞")
	str = replace(str, "<", "＜")
	str = replace(str, "＆", "&amp;")
	str = replace(str, "＂", "&quot;")
	str = Replace(str, CHR(13), "")
	str = Replace(str, CHR(10), "\\")
	str = replace(str, "$", "＄")
	str = replace(str, "??", "？")
	str=replace(str,"无界浏览器","*")
	str=replace(str,"特码","*")
	str=replace(str,"法轮功","*")
	str=replace(str,"法轮大法","*")
	str=replace(str,"李洪志","*")
	str=replace(str,"大法弟子","*")
	str=replace(str,"大纪元","*")
	str=replace(str,"六合","*")
	str=replace(str,"真善忍","*")
	str=replace(str,"修炼大法","*")
	str=replace(str,"反共","*")
	str=replace(str,"台独","*")
	str=replace(str,"反革命","*")
	str=replace(str,"疆独","*")
	str=replace(str,"藏独","*")
	str=replace(str,"多党执政","*")
	str=replace(str,"江泽民","*")
	str=replace(str,"胡锦涛","*")
	str=replace(str,"罗干","*")
	str=replace(str,"镕基","*")
	str=replace(str,"李鹏","*")
	str=replace(str,"温家宝","*")
	str=replace(str,"温家堡","*")
	str=replace(str,"六四","*")
	str=replace(str,"玉蒲团","*")
	str=replace(str,"素女自拍","*")
	str=replace(str,"成人片","*")
	str=replace(str,"成人电影","*")
	str=replace(str,"激情图片","*")
	str=replace(str,"激情电影","*")
	str=replace(str,"成人小说","*")
	str=replace(str,"肉棍","*")
	str=replace(str,"淫水","*")
	str=replace(str,"乱伦","*")
	str=replace(str,"嫖鸡","*")
	str=replace(str,"小穴","*")
	str=replace(str,"换妻","*")
	str=replace(str,"淫魔","*")
	str=replace(str,"淫女","*")
	str=replace(str,"淫靡","*")
	str=replace(str,"口交","*")
	str=replace(str,"迷药","*")
	str=replace(str,"迷昏药","*")
	str=replace(str,"窃听器","*")
	str=replace(str,"六合彩","*")
	str=replace(str,"买卖枪支","*")
	str=replace(str,"退党","*")
	str=replace(str,"麻醉药","*")
	str=replace(str,"短信群发器","*")
	str=replace(str,"色情服务","*")
	str=replace(str,"出售枪支","*")
	str=replace(str,"摇头丸","*")
	str=replace(str,"出售假币","*")
	str=replace(str,"监听王","*")
	str=replace(str,"蒙汗","*")
	str=replace(str,"迷奸药","*")
	str=replace(str,"催情药","*")
	str=replace(str,"办理证件","*")
	str=replace(str,"反政府","*")
	str=replace(str,"乱伦","*")
	str=replace(str,"待开发票","*")
	str=replace(str,"代开发票","*")
	str=replace(str,"老虎机","*")
	str=replace(str,"换妻","*")
	str=replace(str,"曾道人","*")
	str=replace(str,"仿真假钞","*")
	str=replace(str,"裸聊","*")
	str = replace(str, chr(01), "")
	str = replace(str, chr(02), "")
	str = replace(str, chr(03), "")
	str = replace(str, chr(04), "")
	str = replace(str, chr(05), "")
	str = replace(str, chr(06), "")
	str = replace(str, chr(07), "")
	str = replace(str, chr(08), "")
	str = replace(str, chr(09), "")
	str = replace(str, chr(11), "")
	str = replace(str, chr(12), "")
	str = replace(str, chr(14), "")
	str = replace(str, chr(15), "")
	str = replace(str, chr(16), "")
	str = replace(str, chr(17), "")
	str = replace(str, chr(18), "")
	str = replace(str, chr(19), "")
	str = replace(str, chr(20), "")
	str = replace(str, chr(21), "")
	str = replace(str, chr(22), "")
	str = replace(str, chr(23), "")
	str = replace(str, chr(24), "")
	str = replace(str, chr(25), "")
	str = replace(str, chr(26), "")
	str = replace(str, chr(27), "")
	str = replace(str, chr(28), "")
	str = replace(str, chr(29), "")
	str = replace(str, chr(30), "")
	str = replace(str, chr(31), "")
	str=replace(str,"""","＂")
	str = replace(str, "", "")
	str = replace(str, "'", "”")
	str = replace(str, "`", "")
	str = replace(str, "€", "")
	str = replace(str, "―", "-")
	str=replace(str,"&amp;","←↑→")
	str=replace(str,"&","&amp;")
	str=replace(str,"←↑→","&amp;")
	str=replace(str,"'","&apos;")
	str=replace(str,"%1A","")
	str=replace(str,"$","$$")
        str=replace(str,"&#xFFE5;","*")
	str=replace(str,"&nbsp;","")
	str=replace(str,"","")
    str = replace(str, "", "")
    str = replace(str, "", "")
	str=replace(str,"","")
	str=replace(str," ","")
	str=replace(str,"","")
	str=replace(str,"","")
        str=replace(str,"sid=@@sid@@","sid="&sid&"")

	str = replace(str, "saytk=@@saytk@@", "saytk="&saytk&"")
        str = replace(str, "saytk=[saytk]", "saytk="&saytk&"")
        str=replace(str,Chr(13),"<br/>")
	ubb=str
end function
function ubb1(str)
	if IsNull(str) then exit function
	str=trim(str)
	str=replace(str,"[标识]","saytk=[saytk]&sid=[sid]")
	str=replace(str,"无界浏览器","*")
	str=replace(str,"特码","*")
	str=replace(str,"法轮功","*")
	str=replace(str,"法轮大法","*")
	str=replace(str,"李洪志","*")
	str=replace(str,"大法弟子","*")
	str=replace(str,"大纪元","*")
	str=replace(str,"六合","*")
	str=replace(str,"真善忍","*")
	str=replace(str,"修炼大法","*")
	str=replace(str,"反共","*")
	str=replace(str,"台独","*")
	str=replace(str,"反革命","*")
	str=replace(str,"疆独","*")
	str=replace(str,"藏独","*")
	str=replace(str,"多党执政","*")
	str=replace(str,"江泽民","*")
	str=replace(str,"胡锦涛","*")
	str=replace(str,"罗干","*")
	str=replace(str,"镕基","*")
	str=replace(str,"李鹏","*")
	str=replace(str,"温家宝","*")
	str=replace(str,"温家堡","*")
	str=replace(str,"六四","*")
	str=replace(str,"玉蒲团","*")
	str=replace(str,"素女自拍","*")
	str=replace(str,"成人片","*")
	str=replace(str,"成人电影","*")
	str=replace(str,"激情图片","*")
	str=replace(str,"激情电影","*")
	str=replace(str,"成人小说","*")
	str=replace(str,"肉棍","*")
	str=replace(str,"淫水","*")
	str=replace(str,"乱伦","*")
	str=replace(str,"嫖鸡","*")
	str=replace(str,"小穴","*")
	str=replace(str,"换妻","*")
	str=replace(str,"淫魔","*")
	str=replace(str,"淫女","*")
	str=replace(str,"淫靡","*")
	str=replace(str,"口交","*")
	str=replace(str,"迷药","*")
	str=replace(str,"迷昏药","*")
	str=replace(str,"窃听器","*")
	str=replace(str,"六合彩","*")
	str=replace(str,"买卖枪支","*")
	str=replace(str,"退党","*")
	str=replace(str,"麻醉药","*")
	str=replace(str,"短信群发器","*")
	str=replace(str,"色情服务","*")
	str=replace(str,"出售枪支","*")
	str=replace(str,"摇头丸","*")
	str=replace(str,"出售假币","*")
	str=replace(str,"监听王","*")
	str=replace(str,"蒙汗","*")
	str=replace(str,"迷奸药","*")
	str=replace(str,"催情药","*")
	str=replace(str,"办理证件","*")
	str=replace(str,"反政府","*")
	str=replace(str,"乱伦","*")
	str=replace(str,"待开发票","*")
	str=replace(str,"代开发票","*")
	str=replace(str,"老虎机","*")
	str=replace(str,"换妻","*")
	str=replace(str,"曾道人","*")
	str=replace(str,"仿真假钞","*")
	str=replace(str,"裸聊","*")
	str=replace(str,"&","&amp;")
	str = replace(str, ">", "&gt;")
	str = replace(str, "<", "&lt;")
	str=replace(str,"'","&apos;")
	str=replace(str,"""","&quot;")
	str=replace(str,"$","$$")
	str=replace(str,"&nbsp;","")
    str = replace(str, "", "")
    str = replace(str, "", "")
	str=replace(str,"","")
	str=replace(str," ","")
	str=replace(str,"","")
	str=replace(str,"","")
        str=replace(str,"sid=@@sid@@","sid="&sid&"")
        str=replace(str,"sid=[sid]","sid="&sid&"")
	str = replace(str, "saytk=[saytk]", "saytk="&saytk&"")
	str = replace(str, "saytk=@@saytk@@", "saytk="&saytk&"")
        str=replace(str,Chr(13),"<br/>")
        str=replace(str,"(time)",""&time()&"")
        str=replace(str,"(date)",""&date()&"")
        str=replace(str,"(now)",""&now()&"")
        str=replace(str,"(week)",""&WeekDayName(DatePart("w",Now))&"")
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	re.pattern="(\(cz2.0=(.[^\}]*)\))(.[^\}]*)(\(\/cz2.0\))"
if saytk>1 And saytk<>5 then
str= re.Replace(str,"<div style=""color:#$2;display:inline;"">$3</div>")
else
str= re.Replace(str,"$3")
end If
re.pattern="(\(img)\)(.{5,}?)\(/img\)"
str= re.Replace(str,"<img src="""&Replace("$2","[sid]","")&""" alt='.'/>")
re.pattern="(\[img\])(.[^\[]*)(\[\/img\])"
str= re.Replace(str,"<img src="""&Replace("$2","[sid]","")&""" alt='.'/>")
	re.pattern="(\(URL\))(.[^\(]*)(\(\/URL\))"
	str= re.Replace(str,"<a href=""$2"" >$2</a>")
	re.pattern="(\(URL=(.[^\(]*)\))(.[^\(]*)(\(\/URL\))"
	str= re.Replace(str,"<a href=""$2"" >$3</a>")
	re.pattern="(\[url\])(.[^\[]*)(\[\/url\])"
        str= re.Replace(str,"<a href=""$2"" >$2</a>")
	re.pattern="(\[url=(.[^\]]*)\])(.[^\[]*)(\[\/url\])"
	str= re.Replace(str,"<a href=""$2"" >$3</a>")
	re.pattern="(\(c\))(.[^\[]*)(\(\/c\))"
	str= re.Replace(str,"<a href=""wtai://wp/mc;$2"" >$2</a>")
	re.pattern="(\(c=(.[^\]]*)\))(.[^\[]*)(\(\/c\))"
	str= re.Replace(str,"<a href=""wtai://wp/mc;$2"" >$3</a>")
	re.pattern="(\(u\))(.[^\[]*)(\(\/u\))"
	str= re.Replace(str,"<u>$2</u>")
	re.pattern="(\(b\))(.[^\[]*)(\(\/b\))"
	str= re.Replace(str,"<b>$2</b>")
	re.pattern="(\(i\))(.[^\[]*)(\(\/i\))"
	str= re.Replace(str,"<i>$2</i>")
        re.Pattern="(\\\\)"
	str= re.Replace(str,"<br/>")
	set re=Nothing
	ubb1=str
end function

%>