
<%
'===============
function ubbimg(str)
str=replace(str,"[tid]",""&tid&"")
str=replace(str,"[date]",""&date&"")
str=replace(str,"[time]",""&time&"")
str=replace(str,"(name)",""&myni&"")
str=replace(str,"(myid)",""&myid&"")
str=replace(str,"(time)",""&time()&"")
str=replace(str,"(date)",""&date()&"")
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, "(lmsb)", "saytk="&saytk&"&amp;sid="&sid&"")
str=replace(str,"(now)",""&now()&"")
str=replace(str,"(week)",""&Right(WeekDayName(DatePart("w",Now)),1)&"")
str=replace(str,Chr(14),"\\")
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
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>")


set re=Nothing
ubbimg=str
end function
'===============
function ubbcode(str)
if IsNull(str) then exit function
str=trim(str)
if instr(1,str,"[新会员]",1)>0 then	
're.pattern="(\[zxhy\])"
'str= re.Replace(str,newuserinfo())
str = Replace(str,"[新会员]",newuserinfo())
end if

if instr(1,str,"[社区搜索]",1)>0 then	
str = Replace(str,"[社区搜索]",bbssearch())
end If
if instr(1,str,"[站内搜索]",1)>0 then	
str = Replace(str,"[站内搜索]",indexso())
end if

if instr(1,str,"[今日天气]",1)>0 then 
str = Replace(str,"[今日天气]",weather())
end if

if instr(1,str,"[顺计时]",1)>0 then 
str = Replace(str,"[顺计时]",chenliss())
end If

if instr(1,str,"[全站在线]",1)>0 then 
str = Replace(str,"[全站在线]",onlineCoun11())
end if
if instr(1,str,"[仿腾讯在线提示]",1)>0 then 
str = Replace(str,"[仿腾讯在线提示]",ftxxsaa())
end if
if instr(1,str,"[仿腾讯家园]",1)>0 then 
str = Replace(str,"[仿腾讯家园]",ftxxsbb())
end if
if instr(1,str,"[仿腾讯空间]",1)>0 then 
str = Replace(str,"[仿腾讯空间]",ftxxscc())
end if
if instr(1,str,"[提示登录]",1)>0 then 
str = Replace(str,"[提示登录]",ftxxsdd())
end if
if instr(1,str,"[手机访问]",1)>0 then	
str = Replace(str,"[手机访问]",ismobile())
end if
if instr(1,str,"[在线人数]",1)>0 then	
str = Replace(str,"[在线人数]",onlineCou())
end If

if instr(1,str,"[在线游客]",1)>0 then	
str = Replace(str,"[在线游客]",onlineCou2())	
end if

if instr(1,str,"[在线会员]",1)>0 then	
str = Replace(str,"[在线会员]",onlineCou3())	
end if

if instr(1,str,"[个人动态]",1)>0 then
str = Replace(str,"[个人动态]",grdtmsg())	
end if
if instr(1,str,"[会员动态]",1)>0 then
str = Replace(str,"[会员动态]",hydtmsg())
end if

if instr(1,str,"[吹吹]",1)>0 then
str = Replace(str,"[吹吹]",bbslbtxt())
end if

if instr(1,str,"[广播]",1)>0 then
str = Replace(str,"[广播]",bbslbtxt())
end if
if instr(1,str,"[农历]",1)>0 then
str = Replace(str,"[农历]",nnsaytk())
end if
if instr(1,str,"[网站首页会员动态]",1)>0 then
str = Replace(str,"[网站首页会员动态]",dongtai1())
end If

if instr(1,str,"[小屋开门关门]",1)>0 then	
str = Replace(str,"[小屋开门关门]",xwkmgm())
end If




str = replace(str, "(lmsb)", "saytk="&saytk&"&amp;sid="&sid&"")
str=replace(str,"[标识]","saytk=[saytk]&sid=[sid]")
str=replace(str,"&","&amp;")
str=replace(str,"←↑→","&amp;")
str=replace(str,"<","&lt;")
str=replace(str,">","&gt;")
str=replace(str,"'","&apos;")
str=replace(str,"""","&quot;")
str=replace(str,"$","$$")
str = replace(str, "", "")
str = replace(str, "", "")
str=replace(str,"","")
str=replace(str," ","")
str=replace(str,"","")
str=replace(str,"","")
str=replace(str,"&#xFFE5;","*")
str=replace(str,"&nbsp;","")
str=replace(str,"(br)","<br/>")
If saytk=100 Then
str=replace(str,"(saytkbr)","")
Else
str=replace(str,"(saytkbr)","<br/>")
End if
str=replace(str,"[tab]",chr(13))
str=replace(str,"(tab)",chr(13))
str=replace(str,"[br]","<br/>")

'=====================================
If saytk>1 then
str=replace(str,"(ii)","<i>")
str=replace(str,"(/ii)","</i>")
str=replace(str,"(dl)","<dl>")
str=replace(str,"(/dl)","</dl>")
str=replace(str,"(dt)","<dt>")
str=replace(str,"(/dt)","</dt>")
str=replace(str,"(dd)","<dd>")
str=replace(str,"(/dd)","</dd>")
str=replace(str,"(li)","<li>")
str=replace(str,"(/li)","</li>")
Else
str=replace(str,"(ii)","")
str=replace(str,"(/ii)","")
str=replace(str,"(dl)","")
str=replace(str,"(/dl)","")
str=replace(str,"(dt)","")
str=replace(str,"(/dt)","")
str=replace(str,"(dd)","")
str=replace(str,"(/dd)","")
str=replace(str,"(li)","")
str=replace(str,"(/li)","")
End if




If saytk>1 And saytk<>5 then
str=replace(str,"(/div)","</div>")
str=replace(str,"(/class)","</div>")
str=replace(str,"(/cz2.0)","</div>")
str=replace(str,"(/enddiv)","</div>")
str=replace(str,"(/span)","</span>")

str=replace(str,"[/div]","</div>")
str=replace(str,"[/class]","</div>")
str=replace(str,"[/cz2.0]","</div>")
str=replace(str,"[/enddiv]","</div>")
str=replace(str,"[/span]","</span>")


Else
str=replace(str,"(/div)","")
str=replace(str,"(/class)","")
str=replace(str,"(/cz2.0)","")
str=replace(str,"(/enddiv)","")
str=replace(str,"(/span)","")

str=replace(str,"[/div]","")
str=replace(str,"[/class]","")
str=replace(str,"[/cz2.0]","")
str=replace(str,"[/enddiv]","")
str=replace(str,"[/span]","")


End If

str=replace(str,"[style]","<style>")
str=replace(str,"[/style]","</style>")
str=replace(str,"(style)","<style>")
str=replace(str,"(/style)","</style>")


'=====================================

str = replace(str, "(lmsb)", "saytk="&saytk&"&amp;sid="&sid&"")
str=replace(str,"[tid]",""&tid&"")
str=replace(str,"[date]",""&date&"")
str=replace(str,"[time]",""&time&"")
str=replace(str,"(name)",""&myni&"")
str=replace(str,"(myid)",""&myid&"")
str=replace(str,"(time)",""&time()&"")
str=replace(str,"(date)",""&date()&"")
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,"(now)",""&now()&"")
str=replace(str,"(week)",""&WeekDayName(DatePart("w",Now))&"")
'===
str=replace(str,"(month)",""&MONTH(DATE)&"")
str=replace(str,"(day)",""&Day(DATE)&"")
str=replace(str,"(year)",""&year(DATE)&"")
str=replace(str,"(weekday)",""&Right(WeekDayName(DatePart("w",Now)),1)&"")

str=replace(str,"(hour)",""&hour(time)&"")
str=replace(str,"(minute)",""&minute(time)&"")
str=replace(str,"(second)",""&second(time)&"")

str=replace(str,"[month]",""&MONTH(DATE)&"")
str=replace(str,"[day]",""&Day(DATE)&"")
str=replace(str,"[year]",""&year(DATE)&"")
str=replace(str,"[weekday]",""&Right(WeekDayName(DatePart("w",Now)),1)&"")

str=replace(str,"[hour]",""&hour(time)&"")
str=replace(str,"[minute]",""&minute(time)&"")
str=replace(str,"[second]",""&second(time)&"")


str=replace(str,Chr(14),"\\")
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
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="(\(change=(.[^\(]*)\))(.[^\(]*)(\(\/change\))"
If instr(r_url,"?")>0 Then

str= re.Replace(str,"<a href="""&Replace(Replace(r_url,"@@","&amp;"),"saytk=","opp=")&"&amp;saytk=$2"">$3</a>")
Else
str= re.Replace(str,"<a href=""?saytk=$2"">$3</a>")
End If
'==========================
re.pattern="(\[change=(.[^\]]*)\])(.[^\[]*)(\[\/change\])"
If instr(r_url,"?")>0 then
str= re.Replace(str,"<a href="""&Replace(Replace(r_url,"@@","&amp;"),"saytk=","opp=")&"&amp;saytk=$2"">$3</a>")
Else
str= re.Replace(str,"<a href=""?saytk=$2"">$3</a>")
End If


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\))"
re.pattern="(\(d=(.[^\}]*)\))(.[^\}]*)(\(\/d\))"
if saytk>1 And saytk<>5 then
str= re.Replace(str,"<div class=""$2"">$3</div>")
else
str= re.Replace(str,"$3")
end If

'========================================================

re.pattern="(\[topurl=(.[^\}]*)_(.[^\}]*)\])(\[\/topurl\])"
str= re.Replace(str,"<a href=""#$2"" class=""$3""></a>")

re.pattern="(\[topurl=(.[^\}]*)\])(\[\/topurl\])"
str= re.Replace(str,"<a href=""#$2""></a>")

re.pattern="(\(stardiv=(.[^\}]*)\))"
if saytk>1 And saytk<>5 Then 
str= re.Replace(str,"<div style=""$2"">")
else
str= re.Replace(str,"")
end If

re.pattern="(\(cz2.0=(.[^\}]*)\))"
if saytk>1 And saytk<>5 Then 
str= re.Replace(str,"<div style=""color:$2"">")
else
str= re.Replace(str,"")
end If

re.pattern="(\(div=(.[^\}]*)\))"
if saytk>1 And saytk<>5 Then 
str= re.Replace(str,"<div style=""$2"">")
else
str= re.Replace(str,"")
end If

re.pattern="(\(class=(.[^\}]*)\))"
if saytk>1 And saytk<>5 Then 
str= re.Replace(str,"<div class=""$2"">")
else
str= re.Replace(str,"")
end If

re.pattern="(\(3g=(.[^\}]*)_(.[^\}]*)\))(.[^\}]*)(\(\/3g\))"
if saytk>1 And saytk<>5 then
str= re.Replace(str,"<$2 class=""$3"">$4</$2>")
else
str= re.Replace(str,"$4")
end If

re.pattern="(\(3gg=(.[^\}]*)_(.[^\}]*)\))(.[^\}]*)(\(\/3gg\))"
if saytk>1 And saytk<>5 then
str= re.Replace(str,"<$2 class=""$3"">$4</$2>")
else
str= re.Replace(str,"$4")
end If
'==================

'WAP2.0 UBB信息显示
	if instr(1,str,"[/font]",1)>0 then
		re.Pattern="(\[font=(.[^\]]*)\])(.[^\[]*)(\[\/font\])"
		str= re.Replace(str,"<font face='$2'>$3</font>")
	end if
	if instr(1,str,"[/size]",1)>0 then
		re.Pattern="(\[size=(.[^\]]*)\])(.[^\[]*)(\[\/size\])"
		str= re.Replace(str,"<font size='$2'>$3</font>")
	end if

	if instr(1,str,"[/cai]",1)>0 then
		re.Pattern="(\[cai=(.[^\]]*)\])(.[^\[]*)(\[\/cai\])"
		str= re.Replace(str,"<span style='background-color: $2'>$3</span>")
	end if
	if instr(1,str,"[/forecolor]",1)>0 then
		re.Pattern="(\[forecolor=(.[^\]]*)\])(.[^\[]*)(\[\/forecolor\])"
		str= re.Replace(str,"<font color='$2'>$3</font>")
	end if
	
	if instr(1,str,"[IMG=",1)>0 then
	  re.pattern="\[IMG=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/IMG]"
	  str=re.replace(str,"<img border=""0"" src=""$3"" alt=""."" width=""$1"" height=""$2""/>")
  end if
	if instr(1,str,"[/STRIKE]",1)>0 then
		re.Pattern="(\[STRIKE\])(.[^\[]*)(\[\/STRIKE\])"
		str=re.Replace(str,"<strike>$2</strike>")
	end if
	if instr(1,str,"[/fei]",1)>0 then
		re.Pattern="(\[fei\])(.[^\[]*)(\[\/fei\])"
		str=re.Replace(str,"<marquee width='90%' behavior='alternate' scrollamount='3'>$2</marquee>")
	end if
  str=replace(str,"[HR]","<hr/>")
	  
'==================
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/>")

re.pattern="(\(p\))(.[^\[]*)(\(\/p\))"
str= re.Replace(str,"<p>$2</p>")


if instr(1,str,"[最新吹牛_",1)>0 then	
re.pattern="(\[最新吹牛_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim cndhnum,cndhnum1,cndhnum2
cndhnum=abs(re.Replace(str,"$2"))
cndhnum1=abs(re.Replace(str,"$3"))
cndhnum2=abs(re.Replace(str,"$4"))
str = re.Replace(str,cndh(cndhnum,cndhnum1,cndhnum2))
end If

if instr(1,str,"[最新广播_",1)>0 then	
re.pattern="(\[最新广播_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim lbnum,lbnum1,lbnum2
lbnum=abs(re.Replace(str,"$2"))
lbnum1=abs(re.Replace(str,"$3"))
lbnum2=abs(re.Replace(str,"$4"))
str = re.Replace(str,bbslbb(lbnum,lbnum1,lbnum2))
end If

if instr(1,str,"[倒计时_",1)>0 then	
re.pattern="(\[倒计时_([0-9]*)\])"
dim djsnum10
djsnum10=abs(re.Replace(str,"$2"))
str = re.Replace(str,saydjs(djsnum10))
end If


if instr(1,str,"[最新日记_",1)>0 then	
re.pattern="(\[最新日记_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim rjnum10,rjnum101,rjnum102
rjnum10=abs(re.Replace(str,"$2"))
rjnum101=abs(re.Replace(str,"$3"))
rjnum102=abs(re.Replace(str,"$4"))

if rjnum10="" or Isnumeric(rjnum10)=False then rjnum10=0
if rjnum101="" or Isnumeric(rjnum101)=False then rjnum101=0
if rjnum102="" or Isnumeric(rjnum102)=False then rjnum102=0
rjnum10=abs(rjnum10)
rjnum101=abs(rjnum101)
rjnum102=abs(rjnum102)

str = re.Replace(str,zonerj10(rjnum10,rjnum101,rjnum102))
end if

if instr(1,str,"[历史今天_",1)>0 then	
re.pattern="(\[历史今天_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim todaynum,todaynum1,todaynum2
todaynum=abs(re.Replace(str,"$2"))
todaynum1=abs(re.Replace(str,"$3"))
todaynum2=abs(re.Replace(str,"$4"))

str = re.Replace(str,today(todaynum,todaynum1,todaynum2))
end If
if instr(1,str,"[背景音乐_",1)>0 then	
re.pattern="(\[背景音乐_([0-9]*)\])"
dim bgsoundnum
bgsoundnum=abs(re.Replace(str,"$2"))
str = re.Replace(str,bgsoundsay(bgsoundnum))
end If


if instr(1,str,"[缘份对对碰_",1)>0 then	
re.pattern="(\[缘份对对碰_([0-9]*)\])"
dim yfnum
yfnum=abs(re.Replace(str,"$2"))
str = re.Replace(str,lmyf1(yfnum))
end If

if instr(1,str,"[最新足球赛事_",1)>0 then	
re.pattern="(\[最新足球赛事_([0-9]*)\])"
dim qiunum
qiunum=abs(re.Replace(str,"$2"))
str = re.Replace(str,zhuqiu1(qiunum))
end if

if instr(1,str,"[聊天发言框]",1)>0 then	
str = Replace(str,"[聊天发言框]",roomksfy())
end if
if instr(1,str,"[最新商品_",1)>0 then	
re.pattern="(\[最新商品_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim shopsj2num,shopsj2num1,shopsj2num2
shopsj2num=abs(re.Replace(str,"$2"))
shopsj2num1=abs(re.Replace(str,"$3"))
shopsj2num2=abs(re.Replace(str,"$4"))

str = re.Replace(str,shopnew(shopsj2num,shopsj2num1,shopsj2num2))
end If

if instr(1,str,"[随机商品_",1)>0 then	
re.pattern="(\[随机商品_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim shopsj1num,shopsj1num1,shopsj1num2
shopsj1num=abs(re.Replace(str,"$2"))
shopsj1num1=abs(re.Replace(str,"$3"))
shopsj1num2=abs(re.Replace(str,"$4"))

str = re.Replace(str,shopsj(shopsj1num,shopsj1num1,shopsj1num2))
end If

if instr(1,str,"[商品随机_",1)>0 then	
re.pattern="(\[商品随机_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim shopsjnum,shopsjnum1,shopsjnum2
shopsjnum=abs(re.Replace(str,"$2"))
shopsjnum1=abs(re.Replace(str,"$3"))
shopsjnum2=abs(re.Replace(str,"$4"))

str = re.Replace(str,shopsj(shopsjnum,shopsjnum1,shopsjnum2))
end if



if instr(1,str,"[问候语]",1)>0 then	
str = Replace(str,"[问候语]",wenhouyu())
end if



if instr(1,str,"[社区快捷菜单]",1)>0 then	
str = Replace(str,"[社区快捷菜单]",bbskjcd())
end if

if instr(1,str,"[最新公告]",1)>0 then
str = Replace(str,"[最新公告]",gonggaonew())
end if

if instr(1,str,"[网站公告]",1)>0 then
str = Replace(str,"[网站公告]",gonggaonew())
end if

if instr(1,str,"[网站成立天数]",1)>0 then
str = Replace(str,"[网站成立天数]",chenli())
end if


if instr(1,str,"[社区公告]",1)>0 then
str = Replace(str,"[社区公告]",bbsgonggaonew())
end if

if instr(1,str,"[最新聊天]",1)>0 then
str = Replace(str,"[最新聊天]",roomsmsg())
end if

if instr(1,str,"[执行时间]",1)>0 then
str = Replace(str,"[执行时间]",zxsj())
end if

if instr(1,str,"[会员动态_",1)>0 then	
re.pattern="(\[会员动态_([0-9]*)\])"
dim dongtainew1num
dongtainew1num=abs(re.Replace(str,"$2"))
str = re.Replace(str,dongtai(dongtainew1num))
end if


if instr(1,str,"[最新家族_",1)>0 then	
re.pattern="(\[最新家族_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim zonenewnum,zonenewnum1,zonenewnum2
zonenewnum=abs(re.Replace(str,"$2"))
zonenewnum1=abs(re.Replace(str,"$3"))
zonenewnum2=abs(re.Replace(str,"$4"))
str = re.Replace(str,zonetalk(zonenewnum,zonenewnum1,zonenewnum2))
end if


if instr(1,str,"[最新许愿_",1)>0 then	
re.pattern="(\[最新许愿_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim xynewnum,xynewnum1,xynewnum2
xynewnum=abs(re.Replace(str,"$2"))
xynewnum1=abs(re.Replace(str,"$3"))
xynewnum2=abs(re.Replace(str,"$4"))
str = re.Replace(str,xy(xynewnum,xynewnum1,xynewnum2))
end if
if instr(1,str,"[龙门会员动态_",1)>0 then	
re.pattern="(\[龙门会员动态_([0-9]*)\])"
dim dongtainewnum
dongtainewnum=abs(re.Replace(str,"$2"))
str = re.Replace(str,dongtai(dongtainewnum))
end if

if instr(1,str,"[游戏动态_",1)>0 then	
re.pattern="(\[游戏动态_([0-9]*)\])"
dim gamenewnum
gamenewnum=abs(re.Replace(str,"$2"))
str = re.Replace(str,gametalk(gamenewnum))
end if

if instr(1,str,"[经典短信_",1)>0 then	
re.pattern="(\[经典短信_([0-9]*)\])"
dim smsnewnum
smsnewnum=abs(re.Replace(str,"$2"))
smsnewnum=cint(smsnewnum)
str = re.Replace(str,sms(smsnewnum))
end if
if instr(1,str,"[最新友链_",1)>0 then	
re.pattern="(\[最新友链_([0-9]*)\])"
dim linknewnum
linknewnum=abs(re.Replace(str,"$2"))
str = re.Replace(str,newlink(linknewnum))
end if
if instr(1,str,"[全站随机广告_",1)>0 then	
re.pattern="(\[全站随机广告_([0-9]*)\])"
dim adstrnum
adstrnum=abs(re.Replace(str,"$2"))
adstrnum=Cint(adstrnum)
str = re.Replace(str,adstr(adstrnum))
end if

if instr(1,str,"[最新短信_",1)>0 then	
re.pattern="(\[最新短信_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim sms1num,sms1num1,sms1num2
sms1num=abs(re.Replace(str,"$2"))
sms1num1=abs(re.Replace(str,"$3"))
sms1num2=abs(re.Replace(str,"$4"))
str = re.Replace(str,sms1(sms1num,sms1num1,sms1num2))
end If
if instr(1,str,"[最新笑话_",1)>0 then	
re.pattern="(\[最新笑话_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim xhdq1num,xhdq1num1,xhdq1num2
xhdq1num=abs(re.Replace(str,"$2"))
xhdq1num1=abs(re.Replace(str,"$3"))
xhdq1num2=abs(re.Replace(str,"$4"))
str = re.Replace(str,xhdq1(xhdq1num,xhdq1num1,xhdq1num2))
end if

if instr(1,str,"[随机笑话_",1)>0 then	
re.pattern="(\[随机笑话_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim xhsjnum,xhsjle
xhsjnum=abs(re.Replace(str,"$2"))
xhsjle=abs(re.Replace(str,"$3"))
xhsjhe=abs(re.Replace(str,"$4"))
if xhsjnum="" or Isnumeric(xhsjnum)=False then xhsjnum=0
if xhsjle="" or Isnumeric(xhsjle)=False then xhsjle=0
if xhsjhe="" or Isnumeric(xhsjhe)=False then xhsjhe=0
xhsjnum=abs(xhsjnum)
xhsjle=abs(xhsjle)
xhsjhe=abs(xhsjhe)
str = re.Replace(str,xhsj(xhsjnum,xhsjle,xhsjhe))
end if

if instr(1,str,"[随机短信_",1)>0 then	
re.pattern="(\[随机短信_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim sjsmsnum,sjsmsle,sjsmshe
sjsmsnum=abs(re.Replace(str,"$2"))
sjsmsle=abs(re.Replace(str,"$3"))
sjsmshe=abs(re.Replace(str,"$4"))
if sjsmsnum="" or Isnumeric(sjsmsnum)=False then sjsmsnum=0
if sjsmsle="" or Isnumeric(sjsmsle)=False then sjsmsle=0
if sjsmshe="" or Isnumeric(sjsmshe)=False then sjsmshe=0
sjsmsnum=abs(sjsmsnum)
sjsmsle=abs(sjsmsle)
sjsmshe=abs(sjsmshe)
str=re.Replace(str,sjsms(sjsmsnum,sjsmsle,sjsmshe))
end if



if instr(1,str,"[最新文章_",1)>0 then	
re.pattern="(\[最新文章_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim newtextnum,newtextid,newtextid1,newtextid2
newtextnum=re.Replace(str,"$2")
newtextid=re.Replace(str,"$3")
newtextid1=re.Replace(str,"$4")
newtextid2=re.Replace(str,"$5")

if newtextnum="" or Isnumeric(newtextnum)=False then newtextnum=0
if newtextid="" or Isnumeric(newtextid)=False then newtextid=0
if newtextid1="" or Isnumeric(newtextid1)=False then newtextid1=0
if newtextid2="" or Isnumeric(newtextid2)=False then newtextid2=0
newtextnum=abs(newtextnum)
newtextid=abs(newtextid)
newtextid1=abs(newtextid1)
newtextid2=abs(newtextid2)

str = re.Replace(str,newtitle(newtextnum,newtextid,newtextid1,newtextid2))
end if

if instr(1,str,"[最热文章_",1)>0 then	
re.pattern="(\[最热文章_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim hottextnum,hottextid,hottextid1,hottextid2
hottextnum=re.Replace(str,"$2")
hottextid=re.Replace(str,"$3")
hottextid1=re.Replace(str,"$4")
hottextid2=re.Replace(str,"$5")

if hottextnum="" or Isnumeric(hottextnum)=False then hottextnum=0
if hottextid="" or Isnumeric(hottextid)=False then hottextid=0
if hottextid1="" or Isnumeric(hottextid1)=False then hottextid1=0
if hottextid2="" or Isnumeric(hottextid2)=False then hottextid2=0

hottextnum=abs(hottextnum)
hottextid=abs(hottextid)
hottextid1=abs(hottextid1)
hottextid2=abs(hottextid2)

str = re.Replace(str,hottitle(hottextnum,hottextid,hottextid1,hottextid2))
end If


if instr(1,str,"[随机广告_",1)>0 then	
re.pattern="(\[随机广告_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim adsnum1,adsnum2,adsnum3,adsnum4
adsnum1=abs(re.Replace(str,"$2"))
adsnum2=abs(re.Replace(str,"$3"))
adsnum3=abs(re.Replace(str,"$4"))
adsnum4=abs(re.Replace(str,"$5"))
if adsnum1="" or Isnumeric(adsnum1)=False then adsnum1=0
if adsnum2="" or Isnumeric(adsnum2)=False then adsnum2=0
if adsnum3="" or Isnumeric(adsnum3)=False then adsnum3=0
if adsnum4="" or Isnumeric(adsnum4)=False then adsnum4=0
str = re.Replace(str,adstr1(adsnum1,adsnum2,adsnum3,adsnum4))
end if



if instr(1,str,"[随机文章_",1)>0 then	
re.pattern="(\[随机文章_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim wendtextnum,wendtextid,wendtextid1,wendtextid2
wendtextnum=re.Replace(str,"$2")
wendtextid=re.Replace(str,"$3")
wendtextid1=re.Replace(str,"$4")
wendtextid2=re.Replace(str,"$5")

if wendtextnum="" or Isnumeric(wendtextnum)=False then wendtextnum=0
if wendtextid="" or Isnumeric(wendtextid)=False then wendtextid=0
if wendtextid1="" or Isnumeric(wendtextid1)=False then wendtextid1=0
if wendtextid2="" or Isnumeric(wendtextid2)=False then wendtextid2=0
wendtextnum=abs(wendtextnum)
wendtextid=abs(wendtextid)
wendtextid1=abs(wendtextid1)
wendtextid2=abs(wendtextid2)

str = re.Replace(str,wendtitle(wendtextnum,wendtextid,wendtextid1,wendtextid2))
end if




if instr(1,str,"[最新图片_",1)>0 then	
re.pattern="(\[最新图片_([0-9]*)_([0-9]*)\])"
dim newpicnum,newpicid
newpicnum=re.Replace(str,"$2")
newpicid=re.Replace(str,"$3")
if newpicnum="" or Isnumeric(newpicnum)=False then newpicnum=0
if newpicid="" or Isnumeric(newpicid)=False then newpicid=0
newpicnum=abs(newpicnum)
newpicid=abs(newpicid)
str = re.Replace(str,newpic(newpicnum,newpicid))
end if

if instr(1,str,"[最热图片_",1)>0 then	
re.pattern="(\[最热图片_([0-9]*)_([0-9]*)\])"
dim hotpicnum,hotpicid
hotpicnum=re.Replace(str,"$2")
hotpicid=re.Replace(str,"$3")
if hotpicnum="" or Isnumeric(hotpicnum)=False then hotpicnum=0
if hotpicid="" or Isnumeric(hotpicid)=False then hotpicid=0
hotpicnum=abs(hotpicnum)
hotpicid=abs(hotpicid)
str = re.Replace(str,hotpic(hotpicnum,hotpicid))
end if

if instr(1,str,"[随机图片_",1)>0 then	
re.pattern="(\[随机图片_([0-9]*)_([0-9]*)\])"
dim wendpicnum,wendpicid
wendpicnum=re.Replace(str,"$2")
wendpicid=re.Replace(str,"$3")
if wendpicnum="" or Isnumeric(wendpicnum)=False then wendpicnum=0
if wendpicid="" or Isnumeric(wendpicid)=False then wendpicid=0
wendpicnum=abs(wendpicnum)
wendpicid=abs(wendpicid)
str = re.Replace(str,wendpic(wendpicnum,wendpicid))
end if

if instr(1,str,"[显示图片_",1)>0 then	
re.pattern="(\[显示图片_([0-9]*)_([0-9]*)\])"
dim xspicnum,xspicid
xspicnum=re.Replace(str,"$2")
xspicid=re.Replace(str,"$3")
if xspicnum="" or Isnumeric(xspicnum)=False then xspicnum=0
if xspicid="" or Isnumeric(xspicid)=False then xspicid=0
xspicnum=abs(xspicnum)
xspicid=abs(xspicid)
str = re.Replace(str,xspic(xspicnum,xspicid))
end if




if instr(1,str,"[最新文件_",1)>0 then	
re.pattern="(\[最新文件_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim newfilenum,newfileid,newfileadd
newfilenum=re.Replace(str,"$2")
newfileid=re.Replace(str,"$3")
newfileadd=re.Replace(str,"$4")
newfileid1=re.Replace(str,"$5")
newfileid2=re.Replace(str,"$6")

if newfilenum="" or Isnumeric(newfilenum)=False then newfilenum=0
if newfileid="" or Isnumeric(newfileid)=False then newfileid=0
if newfileadd="" or Isnumeric(newfileadd)=False then newfileadd=0
if newfileid1="" or Isnumeric(newfileid1)=False then newfileid1=0
if newfileid2="" or Isnumeric(newfileid2)=False then newfileid2=0

newfilenum=abs(newfilenum)
newfileid=abs(newfileid)
newfileadd=abs(newfileadd)
newfileid1=abs(newfileid1)
newfileid2=abs(newfileid2)

str = re.Replace(str,newfile(newfilenum,newfileid,newfileadd,newfileid1,newfileid2))
end if





if instr(1,str,"[最热文件_",1)>0 then	
re.pattern="(\[最热文件_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim hotfilenum,hotfileid,hotfileadd
hotfilenum=re.Replace(str,"$2")
hotfileid=re.Replace(str,"$3")
hotfileadd=re.Replace(str,"$4")
hotfileid1=re.Replace(str,"$5")
hotfileid2=re.Replace(str,"$6")

if hotfilenum="" or Isnumeric(hotfilenum)=False then hotfilenum=0
if hotfileid="" or Isnumeric(hotfileid)=False then hotfileid=0
if hotfileadd="" or Isnumeric(hotfileadd)=False then hotfileadd=0
if hotfileid1="" or Isnumeric(hotfileid1)=False then hotfileid1=0
if hotfileid2="" or Isnumeric(hotfileid2)=False then hotfileid2=0

hotfilenum=abs(hotfilenum)
hotfileid=abs(hotfileid)
hotfileadd=abs(hotfileadd)
hotfileid1=abs(hotfileid1)
hotfileid2=abs(hotfileid2)

str = re.Replace(str,hotfile(hotfilenum,hotfileid,hotfileadd,hotfileid1,hotfileid2))
end if

if instr(1,str,"[仿腾讯在线提示_",1)>0 then	
re.pattern="(\[仿腾讯在线提示_(.[^\[]*)_(.[^\[]*)\])"
aaa=re.Replace(str,"$2")
bbb=re.Replace(str,"$3")
str=re.Replace(str,zaixianxs(aaa,bbb))
end if


if instr(1,str,"[随机文件_",1)>0 then	
re.pattern="(\[随机文件_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim sjfilenum,sjfiletid,sjfileadd,sjfiletid1,sjfiletid2
sjfilenum=re.Replace(str,"$2")
sjfiletid=re.Replace(str,"$3")
sjfileadd=re.Replace(str,"$4")
sjfiletid1=re.Replace(str,"$5")
sjfiletid2=re.Replace(str,"$6")

if sjfilenum="" or Isnumeric(sjfilenum)=False then sjfilenum=0
if sjfiletid="" or Isnumeric(sjfiletid)=False then sjfiletid=0
if sjfileadd="" or Isnumeric(sjfileadd)=False then sjfileadd=0
if sjfiletid1="" or Isnumeric(sjfiletid1)=False then sjfiletid1=0
if sjfiletid2="" or Isnumeric(sjfiletid2)=False then sjfiletid2=0

sjfilenum=abs(sjfilenum)
sjfiletid=abs(sjfiletid)
sjfileadd=abs(sjfileadd)
sjfiletid1=abs(sjfiletid1)
sjfiletid2=abs(sjfiletid2)

str=re.Replace(str,sjfile(sjfilenum,sjfiletid,sjfileadd,sjfiletid1,sjfiletid2))
end if

if instr(1,str,"[最新帖子_",1)>0 then	
re.pattern="(\[最新帖子_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim newsellnum,newsellid,newsellid1,newsellid2,newsellid3
newsellnum=re.Replace(str,"$2")
newsellid=re.Replace(str,"$3")
newsellid1=re.Replace(str,"$4")
newsellid2=re.Replace(str,"$5")
newsellid3=re.Replace(str,"$6")
if newsellnum="" or Isnumeric(newsellnum)=False then newsellnum=0
if newsellid="" then newsellid=0
if newsellid1="" or Isnumeric(newsellid1)=False then newsellid1=0
if newsellid2="" or Isnumeric(newsellid2)=False then newsellid2=0
if newsellid3="" or Isnumeric(newsellid3)=False then newsellid3=0
newsellnum=abs(newsellnum)
newsellid=newsellid
newsellid1=abs(newsellid1)
newsellid2=abs(newsellid2)
newsellid2=abs(newsellid3)
str=re.Replace(str,newsell(newsellnum,newsellid,newsellid1,newsellid2,newsellid3))
end If

if instr(1,str,"[最热帖子_",1)>0 then	
re.pattern="(\[最热帖子_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim hotsellnum,hotsellid,hotsellid1,hotsellid2,hotsellid3
hotsellnum=re.Replace(str,"$2")
hotsellid=re.Replace(str,"$3")
hotsellid1=re.Replace(str,"$4")
hotsellid3=re.Replace(str,"$6")
if hotsellnum="" or Isnumeric(hotsellnum)=False then hotsellnum=0
if hotsellid="" then hotsellid=0
if hotsellid1="" or Isnumeric(hotsellid1)=False then hotsellid1=0
if hotsellid2="" or Isnumeric(hotsellid2)=False then hotsellid2=0
if hotsellid3="" or Isnumeric(hotsellid3)=False then hotsellid3=0
hotsellnum=abs(hotsellnum)
hotsellid=hotsellid
hotsellid1=abs(hotsellid1)
hotsellid2=abs(hotsellid2)
hotsellid3=abs(hotsellid3)
str=re.Replace(str,hotsell(hotsellnum,hotsellid,hotsellid1,hotsellid2,hotsellid3))
end If

if instr(1,str,"[随机帖子_",1)>0 then	
re.pattern="(\[随机帖子_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim sjsellnum,sjsellid,sjsellid1,sjsellid2,sjsellid3
sjsellnum=re.Replace(str,"$2")
sjsellid=re.Replace(str,"$3")
sjsellid1=re.Replace(str,"$4")
sjsellid2=re.Replace(str,"$5")
sjsellid3=re.Replace(str,"$6")
if sjsellnum="" or Isnumeric(sjsellnum)=False then sjsellnum=0
if sjsellid="" then sjsellid=0
if sjsellid1="" or Isnumeric(sjsellid1)=False then sjsellid1=0
if sjsellid2="" or Isnumeric(sjsellid2)=False then sjsellid2=0
if sjsellid3="" or Isnumeric(sjsellid3)=False then sjsellid3=0
sjsellnum=abs(sjsellnum)
sjsellid=sjsellid
sjsellid1=abs(sjsellid1)
sjsellid2=abs(sjsellid2)
sjsellid3=abs(sjsellid3)
str=re.Replace(str,sjsell(sjsellnum,sjsellid,sjsellid1,sjsellid2,sjsellid3))
end if

if instr(1,str,"[动态帖子_",1)>0 then	
re.pattern="(\[动态帖子_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim relsellnum1,relsellid1,relsellid2,relsellid3
relsellnum1=re.Replace(str,"$2")
relsellid1=re.Replace(str,"$3")
relsellid2=re.Replace(str,"$4")
relsellid3=re.Replace(str,"$5")
relsellid4=re.Replace(str,"$6")
if relsellnum1="" or Isnumeric(relsellnum1)=False then relsellnum1=0
if relsellid1="" then relsellid1=0
if relsellid2="" or Isnumeric(relsellid2)=False then relsellid2=0
if relsellid3="" or Isnumeric(relsellid3)=False then relsellid3=0
if relsellid4="" or Isnumeric(relsellid4)=False then relsellid4=0
relsellnum1=abs(relsellnum1)
relsellid1=relsellid1
relsellid2=abs(relsellid2)
relsellid3=abs(relsellid3)
relsellid4=abs(relsellid4)
str=re.Replace(str,relsell(relsellnum1,relsellid1,relsellid2,relsellid3,relsellid4))
end if



if instr(1,str,"[最新回复_",1)>0 then	
re.pattern="(\[最新回复_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim relsellsnum1,relsellsid1,relsellsid2,relsellsid3,relsellsid4
relsellsnum1=re.Replace(str,"$2")
relsellsid1=re.Replace(str,"$3")
relsellsid2=re.Replace(str,"$4")
relsellsid3=re.Replace(str,"$5")
relsellsid4=re.Replace(str,"$6")
if relsellsnum1="" or Isnumeric(relsellsnum1)=False then relsellsnum1=0
if relsellsid1="" then relsellsid1=0
if relsellsid2="" or Isnumeric(relsellsid2)=False then relsellsid2=0
if relsellsid3="" or Isnumeric(relsellsid3)=False then relsellsid3=0
if relsellsid4="" or Isnumeric(relsellsid4)=False then relsellsid4=0
relsellsnum1=abs(relsellsnum1)
relsellsid1=relsellsid1
relsellsid2=abs(relsellsid2)
relsellsid3=abs(relsellsid3)
relsellsid4=abs(relsellsid4)
str=re.Replace(str,relsell(relsellsnum1,relsellsid1,relsellsid2,relsellsid3,relsellsid4))
end If



if instr(1,str,"[最新精华_",1)>0 then	
re.pattern="(\[最新精华_([0-9]*)_(.[^\(]*)_([0-9]*)_([0-9]*)_([0-9]*)\])"
dim jjsellnum,jjsellid,jjsellid1,jjsellid2,jjsellid3
jjsellnum=re.Replace(str,"$2")
jjsellid=re.Replace(str,"$3")
jjsellid1=re.Replace(str,"$4")
jjsellid2=re.Replace(str,"$5")
jjsellid3=re.Replace(str,"$6")
if jjsellnum="" or Isnumeric(jjsellnum)=False then jjsellnum=0
if jjsellid="" then jjsellid=0
if jjsellid1="" or Isnumeric(jjsellid1)=False then jjsellid1=0
if jjsellid2="" or Isnumeric(jjsellid2)=False then jjsellid2=0
if jjsellid3="" or Isnumeric(jjsellid3)=False then jjsellid3=0
jjsellnum=abs(jjsellnum)
jjsellid=jjsellid
jjsellid1=abs(jjsellid1)
jjsellid2=abs(jjsellid2)
jjsellid3=abs(jjsellid3)
str=re.Replace(str,jjsell(jjsellnum,jjsellid,jjsellid1,jjsellid2,jjsellid))
end if

if instr(1,str,"[最新相片_",1)>0 then	
re.pattern="(\[最新相片_([0-9]*)_([0-9]*)\])"
dim photosellnum,photosellid
photosellnum=re.Replace(str,"$2")
photosellid=re.Replace(str,"$3")
if photosellnum="" or Isnumeric(photosellnum)=False then photosellnum=0
if photosellid="" or Isnumeric(photosellid)=False then photosellid=0
photosellnum=abs(photosellnum)
photosellid=abs(photosellid)
str = re.Replace(str,photosell(photosellnum,photosellid))
end if

if instr(1,str,"[随机相片_",1)>0 then	
re.pattern="(\[随机相片_([0-9]*)_([0-9]*)\])"
dim sjphotosellnum,sjphotosellid
sjphotosellnum=re.Replace(str,"$2")
sjphotosellid=re.Replace(str,"$3")
if sjphotosellnum="" or Isnumeric(sjphotosellnum)=False then sjphotosellnum=0
if sjphotosellid="" or Isnumeric(sjphotosellid)=False then sjphotosellid=0
sjphotosellnum=abs(sjphotosellnum)
sjphotosellid=abs(photosellid)
str = re.Replace(str,sjphoto(sjphotosellnum,sjphotosellid))
end if

set re=Nothing
ubbcode=str
end function
function newuserinfo()
Dim rsuser
set rsuser=server.CreateObject("ADODB.RecordSet")
rsuser.Open "select top 1 name,id from Users order by id desc",conn,1,1
if not rsuser.eof then
for i=1 to 2
response.write"<a href=""/bbs/uinfo.asp?saytk="&saytk&"&amp;id="&rsuser("id")&"&amp;sid="&sid&""">"&ubb(rsuser("name"))&"</a> ID:"&ubb(rsuser("id"))&""
rsuser.movenext
if rsuser.eof then exit for
next
end if
rsuser.close
set rsuser=nothing
end Function

function onlineCou2()
Dim onlineCounts22
onlineCounts22 = conn.execute("Select count(ID) from [online]")(0)
Set rson11= Server.CreateObject("ADODB.Recordset")
rson11.open"select * from online where online=1 order by times desc",conn,1,1
Counton2=rson11.recordcount
rson11.close
set rson11=nothing
response.write "<a href=""/bbs/onlineview.asp?saytk="&saytk&"&amp;sid=" & sid & """>"&onlineCounts22-Counton2&"</a>" & Chr(13)
end function

function onlineCou3()
Dim rson1,Counton1
Set rson1 = Server.CreateObject("ADODB.Recordset")
rson1.open"select * from online where online=1 order by times desc",conn,1,1
Counton1=rson1.recordcount
rson1.close
set rson1=nothing

response.write "<a href=""/bbs/hy.asp?saytk="&saytk&"&amp;sid=" & sid & """>"&Counton1&"</a>" & Chr(13)
end function

function ftxxsaa()

response.write "<img src='/bbs/images/on1.gif' alt='在线'/>"
response.write "<a href='/bbs/myfriend.asp?sid="&sid&"&amp;saytk="&saytk&"'>ID:"&myid&"</a>"
if myid<>0 then
if newguest > 0 then
response.write "<a href='/bbs/msgview.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;url="&replace(replace(r_url(),"sid=","sidoo="),"saytk=","sayou=")&"'>("&newguest&")</a>"
end If
End if
end function
function ftxxsbb
dim myfr
myfr= conn.execute("select count(id) from [myfriend] where cid="&myid)(0)
response.write "<a href='/bbs/uinfo.asp?sid="&sid&"&amp;saytk="&saytk&"'> <img src='/img/home.gif' alt='.'/>家园 </a>"


end function

function ftxxscc
%><a href='/bbs/blog/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'><img src='/bbs/images/zone.gif' alt='.'/><%
Dim M_zonedt_my
M_zonedt_my=conn.execute("Select count(ID) from [zonedt_my] where yid=0 and gid="&myid)(0)

if M_zonedt_my<>0 then
%>(<%=M_zonedt_my%>)<%
else
%>(0)<%
end if
%></a><br/><%
end function
function ftxxsdd
%><a href='/bbs/login.asp?saytk=<%=saytk%>&amp;url=<%=replace(replace(r_url(),"sid=","sidoo="),"saytk=","sayou=")%>'>>登陆</a>享有完全<a href='/bbs/sqbz/index.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>服务</a><br/>
<%end function




'广播

function bbslbtxt()
set rsbbsmsg=Server.CreateObject("ADODB.Recordset")
  rsbbsmsg.open"select top 1 bbslbtxt,usid,writename,writeTime from lb order by id desc",conn,1,1
  if not rsbbsmsg.eof then
  while not rsbbsmsg.eof
  if rsbbsmsg("usid")<>0 Then
  response.write ubbimg(ubblesebbslb)
  response.write"<a href=""/bbs/uinfo.asp?ID="&rsbbsmsg("usid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&rsbbsmsg("writename")&"</a>:"&ubb(rsbbsmsg("bbslbtxt"))&""
  end if
  rsbbsmsg.movenext
  wend
  else
    Response.write "<img src='/bbs/gb.gif' alt='广播'/>广播[<a href=""/bbs/lb/index.asp?saytk="&saytk&"&amp;sid="&sid&""">喊道</a>]..."
  end if
  rsbbsmsg.close
  set rsbbsmsg=nothing

end function

'最新广播
function bbslbb(num,le,he)
set rsbbsmsg=Server.CreateObject("ADODB.Recordset")
  rsbbsmsg.open"select bbslbtxt,usid,writename,writeTime from lb order by id desc",conn,1,1
  If rsbbsmsg.eof Then 
  Response.write "<img src='/bbs/gb.gif' alt='广播'/>广播[<a href=""/bbs/lb/index.asp?saytk="&saytk&"&amp;sid="&sid&""">喊道</a>]..."
                  else
            rsbbsmsg.Move(0)

                  e1=1
 do while ((not rsbbsmsg.EOF) and e1 <=num)
 If saytk=100 Then response.write"<div style='padding-left:15px;'>"
If le<1 Then le=13 End If 
If he=1 Then response.write ubbimg(ubblesebbslb)

  response.write"<a href=""/bbs/uinfo.asp?ID="&rsbbsmsg("usid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&rsbbsmsg("writename")&"</a>:"&Left(ubb(rsbbsmsg("bbslbtxt")),CLng(le))&"<br/>"
If saytk=100 Then response.write"</div>"
rsbbsmsg.MoveNext
e1=e1+1
loop
end If
    
rsbbsmsg.close
set rsbbsmsg=nothing
end function


function bbssearch()
If saytk<>1 Then
Response.write "<form name=""form"" method=""post"" action=""/bbs/searchall.asp?saytk="&saytk&"&amp;sid="&sid&""">"
%>
<input type="text" name="keyword" size="24" value=""/><br/>

帖子<input type="radio" name="sear" value="1" />
会员<input type="radio" name="sear" value="10" />
论坛<input type="radio" name="sear" value="11" />
<input type="hidden" name="times" value="4"/>
<input type="hidden" name="Action" value="ok"/>
<input type="hidden" name="sear2" value="2"/>
<input type="submit" value="搜索"/></form>
<%Else
if saytk=1 then
response.write"<input name=""keywordyl"" maxlength=""50"" value=""""/><br/>搜<anchor>帖子<go href=""/bbs/search.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""Action"" value=""ok""/><postfield name=""times"" value=""4""/><postfield name=""sear"" value=""1""/><postfield name=""sear2"" value=""2""/></go></anchor>.<anchor>论坛<go href=""/bbs/searchbbs.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""Action"" value=""ok""/><postfield name=""bbsid"" value=""""/><postfield name=""Act"" value=""""/></go></anchor>.<anchor>会员<go href=""/bbs/searchuser.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""sear"" value=""2""/><postfield name=""Action"" value=""ok""/></go></anchor>"
end If
end if%>


<%end function

'===========



function bbssearch1()


response.write"<input name=""keywordyl"" maxlength=""50"" value=""""/><br/>搜<anchor>帖子<go href=""/bbs/search.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""Action"" value=""ok""/><postfield name=""times"" value=""4""/><postfield name=""sear"" value=""1""/><postfield name=""sear2"" value=""2""/></go></anchor>.<anchor>论坛<go href=""/bbs/searchbbs.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""Action"" value=""ok""/><postfield name=""bbsid"" value=""""/><postfield name=""Act"" value=""""/></go></anchor>.<anchor>会员<go href=""/bbs/searchuser.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post""><postfield name=""keyword"" value=""$(keywordyl)""/><postfield name=""sear"" value=""2""/><postfield name=""Action"" value=""ok""/></go></anchor>"




end function

'最新友链
function newlink(toplink)
if toplink="" or Isnumeric(toplink)=false then toplink=0
Dim rslink, Sqli
Set rslink = Server.CreateObject("ADODB.Recordset")
Sqli = "select [ID],[namt],[classid] from [link] Where [Active] =0 order by [yd_time] desc"
rslink.open Sqli, conn, 1, 1
If rslink.EOF Then
response.write ("暂无记录！<br/>")
End If
Dim linka
linka = 1
Do While ((Not rslink.EOF) And linka <= toplink)
response.write "<a href=""/link/view.asp?saytk="&saytk&"&amp;sid=" & sid & "&amp;class=" & rslink("classid") & "&amp;id=" & rslink("id") & """>" & ubb(rslink("NAMT")) & "</a>" & Chr(13)
If linka Mod 4 = 0 And linka <> rslink.RecordCount Then
response.write "<br/>" & Chr(13)
End If
rslink.MoveNext
linka = linka + 1
Loop
rslink.Close
Set rslink = Nothing
end function



'手机访问
function ismobile()
left_ip=left(User_Ip,5)
if left_ip="211.1" or left_ip="221.1" or left_ip="218.2" or left_ip="218.1" or left_ip="220.2" or left_ip="202.1" or left_ip="211.9" or left_ip="61.24" then
'要自己可以访问,请加上自己的IP,then修改为or left_ip="这里写自己IP的前五位"then
  else
response.redirect "http://"&Request.ServerVariables("SERVER_NAME")&"/ie.asp"
end if
end function

'在线人数
function onlineCou()
Dim onlineCounts
onlineCounts = conn.execute("Select count(ID) from [online]")(0)
response.write "<a href=""/bbs/onlineview.asp?saytk="&saytk&"&amp;sid=" & sid & """>" & onlineCounts & "</a>" & Chr(13)
end function


'会员动态
function dongtai(num)
if saytk<>1 then%>
<div style="font-size:10px;">
<%
Else
%><small><%
end if
        dim rs11,ga
        set rs11 = server.createobject("adodb.recordset")
          rs11.open"select id,dz,shijian from sqdt order by shijian desc",conn,1,1
          If rs11.eof Then 
            response.write("嗨,你在忙什么呢？！<br/>")
                  else
            rs11.Move(0)
                  ga=1
            do while ((not rs11.EOF) and ga <=num)
               
			   response.write""&ubb2(rs11("dz"))&"["
			   
			   response.write"<a href=""/bbs/dongtai.asp?saytk="&saytk&"&amp;sid="&sid&""">"
			   response.write date_dongtai(rs11("shijian"))


			   response.write"前</a>]<br/>"
                  rs11.MoveNext
                      ga=ga+1
                            loop
                   end if

if saytk<>1 then%>
</div>
<%
Else
%></small><%
end if

                rs11.close
        set rs11=nothing
end function
Function date_dongtai(dongtainum)
Dim aa,bb,cc,dd,ee,ff,gg 
aa=DateDiff("s",dongtainum,now()) 
bb=Int(aa/86400) 
cc=aa-bb*86400 
dd=Int(cc/3600)
ee=cc-dd*3600 
ff=Int(ee/60)
gg=ee-ff*60 
if gg="" or gg<=0 then gg=1
if bb>0 then Response.write bb&"天" 
if clng(bb)<1 then
if bb>0 or dd>0 then Response.write dd&"小时" 
end if
if clng(dd)<1 and clng(bb)<1 then
if bb>0 or dd>0 or ff>0 then Response.write ff&"分钟" 
end if
if clng(ff)<1 then
Response.write gg&"秒" 
end if
end Function


'最新吹牛

function cndh(num,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
dim ydzqconn
set ydzqconn=Createobject("ADODB.connection")
ydzqconn.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/words/words")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
ydzqconn.open
        dim rs122,gas2
        
 set rs122=Server.CreateObject("ADODB.Recordset")
  rs122.open"select about,useid,paycent,id from YD_jd where op=0 and reuseid=0 order by id desc",ydzqconn,1,1
if rs122.eof then       
response.write"暂无纪录!快来<br/><a href=""/bbs/words/?saytk="&saytk&"&amp;sid="&sid&""">吹牛</a>吧...<br/>"

                  else
            rs122.Move(0)
                  gas2=1
            do while ((not rs122.EOF) and gas2 <=num)
 If saytk=100 Then response.write"<li>"
      If CLng(he)=1 Then response.write ubbimg(ubblese19)      	
response.write "<a href=""/bbs/words/pkview.asp?id="&rs122("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&Left(rs122("about"),8)&"..</a>"
response.write "("&rs122("paycent")&""&getcent&")<br/>"
 If saytk=100 Then response.write"</li>"
                  rs122.MoveNext
                      gas2=gas2+1
                            loop
                   end If
 If saytk=100 Then response.write"</ul>"
rs122.close
set rs122=nothing
ydzqconn.close

end function

'最新公告
function gonggaonew()

Set Rs442 = Server.CreateObject("Adodb.Recordset")
	Sql = "SELECT * FROM gonggo order by id desc"
	Rs442.Open Sql,conn,1,1
if not rs442.eof then

    dim ggtitle1
    Response.write ""&chr(13)
    ggtitle1=left(rs442("name"),20)
   if len(rs442("name"))>20 then
    ggtitle1=ggtitle1+".."
   End if
    Response.write "<a href='vice.asp?action=view&amp;id=" & rs442("id") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>" & Left(ubb(ggtitle1),11) & "</a>"&chr(13)
  End if


rs442.close
 set rs442=nothing
end function


'社区公告
function bbsgonggaonew()

set rsbbs=Server.CreateObject("ADODB.Recordset")
    rsbbs.open"select top 1 * from [bbs_vice] order by tm desc",conn,1,1
if not rsbbs.eof then
    dim ggtitle

    Response.write ""&chr(13)
    ggtitle=left(rsbbs("name"),20)
   if len(rsbbs("name"))>20 then
    ggtitle=ggtitle+".."
   End if
    Response.write "<a href='/bbs/bbsvice.asp?action=view&amp;id=" & rsbbs("id") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>" & Left(ubb(ggtitle),11) & "</a>"&chr(13)
  End If

rsbbs.close
 set rsbbs=nothing

end function


'本站成立
function chenli()
response.write "本站已成立:"
response.write DateDiff("d",chengli,date())
response.write "天"
end function

'本站成立
function chenliss()

response.write DateDiff("d",chenglis,date())

end function



'游戏动态
function gametalk(num)
dim ydzqconns
set ydzqconns=Createobject("ADODB.connection")
ydzqconns.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/pkjd/saytk_pkjd")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
ydzqconns.open
        dim rs11,gas
        set rs11 = server.createobject("adodb.recordset")
          rs11.open"select id,talk,times from talk order by times desc",ydzqconns,1,1
          If rs11.eof Then 
            response.write("还没有任何游戏动态！<br/>")
                  else
            rs11.Move(0)
                  gas=1
            do while ((not rs11.EOF) and gas <=num)
               response.write date_gametalk(rs11("times"))&"前"&rs11("talk")&"<br/>"
                  rs11.MoveNext
                      gas=gas+1
                            loop
                   end if
                rs11.close
        set rs11=nothing
end function

'最新聊天
function roomsmsg()

dim Chat,CallRoom
set rs_xkme=server.createobject("adodb.recordset")
rs_xkme.open "select top 1 [Chattxt] from Chat where id="&saytkls,conn,1,2
if not (rs_xkme.eof and rs_xkme.bof) then
Chat=rs_xkme("Chattxt")
end if
rs_xkme.close
set rs_xkme=nothing



  if Chat<>"" then
    Chat = Replace(Chat,"\","")
    Chat = Replace(Chat,"＼","")
    Chat = Replace(Chat,chr(13),"")
    Chat = Replace(Chat,chr(10),"")

    if InStr(Chat,",") then
      Chattxt=split(Chat,",")
      CallRoom= ""&Replace(xkme_chatusb(Chattxt(0)),"chatsend.asp","/bbs/chat/chatroom.asp") &""&chr(13)
    end if
  end if

Response.write""&CallRoom&""

end function
'执行时间
Function zxsj()

response.write "页面执行 "& FormatNumber((timer()-t1)*1000,3) & " 毫秒"

end Function






Function date_gametalk(gamedatenum)
Dim aas,bbs,ccs,dds,ees,ffs,ggs 
aas=DateDiff("s",gamedatenum,now()) 
bbs=Int(aas/86400) 
ccs=aas-bbs*86400 
dds=Int(ccs/3600)
ees=ccs-dds*3600 
ffs=Int(ees/60)
ggs=ees-ffs*60 
if ggs="" or ggs<=0 then ggs=1
if bbs>0 then Response.write bbs&"天" 
if clng(bbs)<1 then
if bbs>0 or dds>0 then Response.write dds&"小时" 
end if
if clng(dds)<1 and clng(bbs)<1 then
if bbs>0 or dds>0 or ffs>0 then Response.write ffs&"分钟" 
end if
if clng(ffs)<1 then
Response.write ggs&"秒" 
end if
end Function

%>
