<%
'@@0manage/1s_udbb/2*ef/3list|list-s|zhi|zhi-g|zhi-k|tree|tree-g|tree-k|yun|zhi-m|zhi-xa|zhi-xb/4page/5psize/6ssx/7ssm/8ssf/9ssp/10sss.HTML
'@@0manage/1s_udbb/2*ef/3edit|add|del|del-x/4*id|*sn/*dx.HTML

'@@0s_udbb/1*ef/2list|list-s|zhi|zhi-g|zhi-k|tree|tree-g|tree-k|yun|zhi-m/3page/4psize/5ssx/6ssm/7ssf/8ssp/9sss.HTML
'@@0s_udbb/1*ef/2edit|add|del/3*id|*sn/*dx.HTML
'@@0s_udbb/1*ef/2show|info/3*sn.HTML

if e_xa<1 and (aibj(g_u0,s_udbb) or aibj(g_u1,s_udbb)) then
e_xa=e_xa+1
ep_id=0:ep_ew=ew_sn:ep_el=0:ep_sn=s_udbb:ep_mc="论坛主页":ep_dm=s_udbbs:ep_sk="":ep_sx=0:ep_bs=0:ep_bs=i_xkfl:ep_ls=0:ep_xy=1:ep_px=0:ep_qx=0:ep_ot="":ep_fl="":ep_xt=""
e_sks=1
Call esq()
if aibj(g_u0,s_umgl) then
Call doq(1,e_uer,8,g_u0,s_udbb,g_u2)
else
Call doq(1,e_uer,8,g_u0,s_udbb,g_u1)
end if

if aibj(g_u0,s_udbb) and (aibj(g_u1,"index") or ainull(g_u1)) then
'Call bbindex()
'if ainull(g_u2) then Response.Redirect(eshref(s_udef&g_urg&s_umds&"-m1"&g_urz,1))
'e_skc=dosk("c","","index"):Call eflist(0,"")
e_skc=dosk("c","","index"):Call bblist(0)
elseif aibj(g_u0,s_udbb) and (aibj(g_u1,s_umtj) or aibj(g_u1,s_umfb)) then
e_skc=dosk("c","","post")
if ainull(g_u2) then
Call bbadd(0,0,aistr(g_u2),aistr(g_u3))
else
Call bbadd(6,0,aistr(g_u2),aistr(g_u3))
end if
elseif aibj(g_u0,s_udbb) and (aibj(g_u2,s_umtj) or aibj(g_u2,s_umfb)) then
e_skc=dosk("c","","post")
if ainull(g_u3) then
Call bbadd(0,0,aistr(g_u3),aistr(g_u4))
else
Call bbadd(6,0,aistr(g_u3),aistr(g_u4))
end if
elseif aibj(g_u0,s_udbb) and aibj(g_u2,s_umxg) and aiint(g_u3)>0 then
e_skc=dosk("c","","edit"):Call bbedit(0)
elseif aibj(g_u0,s_udbb) and aibj(g_u2,s_umsc) and aiint(g_u3)>0 then
e_skc=dosk("c","","edit"):Call bbdel(0)
elseif aibj(g_u0,s_udbb) and dkdir(3,g_u2) then
e_skc=dosk("c","","list"):Call bblist(0)
elseif aibj(g_u0,s_udbb) and aibj(g_u2,s_umzs) and g_u3<>"" then
e_skc=dosk("c","","show"):Call bbshow(0,aistr(g_u3))
elseif aibj(g_u0,s_udbb) and aibj(g_u2,s_umxx) and g_u3<>"" then
e_skc=dosk("c","","info"):Call bbshow(1,aistr(g_u3))
elseif aibj(g_u0,s_udbb) and aibj(g_u2,"read") and g_u3<>"" then
e_skc=dosk("c","","read"):Call bbshow(2,aistr(g_u3))
elseif (e_gdj>3 or e_uty>2) and aibj(g_u0,s_umgl) and aibj(g_u1,s_udbb) and (aibj(g_u3,s_umtj) or aibj(g_u3,s_umfb)) then
Call bbadd(1,1,aistr(g_u4),aistr(g_u5))
elseif (e_gdj>3 or e_uty>2) and aibj(g_u0,s_umgl) and aibj(g_u1,s_udbb) and aibj(g_u3,s_umxg) and aiint(g_u4)>0 then
Call bbedit(1)
elseif (e_gdj>3 or e_uty>2) and aibj(g_u0,s_umgl) and aibj(g_u1,s_udbb) and ((aibj(g_u3,s_umsc) and g_u4<>"") or aibj(g_u3,s_umsc&"-x"))then
Call bbdel(1)
elseif (e_gdj>3 or e_uty>2) and aibj(g_u0,s_umgl) and aibj(g_u1,s_udbb) and dkdir(3,g_u3) then
Call bblist(1)
end if
'------get skin 0
if ainull(e_skc) then
if aibj(g_u0,s_umgl) then
e_skc=dosk("a","admin","")
else
e_skc=dosk("c","","sai")
end if
end if
'------get skin 1
Response.Write esr(0,e_skc):Response.End()
end if
'-----------------------------------
'Data Table
'=bblie()
'-----------------------------------
Function bblie(bbfty)
if bbfty="form" then
bblie="ew,sx,dx,jx,xx,sn,bt,ot,nr,up,tm,xi,xy,xt,us,t1,zi,hi,jb,jy,mm,ef"
elseif bbfty="top" then
'@@0bb_id,1bb_sn,2bb_bt,3bb_tm,4bb_hi,5bb_xi,6bb_us,7bb_up,8bb_ot,9bb_xy,10bb_ef,11bb_zi,11bb_um
bblie="bb_id,bb_sn,bb_bt,bb_tm,bb_hi,bb_xi,bb_us,bb_up,bb_ot,bb_xy,bb_ef,bb_zi,bb_um"
elseif bbfty=s_umlb then
'@@bb_id,1bb_ew,2bb_sx,3bb_dx,4bb_jx,5bb_xx,6bb_sn,7bb_bt,8bb_ot,9bb_up,10bb_tm,11bb_xi,12bb_xy,13bb_ef,14bb_zi,15bb_hi,16bb_jb,17bb_jy,18bb_mm,19bb_us,20bb_um
bblie="bb_id,bb_ew,bb_sx,bb_dx,bb_jx,bb_xx,bb_sn,bb_bt,bb_ot,bb_up,bb_tm,bb_xi,bb_xy,bb_ef,bb_zi,bb_hi,bb_jb,bb_jy,bb_mm,bb_us,bb_um"
elseif bbfty="all" then
bblie="bb_id,bb_ew,bb_sx,bb_dx,bb_jx,bb_xx,bb_sn,bb_bt,bb_ot,bb_nr,bb_up,bb_tm,bb_xi,bb_xy,bb_xt,bb_us,bb_um,bb_t1,bb_zi,bb_hi,bb_jb,bb_jy,bb_mm,bb_ef"
end if
End Function
'-----------------------------------
'top bbs list arr
'=bbrr(bbfnm,bbfps=0ep/1ef/2ssp/3ssf/4ssx/5ssm/6sss)
'-----------------------------------
Function bbrr(bbfnm,bbfps)
Call bbss(0)
Call bbtj(bbfps,0,0)
g_app=""
if bbfnm=0 or ainull(bbfnm) then
bbfnm=i_nmhc
else
bbfnm=aiint(bbfnm)
end if
if e_aiidl<>"" and e_aiidl<>"," then
dim bbdidl
bbdidl=left(e_aiidl,len(e_aiidl)-1)
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"bb_id not in ("&bbdidl&")"
end if
if e_aiids<>"" and e_aiids<>"," then
dim bbdids
bbdids=left(e_aiids,len(e_aiids)-1)
if ew_cf=0 or (ew_cf=1 and aibj(right(bbfps,len(s_umqb)),s_umqb)) then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"bb_id not in ("&bbdids&")"
end if
end if
if gystop(bbfnm,bbbid,bblie("top"),bbbiao,bbwhere,bborder,"") then
bbrr=gysar
end if
End Function
'-----------------------------------
'class all in a channel/ef
'=bbmrr(bbfty=3ef|4bbsn,bbffp)
'-----------------------------------
Function bbmrr(bbfty,bbffp)
dim bbdfp
if e_gdj>1 then
bbwhere=replace(bbwheremo,"bb_xy>0","1=1")
else
bbwhere=bbwheremo
end if
bborder=bbordermo
'EF
if bbfty=3 then
bbdfp=esrfd(0,bbffp,ew_kj)
  if not aibj(bbffp,"0") and not ainull(bbffp) and not aibj(bbffp,s_umqb) then
  if not ainull(bbwhere) then bbwhere=bbwhere&" and "
  bbwhere=bbwhere&"bb_ef='"&bbdfp&"'"
  end if
if aiint(ew_sn)>0 then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&" "&esrew("bb",ew_sn)&""
end if
if gystop(i_nmtp,bbbid,bblie(s_umlb),bbbiao,bbwhere,bborder,"") then bbmrr=gysar
'BB
elseif bbfty=4 then
dim bbdfp0,bbdfp1
bbdfp=split(bbffp&g_urg,g_urg)
bbdfp0=bbdfp(0)
bbdfp1=bbdfp(1)
if not aibj(bbdfp1,"0") and not ainull(bbdfp1) and not aibj(bbdfp1,s_umqb) then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"bb_ef='"&bbdfp1&"'"
end if
  if not aibj(bbdfp0,"0") and not ainull(bbdfp0) and not aibj(bbdfp0,s_umqb) then
  if not ainull(bbwhere) then bbwhere=bbwhere&" and "
  bbwhere=bbwhere&"(bb_sx='"&bbdfp0&"' or bb_dx='"&bbdfp0&"' or bb_sn='"&bbdfp0&"')"
  end if
if aiint(ew_sn)>0 then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&" "&esrew("bb",ew_sn)&""
end if
if gystop(i_nmtp,bbbid,bblie(s_umlb),bbbiao,bbwhere,bborder,"") then bbmrr=gysar
end if
End Function
'-----------------------------------
'BBS Menu
'=bbmenu(bbfty)
'-----------------------------------
Function bbmenu(bbfty,bbfnm,bbfdw,bbfwd)
bbmenu=bbmenu&"0"&g_gy&ew_sn&g_gy&"0"&g_gy&"0"&g_gy&"1"&g_gy&"00"&g_gy&"index"&g_gy&"网站主页"&g_gy&g_gy&g_gy&g_gy&"0"&g_gy&"2"&g_gy&""&g_gx&"0"&g_gy&ew_sn&g_gy&"0"&g_gy&"0"&g_gy&"1"&g_gy&"00"&g_gy&s_udbb&g_gy&"社区论坛"&g_gy&"论坛"&g_gy&g_gy&g_gy&"0"&g_gy&"2"&g_gy&""
bbmenu=bbmenu&g_gx&efmrr(1,s_udbb)
bbmenu=icmenushow(ep_sx,"",bbmenu,g_u0&g_u1,70,bbfnm,"14px","45px","1|"&bbfdw&"|100%|"&bbfwd)
End Function
'-----------------------------------
'select form
'=bbselect(bbfnm,bbfva,bbfdx)
'-----------------------------------
Function bbselect(bbfnm,bbfva,bbfdx)
dim bbljx,bbldx,bbleps,bblii
bbselect=""
bbselect=bbselect&"<select class=""f-s0"" name="""&bbfnm&""" id="""&bbfnm&""">"
bbselect=bbselect&"<option value=""0"">作为顶级"&s_udbbs&"</option>"
bbwhere=bbwheremo
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
if not ainull(bbfva) and not aibj(bbfva,"0") and aibj(bbfdx,"0") then
bbwhere=bbwhere&"(bb_dx='"&bbfva&"' or bb_sn='"&bbfva&"')"
elseif not ainull(bbfdx) and not aibj(bbfdx,"0") then
bbwhere=bbwhere&"(bb_dx='"&bbfdx&"' or bb_sn='"&bbfva&"')"
else
bbwhere=bbwhere&"bb_dx='0'"
end if
bborder=bbordermo
if gystop(i_nmtp,bbbid,bblie(s_umlb),bbbiao,bbwhere,bborder,"") then
gysax=split(gysar,g_gx)
for gysi=0 to ubound(gysax)
gysay=split(gysax(gysi),g_gy)
bbselect=bbselect&"<option"
if lcase(bbfva)=lcase(gysay(6)) then bbselect=bbselect&" selected"
bbselect=bbselect&" value="""&gysay(6)&""""
bbljx=aiint(gysay(4))-1
if bbljx=0 then bbselect=bbselect&" style=""color:#FF0000;"""
bbselect=bbselect&">"
if bbljx>0 then
For bblii=1 To bbljx
bbselect=bbselect&"——"
Next
end if
bbselect=bbselect&gysay(7)
if aibj(g_u0,s_umgl) then bbselect=bbselect&"("&gysay(6)&")"
bbselect=bbselect&"</option>"
next
else
bbselect=bbselect&""
end if
bbselect=bbselect&"</select>"
End Function
'-----------------------------------
'class all in a channel
'=bball(bbfep)
'-----------------------------------
Function bball(bbfep)
bbwhere=bbwheremo
if bbfep<>"" and bbfep<>"0" and bbfep<>"-" then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"bb_ep='"&bbfep&"'"
end if
bborder=bbordermo
if gystop(i_nmtp,bbbid,bblie(s_umlb),bbbiao,bbwhere,bborder,"") then
bball=gysar
end if
End Function
'-----------------------------------
'menu show
'=bbme(bbfsx,bbfys,bbfdx,bbfva,bbfsz)
'-----------------------------------
Function bbme(bbfsx,bbfys,bbfdx,bbfva,bbfsz)
dim bbljx,bbldx,bbleps,bblii
bbme=""
bbwhere=bbwheremo
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
if not ainull(bbfva) and not aibj(bbfva,"0") and aibj(bbfdx,"0") then
bbwhere=bbwhere&"(bb_dx='"&bbfva&"' or bb_sn='"&bbfva&"')"
elseif not ainull(bbfdx) and not aibj(bbfdx,"0") then
bbwhere=bbwhere&"(bb_dx='"&bbfdx&"' or bb_sn='"&bbfdx&"')"
else
bbwhere=bbwhere&"bb_dx='0'"
end if
bborder=bbordermo
if gystop(i_nmtp,bbbid,bblie(s_umlb),bbbiao,bbwhere,bborder,"") then
bbme=bbme&"<div"
if aiint(bbfsz)>1 then
bbme=bbme&" style=""font-size:"&aiint(bbfsz)&"px;"">"
else
bbme=bbme&">"
end if
bbme=bbme&icmenushow("","",gysar,bbfva,icmenutype(bbfys),0,14,28,"4|0||0")&"</div>"
else
bbme=bbme&""
end if
End Function
'-----------------------------------
'add/edit form
'=bbform()
'-----------------------------------
Function bbform(bbfty,bbfqx,bbfsn,bbfdx)
dim bbdupd
if bbfty=0 or bbfty>5 then
bb_ew=ew_sn
bb_sx=bbfsn
bb_us=e_uer
if uk_mc<>"" then
bb_um=uk_mc
elseif e_ubt<>"" then
bb_um=e_ubt
else
bb_um=e_uer
end if
bb_sn="BB"&aisn(1)
bb_jx=1
bb_xi=0
bb_hi=0
bb_zi=0
bb_jb=0
bb_jy=0
bb_bt="":bb_nr=""
if bbfqx>0 then
bb_xy=1
elseif e_uxy>0 or e_gdj>0 then
bb_xy=1
else
bb_xy=i_xkxy
end if
bb_tm=now()
bb_t1=date()
if bbfqx=1 then
bb_ef=g_u2
if not ainull(g_u5) then
bb_dx=g_u5
else
bb_dx=0
end if
if not ainull(g_u4) then
bb_sx=g_u4
else
bb_sx=0
end if
else
bb_ef=g_u1
if not ainull(g_u4) then
bb_dx=g_u4
else
bb_dx=0
end if
if not ainull(g_u3) then
bb_sx=g_u3
else
bb_sx=0
end if
end if
if aibj(bb_ef,s_umqb) or ainull(bb_ef) or bb_ef="0" then bb_ef=i_bbmo
if bbfty>5 then
bb_xt=espxx("回帖"&i_gg&e_uer)
else
bb_xt=espxx("发帖"&i_gg&e_uer)
end if
bb_up=""
else
bb_xt=bb_xt&espxx("修改"&i_gg&e_uer)
end if
bbdupd=esupcc(s_udbb,bb_sn)
if bbfty>6 then
bbform="<div class=""l-f""><form id=""EESaiForm"" name=""EESaiForm"" action="""&eshref(replace(g_ustring,g_u2&g_urg,s_umfb&g_urg),66)&""" method=""post""><ul>"
else
bbform="<div class=""l-f""><form id=""EESaiForm"" name=""EESaiForm"" action="""" method=""post""><ul>"
end if
if bbfqx=1 then
bbform=bbform&"<li class=""l-1"">标题："&aiinput("","bt","",0,200,"*请输入帖子标题","f-a2|f-b2|f-c2",bb_bt)&"编码："&aiinput("","sn","",3,50,"*仅限英文(小写)和数字用","f-a1|f-b1|f-c1",bb_sn)&"状态："&aiselect("xy","","","f-s1",bb_xy,0,i_bxy)&"</li>"
else
bbform=bbform&"<li class=""l-1"">标题："&aiinput("","bt","",0,200,"*请输入帖子标题","f-a4|f-b4|f-c4",bb_bt)&"*"&aiinput("hidden","sn","",0,0,"","",bb_sn)&aiinput("hidden","xy","",0,0,"","",bb_xy)&"</li>"
end if
if bbfqx=1 then
bbform=bbform&""&efselect(3,0,"ef",s_udbb,bb_ef)&""
if len(bb_dx)<3 then
'bbform=bbform&"<li class=""l-1"">上级："&bbselect("sx",bb_sx,bb_dx)
'if bbfty=1 then bbform=bbform&" <input type=""checkbox"" name=""tx"" id=""tx"" value=""1"">位列其下."
'bbform=bbform&"</li>"
else
bbform=bbform&"<li class=""l-1"">上级："&replace(bbselect("sx",bb_sx,bb_dx),"作为顶级"&s_udbbs&"","请选择您回复的帖子")
if bbfty=1 then bbform=bbform&" <input type=""checkbox"" name=""tx"" id=""tx"" value=""1"">位列其下."
bbform=bbform&"</li>"
end if
else
if bbfty=0 and (aibj(g_u1,s_umtj) or aibj(g_u1,s_umfb) or aibj(g_u1,s_umqb) or ainull(g_u1)) then
bbform=bbform&""&efselect(3,0,"ef",s_udbb,bb_ef)&""
else
bbform=bbform&aiinput("hidden","ef","",0,0,"","",bb_ef)
end if
bbform=bbform&aiinput("hidden","sx","",0,0,"","",bb_sx)
end if
'if bbfqx=1 then 

bbform=bbform&"<li>封面："&aiinput("","up","",0,200,"显示在列表页面的封面图片","f-a2|f-b2|f-c2",bb_up)&esup("0|0|"&bb_sn&"|"&bbdupd&"|0|EESaiForm|up|"&ew_py&"|"&ew_ps&"|0|0.ees")&"</li>"
bbform=bbform&"<li class=""l-1"">内容：（以下项目可填可不填）"&esedit(esnr(bb_nr),"nr",8)&"</li>"
if not bbfty>6 then
bbform=bbform&"<li>简介："&aiinput("","ot","",0,200,"请简单介绍一下帖子的主要内容或亮点","f-a4|f-b4|f-c4",bb_ot)&"</li>"
else
bbform=bbform&aiinput("hidden","ot","",0,0,"","",bb_ot)
end if
if bbfqx=1 or aiint(e_uid)>0 then
if not bbfty>6 then
bbform=bbform&"<li class=""l-1"">密钥："&aiinput("","mm","",3,50,"输入密钥，只有知道密钥的会员和自己可以打开查看","f-a2|f-b2|f-c2",aimm(g_gmm,bb_mm,1))&"金币："&aiinput("","jb","",6,50,"输入金币数量，只有支付一定数量金币的会员和自己才能查看","f-a1|f-b1|f-c1",bb_jb)&"经验："&aiinput("","jy","",6,50,"输入经验值，只有经验值大于指定的经验值会员和自己才能查看","f-a1|f-b1|f-c1",bb_jy)&"</li>"
else
bbform=bbform&aiinput("hidden","mm","",0,0,"","",bb_mm)&aiinput("hidden","jb","",0,0,"","",bb_jb)&aiinput("hidden","jy","",0,0,"","",bb_jy)
end if
if bbfqx=0 then bbform=bbform&aiinput("hidden","us","",0,0,"","",bb_us)&aiinput("hidden","um","",0,0,"","",bb_um)
else
bbform=bbform&aiinput("hidden","us","",0,0,"","",bb_us)&aiinput("hidden","um","",0,0,"","",bb_um)&aiinput("hidden","mm","",0,0,"","",bb_mm)&aiinput("hidden","jy","",0,0,"","",bb_jy)&aiinput("hidden","jb","",0,0,"","",bb_jb)
end if
if bbfqx=1 then
bbform=bbform&"<li class=""l-1"">点击："&aiinput("","hi","",6,50,"","f-a1|f-b1|f-c1",bb_hi)&"回复："&aiinput("","zi","",6,50,"","f-a1|f-b1|f-c1",bb_zi)&"我顶："&aiinput("","xi","",6,50,"分类我顶次数","f-a1|f-b1|f-c1",bb_xi)&"网站："&aiinput("","ew","",6,50,"","f-a1|f-b1|f-c1",bb_ew)&"</li>"
bbform=bbform&"<li>用户："&aiinput("","us","",66,50,"*","f-a1|f-b1|f-c1",bb_us)&"发布："&aiinput("","um","",0,200,"*","f-a1|f-b1|f-c1",bb_um)&"时间："&aiinput("","tm","",99,200,"添加时间","f-a1|f-b1|f-c1",bb_tm)&"更新："&aiinput("","t1","",99,200,"*","f-a1|f-b1|f-c1",bb_t1)&"<script src="""&eshref(i_dir&"GuoYanSai/FTM.js",3)&"""></script></li>"
if bbfty=1 then bbform=bbform&"<li class=""l-1"">顶级："&aiinput("","dx","",0,200,"*","f-a1|f-b1|f-c1",bb_dx)&"级深："&aiinput("","jx","",6,50,"分类级深","f-a1|f-b1|f-c1",bb_jx)&"内序："&aiinput("","xx","",0,200,"*","f-a2|f-b2|f-c2",bb_xx)&"</li>"
bbform=bbform&"<li>系统："&eseditxt(bb_xt,"xt",1)&"</li>"
else
bbform=bbform&aiinput("hidden","hi","",0,0,"","",bb_hi)&aiinput("hidden","zi","",0,0,"","",bb_zi)&aiinput("hidden","xi","",0,0,"","",bb_xi)&aiinput("hidden","ew","",0,0,"","",bb_ew)&aiinput("hidden","tm","",0,0,"","",bb_tm)&aiinput("hidden","t1","",0,0,"","",bb_t1)&aiinput("hidden","dx","",0,0,"","",bb_dx)&aiinput("hidden","jx","",0,0,"","",bb_jx)&aiinput("hidden","xx","",0,0,"","",bb_xx)&aiinput("hidden","xt","",0,0,"","",bb_xt)
end if
bbform=bbform&eskyx(0,1,2)
if bbfty=1 then
bbform=bbform&"<li class=""l-sb"">"&aibutton(2,"","","f-sb",s_umxgs)&aiinput("hidden","id","",0,0,"","",bb_id)&aiinput("hidden","y_sn","",0,0,"","",bb_sn)&aiinput("hidden","y_jx","",0,0,"","",bb_jx)&aiinput("hidden","y_dx","",0,0,"","",bb_dx)&aiinput("hidden","y_sx","",0,0,"","",bb_sx)&aiinput("hidden","y_xx","",0,0,"","",bb_xx)&aibutton(1,"","","f-sb",s_ztcz)&"</li>"
elseif bbfty=0 then
bbform=bbform&"<li class=""l-sb"">"&aibutton(2,"","","f-sb",s_umfbs)&aibutton(1,"","","f-sb",s_ztcz)&"</li>"
elseif bbfty>6 then
bbform=bbform&"<li class=""l-sb"">"&aibutton(2,"","","f-sb","快捷回复")&aibutton(1,"","","f-sb",s_ztcz)&"</li>"
elseif bbfty>5 then
bbform=bbform&"<li class=""l-sb"">"&aibutton(2,"","","f-sb","回复")&aibutton(1,"","","f-sb",s_ztcz)&"</li>"
end if
bbform=bbform&"</ul></form></div>"
End Function
'-----------------------------------
'add action
'=bbadd()
'-----------------------------------
Function bbadd(bbfty,bbfqx,bbfsn,bbfdx)
dim bbadts
if bbfty=6 then
ew_bt="回复"&s_udbbs&","&ew_bt:ew_zt="回复"&s_udbbs&","&ew_zt:ew_nr="回复"&s_udbbs&","&ew_nr:ew_cp=e_uer&","&ew_cp
e_wl=e_wl&" &gt;&gt; "&"回复"&s_udbbs&""
e_mt=esbts(s_udxbb,s_udlbb,"回复"&s_udbbs&g_gy&eshref(g_ustring,66),"<i>返回上级帖子</i>"&g_gy&eshref(replace(g_ustring,s_umfb&g_urg,s_umzs&g_urg),66)&g_gx&s_udbbs&s_umlbs&g_gy&e_ur0)
else
ew_bt=s_umfbs&s_udbbs&","&ew_bt:ew_zt=s_umfbs&s_udbbs&","&ew_zt:ew_nr=s_umfbs&s_udbbs&","&ew_nr:ew_cp=e_uer&","&ew_cp
e_wl=e_wl&" &gt;&gt; <a href="""&e_ur1&""">"&s_umfbs&s_udbbs&"</a>"
e_mt=esbts(s_udxbb,s_udlbb,s_umfbs&s_udbbs&g_gy&e_ur1,"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0)
end if
if esky(1,e_uzj) then
if aireqx("bt,ef,sn,sx") then
if gyscc(bbbid,bbbiao,"bb_sn='"&aireq("sn")&"'") then
e_ma=e_ma&aigo(s_umfbs&s_udbbs&s_ztsb&"[已存在相同的帖子]",1)
else
if aiint(e_uid)=0 then
bbadts="[您的操作需要管理员审核·您可以通过注册账号免去操作审核]"
end if
dim rqsn,rqsx
dim rddx,rdjx,rdxx
rqsn=aireq("sn")
rqsx=aireq("sx")
'more tree
if rqsx<>"" and rqsx<>"0" then
Call saik(rs,"select top 1 bb_bt,bb_dx,bb_sx,bb_sn,bb_jx,bb_xx,bb_t1,bb_zi from "&bbbiao&" where bb_sx='"&rqsx&"' or bb_sn='"&rqsx&"' order by bb_xx desc",1,1)
If rs.BOF And rs.EOF Then
else
Do While Not rs.EOF
rddx=rs("bb_dx")
rdjx=aiint(rs("bb_jx"))
rdxx=rs("bb_xx")
if rddx="0" or rdjx=1 then
rdjx=2
rdxx=rdxx&"001"
rddx=rs("bb_sn")
if rqsn="" then rqsn=rddx&"001"
elseif rqsx=rs("bb_sn") then
rdjx=rdjx+1
rdxx=rdxx&"001"
if rqsn="" then rqsn=rqsx&"001"
else
rdxx=left(rdxx,len(rdxx)-3)&right("000"&aisnk(aisnk(right(rdxx,3),1)+1,0),3)
if rqsn="" then rqsn=rqsx&right(rdxx,3)
end if
exit do
rs.movenext
Loop
end if
Call saig(rs)
'1 tree
else
rddx="0"
rdjx="1"
rdxx="000001-"
Call saik(rs,"select top 1 bb_xx from "&bbbiao&" where bb_dx='0' order by bb_xx desc",1,1)
If rs.BOF And rs.EOF Then
else
Do While Not rs.EOF
rdxx=rs("bb_xx")
rdxx=right("000000"&aisnk(aisnk(left(rdxx,6),1)+1,0),6)&"-"
exit do
rs.movenext
Loop
end if
Call saig(rs)
end if
'make sn
if rqsn="" then
rqsn=rdxx
else
Call aisn(0)
end if
'update
Call saik(rs,"select "&bblie("all")&" from "&bbbiao&" where bb_sn='"&rqsn&"' or (bb_us='"&e_uer&"' and bb_bt='"&aireq("bt")&"')",1,3)
If rs.BOF And rs.EOF Then
rs.addnew
rs("bb_ew")=aiint(aireq("ew"))
rs("bb_us")=aireq("us")
rs("bb_um")=aireq("um")
rs("bb_up")=aireq("up")
rs("bb_sx")=rqsx
rs("bb_dx")=rddx
rs("bb_jx")=rdjx
rs("bb_xx")=rdxx
rs("bb_sn")=rqsn
rs("bb_bt")=aireq("bt")
rs("bb_ot")=aireq("ot")
rs("bb_nr")=aireq("nr")
rs("bb_xt")=aireq("xt")
rs("bb_t1")=aireq("t1")
rs("bb_zi")=aiint(aireq("zi"))
rs("bb_hi")=aiint(aireq("hi"))
rs("bb_jb")=aiint(aireq("jb"))
rs("bb_jy")=aiint(aireq("jy"))
rs("bb_mm")=aireq("mm")
rs("bb_xy")=aiint(aireq("xy"))
rs("bb_xi")=aiint(aireq("xi"))
rs("bb_tm")=aireq("tm")
rs("bb_ef")=aireq("ef")
rs.update
else
e_ma=e_ma&aigo(s_umfbs&s_udbbs&s_ztsb&"[你发布过相同的帖子]",1)
'Response.End()
end if
Call saig(rs)
'do app
if not aibj(rqsx,"0") or not ainull(rqsx) then Call gysgx(bbbiao,"bb_zi=bb_zi+1","bb_sn='"&rqsx&"'")
if (not aibj(rddx,"0") or not ainull(rddx)) and not aibj(rqsx,rddx) then Call gysgx(bbbiao,"bb_zi=bb_zi+1","bb_sn='"&rddx&"'")
if i_xkuhy>0 and i_xkuhj=1 and aiint(e_uid)>0 then
if gysgx(saidbqz&"us","us_jb=us_jb+"&i_jcjb&"","us_id="&e_uid&"") then e_ma=e_ma&usergx("jb",e_ujb+i_jcjb)
end if
if bbfqx=1 then
e_ma=e_ma&aigo(s_umfbs&s_udbbs&s_ztcg&bbadts,e_ur0)
else
if bbfty=6 then
e_ma=e_ma&aitiao(s_umfbs&s_udbbs&s_ztcg&bbadts,eshref(replace(g_ustring,s_umfb&g_urg,s_umxx&g_urg),66),i_nmtz)
else
e_ma=e_ma&aitiao(s_umfbs&s_udbbs&s_ztcg&bbadts,eshref(s_udbb&g_urg&aireq("ef")&g_urg&s_umxx&g_urg&rqsn&g_urz,66),i_nmtz)
end if
end if
end if
else
e_ma=e_ma&aigo(s_umfbs&s_udbbs&s_ztsb&"[请认真填写帖子标题]",1)
end if
else
e_ma=bbform(bbfty,bbfqx,bbfsn,bbfdx)&e_ma
end if
End Function
'-----------------------------------
'edit action
'=bbedit()
'-----------------------------------
Function bbedit(bbfqx)
ew_bt=s_umxgs&s_udbbs&","&ew_bt:ew_zt=s_umxgs&s_udbbs&","&ew_zt:ew_nr=s_umxgs&s_udbbs&","&ew_nr:ew_cp=e_uer&","&ew_cp
if bbfqx=1 then
e_mt=esbts(s_udxbb,s_udlbb,s_umxgs&s_udbbs&g_gy&eshref(s_umgl&g_urg&s_udbb&g_urg&ef_sn&g_urg&s_umxg&g_urg&g_u4&g_urz,66),"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0)
else
e_mt=esbts(s_udxbb,s_udlbb,s_umxgs&s_udbbs&g_gy&eshref(s_udbb&g_urg&ef_sn&g_urg&s_umxg&g_urg&g_u4&g_urz,66),"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0)
end if
dim rqsn,rqsx,rdjxl
dim rddx,rdjx,rdxx
dim rqtx
dim bbscid,bbscsn,bbscjx,bbscdx,bbscsx,bbscxx
Dim rsnum,sqlbb
if aibj(g_u0,s_umgl) then
bbscid=aiint(g_u4)
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(s_umgl&g_urg&s_udbb&g_urg&ef_sn&g_urg&s_umxg&g_urg&bbscid&g_urz,66)&""">"&s_umxgs&s_udbbs&"</a>"
else
bbscid=aiint(g_u3)
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(s_udbb&g_urg&ef_sn&g_urg&s_umxg&g_urg&bbscid&g_urz,66)&""">"&s_umxgs&s_udbbs&"</a>"
end if

if esky(1,e_uzj) then
if aireqx("bt,sn,sx") then
bbscid=aiint(aireq("id"))
bbscsn=aireq("y_sn")
bbscjx=aiint(aireq("y_jx"))
bbscdx=aireq("y_dx")
bbscsx=aireq("y_sx")
bbscxx=aireq("y_xx")
rqsx=aireq("sx")
rqsn=aireq("sn")
rqtx=aireq("tx")
'if bbscsn=rqsx or bbscsx=rqsn or left(rqsx,len(bbscsx))=bbscsx or left(bbscsx,len(rqsx))=rqsx or left(bbscsx,len(rqsn))=rqsn or left(bbscsn,len(rqsx))=rqsx then
if bbscsn=rqsx or bbscsx=rqsn then
e_ma=e_ma&aigo(s_umxgs&s_udbbs&s_ztsb,1)
Response.End()
Exit Function
elseif rqsx=bbscsx then
rdxx=bbscxx
rddx=bbscdx
rdjx=bbscjx
elseif rqsx="" or rqsx="0" then
rddx="0"
rdjx="1"
Call saik(rs,"select top 1 bb_xx from "&bbbiao&" where bb_dx='0' order by bb_xx desc",1,1)
If rs.BOF And rs.EOF Then
rdxx="000001-"
else
Do While Not rs.EOF
rdxx=rs("bb_xx")
rdxx=right("000000"&aisnk(aisnk(left(rdxx,6),1)+1,0),6)&"-"
exit do
rs.movenext
Loop
end if
Call saig(rs)
else
if aibj(rqtx,"1") then
sqlbb="select top 1 bb_bt,bb_dx,bb_sx,bb_sn,bb_jx,bb_xx from "&bbbiao&" where bb_sn='"&rqsx&"' order by bb_xx desc"
else
sqlbb="select top 1 bb_bt,bb_dx,bb_sx,bb_sn,bb_jx,bb_xx from "&bbbiao&" where bb_sx='"&rqsx&"' or bb_sn='"&rqsx&"' order by bb_xx desc"
end if
Call saik(rs,sqlbb,1,1)
If rs.BOF And rs.EOF Then
else
Do While Not rs.EOF
rddx=rs("bb_dx")
rdjx=aiint(rs("bb_jx"))
rdxx=rs("bb_xx")
if rqtx="1" then
rdxx=rdxx&"SAI"
rqsx=rs("bb_sx")
else
if rddx="0" or rdjx="1" then
rdjx=2
rdxx=rdxx&"001"
rddx=rs("bb_sn")
elseif rqsx=rs("bb_sn") then
rdjx=rdjx+1
rdxx=rdxx&"001"
else
rdxx=left(rdxx,len(rdxx)-3)&right("000"&aisnk(aisnk(right(rdxx,3),1)+1,0),3)
end if
end if
exit do
rs.movenext
Loop
end if
Call saig(rs)
end if
'update
sqlbb="select "&bblie("all")&" from "&bbbiao&" where bb_id="&aiint(aireq("id"))&" or (bb_id<>"&aiint(aireq("id"))&" and bb_sn='"&rqsn&"')"
Call saik(rs,sqlbb,1,3)
rsnum=rs.recordcount
if rsnum=1 then
rs("bb_ew")=aiint(aireq("ew"))
rs("bb_us")=aireq("us")
rs("bb_um")=aireq("um")
rs("bb_up")=aireq("up")
rs("bb_sx")=rqsx
rs("bb_dx")=rddx
rs("bb_jx")=rdjx
rs("bb_xx")=rdxx
rs("bb_sn")=rqsn
rs("bb_bt")=aireq("bt")
rs("bb_ot")=aireq("ot")
rs("bb_nr")=aireq("nr")
rs("bb_xt")=aireq("xt")
rs("bb_xy")=aiint(aireq("xy"))
rs("bb_t1")=aireq("t1")
rs("bb_zi")=aiint(aireq("zi"))
rs("bb_hi")=aiint(aireq("hi"))
rs("bb_jb")=aiint(aireq("jb"))
rs("bb_jy")=aiint(aireq("jy"))
rs("bb_mm")=aireq("mm")
rs("bb_ef")=aireq("ef")
rs("bb_xi")=aiint(aireq("xi"))
rs("bb_tm")=aireq("tm")
rs.update
else
e_ma=e_ma&aigo(s_umxgs&s_udbbs&s_ztsb&"[存在相同编码SN的帖子]",1)
Response.End()
Exit Function
end if
Call saig(rs)

'编辑保存
if rqsn<>bbscsn or rqsx<>bbscsx then
sqlbb="select bb_sx,bb_dx,bb_jx,bb_xx from "&bbbiao&" where bb_xx like '"&bbscxx&"%' and bb_sn<>'"&rqsn&"' order by bb_xx desc"
Call saik(rs,sqlbb,1,3)
while not rs.eof 
if rqsn<>bbscsn then'edit sn
if rs("bb_sx")=bbscsn then rs("bb_sx")=rqsn
end if
rs("bb_xx")=rdxx&right(rs("bb_xx"),len(rs("bb_xx"))-len(bbscxx))
rdjxl=aiint(rs("bb_jx"))+rdjx-bbscjx
rs("bb_jx")=rdjxl
if (rddx="0" or rdjx="1") and rdjxl=2 then
rs("bb_dx")=rqsn
else
rs("bb_dx")=rddx
end if
rs.update
rs.movenext 
wend 
Call saig(rs)
end if
'完成

e_ma=e_ma&aitiao(s_umxgs&s_udbbs&s_ztcg,eshref(s_udbb&g_urg&ef_sn&g_urg&s_umxx&g_urg&rqsn&g_urz,66),i_nmtz)
else
e_ma=e_ma&aigo(s_umxgs&s_udbbs&s_ztsb,1)
end if
'edit form
else
if bbfqx=1 then
bbwhere="bb_id="&aiint(g_u4)&""
else
bbwhere="bb_id="&aiint(g_u3)&" and bb_us='"&e_uer&"'"
end if
if gysread(bblie("all"),bbbiao,bbwhere,"") then
ew_bt=bb_bt&","&ew_bt:ew_zt=bb_bt&","&ew_zt:ew_nr=bb_bt&","&ew_nr
e_ma=bbform(1,bbfqx,bb_sx,bb_dx)&e_ma
else
e_ma=e_ma&aigo(s_udbbs&s_ztno,1)
end if
end if
End Function
'-----------------------------------
'del
'=bbdel()
'-----------------------------------
Function bbdel(bbfqx)
ew_bt=s_udbbs&s_umscs&","&ew_bt:ew_zt=s_udbbs&s_umscs&","&ew_zt:ew_nr=s_udbbs&s_umscs&","&ew_nr:ew_cp=e_uer&","&ew_cp
if bbfqx=1 then
bbwhere="bb_id="&aiint(g_u4)
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(s_umgl&g_urg&s_udbb&g_urg&ef_sn&g_urg&d_sbbls&g_urz,66)&""">"&ef_bt&"</a> &gt;&gt; "&s_udbbs&s_umscs&""
else
bbwhere="bb_us='"&e_uer&"' and bb_xy<2 and bb_zi=0 and bb_id="&aiint(g_u3)
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(s_udbb&g_urg&ef_sn&g_urg&d_sbbls&g_urz,66)&""">"&ef_bt&"</a> &gt;&gt; "&s_udbbs&s_umscs&""
end if
e_mt=esbts(s_udxbb,s_udlbb,s_umscs&s_udbbs,"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0)
if aibj(g_u3,s_umsc&"-x") then
if gysdel(bbbid,bbbiao,0) then e_ma=e_ma&aitiao(s_udbbs&s_umscs&s_ztcg,e_ur0,i_nmtz)
else
if gysdel(bbbid,bbbiao,bbwhere) then
e_ma=e_ma&aitiao(s_udbbs&s_umscs&s_ztcg,e_ur0,i_nmtz)
else
e_ma=e_ma&aigo(s_udbbs&s_umscs&s_ztsb,1)
end if
end if
End Function
'-----------------------------------
'show
'=bbshow()
'-----------------------------------
Function bbshow(bbfty,bbfsn)
if e_gdj>1 then
bbwhere=""
elseif e_uid>0 then
bbwhere=" and (bb_us='"&e_uer&"' or bb_xy>0)"
else
bbwhere=" and bb_xy>0"
end if
if gysread(bblie("all"),bbbiao,"bb_sn='"&bbfsn&"'"&bbwhere&"","") then
ew_bt=bb_bt&","&ew_bt:ew_zt=bb_bt&","&ew_zt:ew_nr=bb_bt&","&ew_nr:ew_cp=bb_us&","&ew_cp
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urz,66)&""">"&s_udbbs&s_umxxs&"</a>"
dim bbdsx,bbdpur,bbdpg,bbdmm,bbdxg
if ainull(g_u4) then
bbdpg=1
else
bbdpg=aiint(g_u4)
end if
bbdmm=g_u5
if aibj(e_uer,bb_us) and aiint(bb_xy)<2 then bbdxg=g_gx&"[编辑]"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxg&g_urg&bb_id&g_urz,66)
if bbfty=2 then
e_mt=esbts(bbdsx,s_udlbb,"阅读"&s_udbbs&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urz,66),"<i>回复"&s_udbbs&"</i>"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umfb&g_urg&bb_sn&g_urg&bb_dx&g_urz,66)&g_gx&"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0&g_gx&"<u>普通模式</u>"&g_gx&"单帖浏览"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urz,66)&g_gx&"树形浏览"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urz,66)&bbdxg)
bbdpur=eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urg&g_gp&g_urg&bbdmm&g_urz,66)
elseif bbfty=1 then
e_mt=esbts(bbdsx,s_udlbb,s_udbbs&s_umxxs&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urz,66),"<i>回复"&s_udbbs&"</i>"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umfb&g_urg&bb_sn&g_urg&bb_dx&g_urz,66)&g_gx&"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0&g_gx&"普通模式"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&"read"&g_urg&bb_sn&g_urz,66)&g_gx&"单帖浏览"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urz,66)&g_gx&"<u>树形浏览</u>"&bbdxg)
bbdpur=eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urg&g_gp&g_urg&bbdmm&g_urz,66)
else
e_mt=esbts(bbdsx,s_udlbb,s_umzss&s_udbbs&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urz,66),"<i>回复"&s_udbbs&"</i>"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umfb&g_urg&bb_sn&g_urg&bb_dx&g_urz,66)&g_gx&"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1&g_gx&"<i>"&s_udbbs&s_umlbs&"</i>"&g_gy&e_ur0&g_gx&"普通模式"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&"read"&g_urg&bb_sn&g_urz,66)&g_gx&"<u>单帖浏览</u>"&g_gx&"树形浏览"&g_gy&eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urz,66)&bbdxg)
bbdpur=eshref(s_udbb&g_urg&bb_ef&g_urg&s_umzs&g_urg&bb_sn&g_urg&g_gp&g_urg&bbdmm&g_urz,66)
end if


icdcb=bb_bt
'if not ainull(bb_ot) and not aibj(bb_ot,"0") then icdcb=icdcb&"<span>"&bb_ot&"</span>"
icdcc=easzy(10,bb_id,bb_sn,bb_ot,bb_bt,bb_nr,bb_mm,aimm(g_gmm,bbdmm,0))
'--------------------------------HENG 0
icdcd=eshi(4,bb_id,bb_hi)
icdcd=icdcd&s_udbbs&"状态："&aiarr(i_bxy,"|",aiint(bb_xy))
if not ainull(bb_tm) then icdcd=icdcd&" 发布时间："&aitm(bb_tm,9)
if not ainull(bb_um) or not ainull(bb_us) then
icdcd=icdcd&" 发布："
if not ainull(bb_us) and i_xkubq=1 then
icdcd=icdcd&"<a href="&eshref(s_udus&g_urg&s_umzs&g_urg&bb_us&g_urz,66)&" target=_blank>"&usren(bb_um&g_gg&bb_us)&"</a>"
else
icdcd=icdcd&usren(bb_um&g_gg&bb_us)
end if
end if
'--------------------------------HENG 1
'--------------------------------CONTENT 0
icdci=""
if i_xkubq>1 then icdci=icdci&usrqm(46,bb_us,us_xy&g_gg&us_qm&g_gg&us_up&g_gg&us_sn&g_gg&us_bt)
if aiint(e_uty)>2 or aibj(e_uer,bb_us) then
icdci=icdci&esnrgys(bb_nr,bbdpur,bbdpg)
else
if e_ujy>=aiint(bb_jy) then
if aiint(bb_jb)=0 then
icdci=icdci&esmm(0,esnrgys(bb_nr,bbdpur,bbdpg),eshref(s_udbb&g_urg&bb_ef&g_urg&g_u2&g_urg&bb_sn&g_urg&g_u4&g_urg&g_gg&g_urz,66),bb_mm,aimm(g_gmm,bbdmm,0))
else
icdci=icdci&esmm(0,esnrgys(bbjb(bb_nr,eshref(s_udbb&g_urg&bb_ef&g_urg&g_u2&g_urg&bb_sn&g_urz,66),bb_jb,bb_id),bbdpur,bbdpg),eshref(s_udbb&g_urg&bb_ef&g_urg&g_u2&g_urg&bb_sn&g_urg&g_u4&g_urg&g_gg&g_urz,66),bb_mm,aimm(g_gmm,bbdmm,0))
end if
else
icdci=icdci&"<i>需要经验值达到 "&aiint(bb_jy)&" 才能查看"&s_udbbs&"(您的经验值为 "&e_ujy&")</i>"
end if
end if

if not ainull(bb_up) and i_upxf>0 then
if instr(bb_nr,bb_up)=0 then icdcj=easpic(bb_up,bb_bt,bb_bt,bb_up,3)
end if

icdcm=""
if ew_pj>0 then icdcm=icdcm&"<div class=""c-l"">"&eshi(1,bb_id,bb_xi)&"</div>"
icdcm=icdcm&esfx()
'--------------------------------CONTENT 1
icdty=9
e_ma=e_ma&icnr(icdty,s_udbbs,icdcb,icdcc,icdcd,icdcf,icdcg,icdci,icdcj,icdcm)

e_ma=e_ma&espl(eshref(s_udbb&g_urg&bb_ef&g_urg&s_umxx&g_urg&bb_sn&g_urz,66),bb_id,0,bb_xt,bbbiao,"bb_xt","bb_id","")

'--------------------------------LIST 0
if aiint(bb_zi)>0 then
if bbfty=1 then
if bb_dx="0" or ainull(bb_dx) then
if gystop(i_nmtp,bbbid,bblie(s_umlb)&",bb_nr",bbbiao,"bb_dx='"&bb_sn&"'"&bbwhere&"",bbordermo,"") then
e_ma=e_ma&"<li class=""c-h"">主题 · 树形回帖</li><div>"
e_ma=e_ma&icmenushow("","k-1 d-1 d-2 d-3",gysar,bb_sn,21,0,14,28,"4|0|12|1")
e_ma=e_ma&"</div>"
end if
else
if gystop(i_nmtp,bbbid,bblie(s_umlb)&",bb_nr",bbbiao,"bb_dx='"&bb_dx&"' and bb_sn<>'"&bb_sn&"' and bb_xx like '"&bb_xx&"%'"&bbwhere&"",bbordermo,"") then
e_ma=e_ma&"<li class=""c-h"">回帖 · 树形回帖</li><div>"
e_ma=e_ma&icmenushow("","",gysar,bb_sn,21,0,14,28,"4|0|12|1")
e_ma=e_ma&"</div>"
end if
end if
end if
end if
'--------------------------------LIST 1
e_ma=e_ma&"</div></div></div>"
else
e_ma=e_ma&aigo(s_udbbs&s_ztno,1)
end if
End Function
'-----------------------------------
'bbjb
'=bbjb()
'-----------------------------------
Function bbjb(bbfstr,bbfurl,bbfjb,bbfid)
bbfjb=aiint(bbfjb)
bbfid=aiint(bbfid)
'response.Cookies(i_sn&bbfid&s_udbb)=""
if bbfjb=0 or aiint(Request.Cookies(i_sn&bbfid&s_udbb))>=bbfjb then
bbjb=bbfstr
else
if e_ujb>=bbfjb then
dim bbrjb
bbrjb=aiint(request.Form("jb"))
if bbrjb=0 then
bbjb="<table width=128 border=0 cellspacing=2 cellpadding=5 align=center bgcolor=red><form method=post action="&bbfurl&"><tr><td align=center><input type=hidden name=jb id=jb value="&bbfjb&"><input type=submit onClick=""if(confirm('注意！这个操作将消耗您 "&bbfjb&" 金币(您有金币"&e_ujb&")，请再次确认(您将有约20分钟的时间来查看"&s_udbbs&"，退出登录浏览权失效)。')){return true;}else{return false;}"" value=""花 "&bbfjb&" 金币购买"" style=width:120px></td></tr></form></table>"
else
if i_xkuhy>0 and i_xkuhj=1 and aiint(e_uid)>0 then
if gysgx(saidbqz&"us","us_jb=us_jb-"&bbrjb&"","us_id="&e_uid&"") then
bbjb=usergx("jb",e_ujb-bbrjb)
Response.Cookies(i_sn&bbfid&s_udbb)=bbrjb
Response.Cookies(i_sn&bbfid&s_udbb).Expires=(now()+1/72)
end if
response.Redirect(bbfurl)
response.End()
end if
end if
else
bbjb="<i>需要金币数达到 "&bbfjb&" 才能查看"&s_udbbs&"(您的金币数为 "&e_ujb&")</i>"
end if
end if
End Function
'-----------------------------------
'list
'=bblist()
'-----------------------------------
Function bblist(bbfqx)
dim bbllists,bbllies
bbllists=""
e_mt=esbts(s_udxbb,s_udlbb,s_udbbs&s_umlbs&g_gy&e_ur0,"<i>"&s_umfbs&s_udbbs&"</i>"&g_gy&e_ur1)
'do link
dim bblpg,bblps,bblpuq,bblpuh,bblpur,bblgrr,bblms,bblpum,bbdotl
if bbfqx=1 then
bblpum=77
bblpuq=s_umgl&g_urg&s_udbb&g_urg&ef_sn
bblms=g_u3
bblpuh=g_u6&g_urg&g_u7&g_urg&g_u8&g_urg&g_u9&g_urg&g_u10
bblpur=eshref(bblpuq&g_urg&bblms&g_urg&g_gp&g_urg&g_gp&g_urg&bblpuh&g_urz,bblpum)
bblpg=aiint(g_u4)
bblps=aiint(g_u5)
else
bblpum=66
bblpuq=s_udbb&g_urg&ef_sn
bblms=g_u2
bblpuh=g_u5&g_urg&g_u6&g_urg&g_u7&g_urg&g_u8&g_urg&g_u9
bblpur=eshref(bblpuq&g_urg&bblms&g_urg&g_gp&g_urg&g_gp&g_urg&bblpuh&g_urz,bblpum)
bblpg=aiint(g_u3)
bblps=aiint(g_u4)
end if
if ainull(bblms) then bblms=d_sbbls
bbllies=bblie(s_umlb)
if aibj(bblms,s_umds&"-knr") then bbllies=bbllies&",bb_nr"
'list top
if bbfqx=1 then e_ma=e_ma&replace(icmenu("","","1|"&s_udbb,ef_sn,4004,0,14,28,0),s_udbb&g_urg,s_umgl&g_urg&s_udbb&g_urg)
if aibj(left(bblms,len(s_umds&"-m")),s_umds&"-m") then
bbdotl="3|0||1|"&i_wlen
else
bbdotl="3|0||1|"&i_wlen
end if
iclls="<div class=""l-tb"&estt(bblms,s_umyq)&"""><a href="""&eshref(bblpuq&g_urg&s_umyq&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">"&s_udbbs&s_umyqs&"</a></div><div class=""l-tb"&estt(left(bblms,len(s_umlb)),s_umlb)&"""><a href="""&eshref(bblpuq&g_urg&s_umlb&"-s"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">主题"&s_udbbs&"</a><li><a href="""&eshref(bblpuq&g_urg&s_umlb&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">全部"&s_udbbs&"</a></li></div><div class=""l-tb"&estt(left(bblms,len(s_umds)),s_umds)&"""><a href="""&eshref(bblpuq&g_urg&s_umds&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">树形"&s_udbbs&"</a>"
iclls=iclls&"<li><a href="""&eshref(bblpuq&g_urg&s_umds&"-k"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">展开树形</a></li><li><a href="""&eshref(bblpuq&g_urg&s_umds&"-knr"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">树形文本</a></li><li><a href="""&eshref(bblpuq&g_urg&s_umds&"-g"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">闭合树形</a></li><li><a href="""&eshref(bblpuq&g_urg&s_umds&"-m1"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">"&s_udbbs&"梯田</a></li>"
if e_uty>1 and bbfqx=1 then iclls=iclls&"<li><a onClick=""if(confirm('注意！"&s_ztqr&"')){return true;}else{return false;}"" href="""&eshref(bblpuq&g_urg&s_umds&"-xa"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">重排树枝</a></li><li><a onClick=""if(confirm('注意！"&s_ztqr&"')){return true;}else{return false;}"" href="""&eshref(bblpuq&g_urg&s_umds&"-xb"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">树枝重置</a></li>"
iclls=iclls&"</div><div class=""l-tb"&estt(left(bblms,len(s_umxs)),s_umxs)&"""><a href="""&eshref(bblpuq&g_urg&s_umxs&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">"&s_udbbs&s_umxss&"</a>"
iclls=iclls&"<li><a href="""&eshref(bblpuq&g_urg&s_umxs&"-k"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">展开小树</a></li><li><a href="""&eshref(bblpuq&g_urg&s_umxs&"-g"&g_urg&g_urg&g_urg&bblpuh&g_urz,bblpum)&""">闭合小树</a></li></div>"
Call bbss(0)
e_ma=e_ma&icliq(iclls,bblpuq&g_urg&bblms,bblpuh,e_gdj,bbfqx,"bb")
Call bbtj(s_udbb&g_urg&ef_sn&g_urg&bblpuh,0,0)

if aibj(bblms,s_umds&"-xa") or aibj(bblms,s_umds&"-xb") then
if ainull(ef_sn) or aibj(ef_sn,s_umqb) then
e_ma=e_ma&ictreexx(bblms,g_u11,"bb",esrew("bb",ew_sn))
else
e_ma=e_ma&ictreexx(bblms,g_u11,"bb","bb_ef='"&ef_sn&"'")
end if
else

if aibj(left(bblms,len(s_umds)),s_umds) or aibj(left(bblms,len(s_umxs)),s_umxs) or aibj(bblms,s_umlb&"-s") then
if bblps<1 then bblps=i_nmlb
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"bb_sx='0'"
'ew
if aiint(ew_sn)>0 then bbwhere=bbwhere&" and bb_ew="&aiint(ew_sn)
elseif aibj(bblms,s_umyq) then
if bblps<1 then bblps=i_nmhc
else'aibj(bblms,s_umlb)
if bblps<1 then bblps=i_nmlb
end if
bborder="bb_id desc"
'@@bb_id,1bb_ew,2bb_sx,3bb_dx,4bb_jx,5bb_xx,6bb_sn,7bb_bt,8bb_ot,9bb_up,10bb_tm,11bb_xi,12bb_xy,13bb_ef,14bb_zi,15bb_hi,16bb_jb,17bb_jy,18bb_mm,19bb_us,20bb_nr
if gyslist(bbbid,bbllies,bbbiao,bbwhere,bborder,bblpur,bblpg,bblps,200,"") then
if aibj(left(bblms,len(s_umds)),s_umds) or aibj(left(bblms,len(s_umxs)),s_umxs) then
gysaxbb=split(gysar,g_gx)
for gysibb=0 to ubound(gysaxbb)
if gysibb>0 then bbllists=bbllists&g_gx
gysaybb=split(gysaxbb(gysibb),g_gy)
if aibj(ef_sn,s_umqb) or ainull(ef_sn) then
if bbfqx=1 then
bbwhere="bb_dx='"&gysaybb(6)&"' or bb_sn='"&gysaybb(6)&"'"
else
bbwhere="(bb_dx='"&gysaybb(6)&"' or bb_sn='"&gysaybb(6)&"') and bb_xy>0"
end if
else
if bbfqx=1 then
bbwhere="(bb_dx='"&gysaybb(6)&"' or bb_sn='"&gysaybb(6)&"') and bb_ef='"&gysaybb(13)&"'"
else
bbwhere="(bb_dx='"&gysaybb(6)&"' or bb_sn='"&gysaybb(6)&"') and bb_xy>0 and bb_ef='"&gysaybb(13)&"'"
end if
end if
if gystop(i_nmtp,bbbid,bbllies,bbbiao,bbwhere,bbordermo,"") then
bbllists=bbllists&gysar
end if
'if gysibb<ubound(gysaxbb) then bbllists=bbllists&g_gx
next
e_ma=e_ma&icmenushow("","",bbllists,ef_sn,icmenutype(bblms),0,14,28,bbdotl)
else
e_ma=e_ma&icmenushow("","",gysar,ef_sn,icmenutype(bblms),0,14,28,bbdotl)
end if
else
e_ma=e_ma&"<div class=""l-tc"">"&s_ztkl&"</div>"
end if

e_ma=e_ma&iclih(gyspage,e_gdj,bbfqx,eshref(s_umgl&g_urg&s_udbb&g_urg&ef_sn&g_urg&s_umsc&"-x"&g_urz,77),"bb")
end if
End Function
'-----------------------------------
'zhi auto make
'=bbzhix(esfys,esfef)
'-----------------------------------
Function bbzhix(esfys,esfef)
dim bbxai,bbxzjx,bbscjx,bbllxx,bbscxx,bbllsx,bbxzxx
bbzhix=bbzhix&"<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""5"" class=""tree"">"
bbzhix=bbzhix&"<tr class=""l-2""><td>名称</td><td>顶级</td><td>上级</td><td>级深</td><td>内序</td><td>编码</td></tr>"
if aibj(esfef,s_umqb) then
bbwhere="bb_ew="&ew_sn
else
bbwhere="bb_ef='"&esfef&"'"
end if
bborder="bb_xx asc"
if i_xktr=1 then
if gystop(1,"bb_id","bb_xx",bbbiao,"bb_dx='0'","bb_xx desc","") then
gysax=split(gysar,g_gx)
for gysi=0 to ubound(gysax)
gysay=split(gysax(gysi),g_gy)
bbxai=aisnk(left(gysay(0),6),1)
next
else
bbxai=0
end if
end if
bbwhere=" where "&bbwhere&" "
Call saik(rs,"select bb_sn,bb_sx,bb_dx,bb_jx,bb_xx,bb_xt,bb_bt from "&bbbiao&bbwhere&"order by "&bborder&"",1,3)
If rs.BOF And rs.EOF Then
bbzhix=bbzhix&"<tr><td><a href="""&e_ur1&""">请您先添加"&s_udbbs&"！</a></td><td></td><td></td><td></td><td></td><td></td></tr>"
else
Do While Not rs.eof
bbxzjx=aiint(rs("bb_jx"))
bbxzxx=rs("bb_xx")
'jx=1
if bbxzjx=1 or len(bbxzxx)<7 or rs("bb_sx")="0" or rs("bb_dx")="0" then
bbxai=bbxai+1
if i_xktr=1 then
bbllxx=right("000000"&aisnk(bbxai,0),6)&"-"
else
if aibj(left(bbxzxx,6),left(bbscxx,6)) then
bbllxx=right("000000"&aisnk(aiint(aiint(aisnk(left(bbscxx,6),1))+1),0),6)&"-"
elseif left(bbxzxx,6)="000000" then
bbllxx=right("000000"&aisnk(bbxai,0),6)&"-"
else
bbllxx=right("000000"&replace(bbxzxx,"-",""),6)&"-"
end if
if left(bbllxx,6)="000000" then bbllxx=right("000000"&aisnk(aiint(aiint(aisnk(left(bbscxx,6),1))+1),0),6)&"-"
end if
rs("bb_jx")="1"
rs("bb_sx")="0"
rs("bb_dx")="0"
if aibj(esfys,s_umds&"-xb") then
rs("bb_xt")=rs("bb_xt")&espxx("["&rs("bb_sn")&"]重置"&i_gg&e_gmc)
rs("bb_sn")=bbllxx'sn x
end if
'jx>1
else

'jx=2
if bbxzjx=2 then
bbllsx=left(bbscxx,7)
if len(bbscxx)>7 then
bbllxx=bbllsx&right("000"&aisnk(aisnk(right(left(bbscxx,10),3),1)+1,0),3)
else
bbllxx=bbllsx&"001"
end if
'xzjx>scjs
elseif bbxzjx>bbscjx then
bbllsx=bbscxx
bbllxx=bbllsx&"001"
rs("bb_jx")=bbscjx+1
'xzjx=scjs
elseif bbxzjx=bbscjx then
bbllsx=left(bbscxx,len(bbscxx)-3)
bbllxx=bbllsx&right("000"&aisnk(aisnk(right(bbscxx,3),1)+1,0),3)
rs("bb_jx")=bbscjx
'xzjx<scjs
elseif bbxzjx<bbscjx then
bbllsx=left(bbscxx,7+(bbxzjx-2)*3)
bbllxx=bbllsx&right("000"&aisnk(aisnk(right(left(bbscxx,7+(bbxzjx-1)*3),3),1)+1,0),3)
end if

if aibj(esfys,s_umds&"-xb") then'sn x
rs("bb_xt")=rs("bb_xt")&espxx("["&rs("bb_sn")&"]重置"&i_gg&e_gmc)
rs("bb_sn")=bbllxx
rs("bb_sx")=left(bbllxx,len(bbllxx)-3)
rs("bb_dx")=left(bbllxx,7)
end if

end if
rs("bb_xx")=bbllxx
bbscxx=bbllxx
bbscjx=bbxzjx
rs.Update
if bbxai mod 2=0 then
bbzhix=bbzhix&"<tr>"
else
bbzhix=bbzhix&"<tr class=""l-1"">"
end if
bbzhix=bbzhix&"<td>"
for fi=1 to aiint(rs("bb_jx"))
if fi>1 then bbzhix=bbzhix&"—"
next
bbzhix=bbzhix&rs("bb_bt")&"</td><td>"&rs("bb_dx")&"</td><td>"&rs("bb_sx")&"</td><td>"&rs("bb_jx")&"</td><td>"&rs("bb_xx")&"</td><td>"&rs("bb_sn")&"</td></tr>"
rs.movenext
loop
End If
Call saig(rs)
bbzhix=bbzhix&"</table>"
End Function

'-----------------------------------
'=bbss()
'Call bbss()
'-----------------------------------
Function bbss(bbfty)
dim icdspx,icdsfx,icdsxx
icdssp="排序|浏览|回复|内序|我顶|推荐|时间|更新|"
icdspx="bb_xx asc|bb_hi desc|bb_zi desc|bb_xx asc|bb_xi desc|bb_xy desc|bb_tm desc|bb_t1 desc|bb_jb desc|bb_jx desc|"
if e_gdj>2 then icdssp=icdssp&"金币|经验|级深|"

icdssf="范围|推荐|三星|四星|五星|图片|"
icdsfx="|bb_xy>1|bb_xy>2|bb_xy>3|bb_xy>4|(bb_up<>'' and bb_up<>'0' and bb_up<>'null')|"
icdssf=icdssf&"T100|T600|"
icdsfx=icdsfx&"100|600|"
icdssf=icdssf&esqday(0)&"|"
icdsfx=icdsfx&esqday("bb_tm")&"|bb_xy=1|bb_xy=0|"
if e_gdj>2 then icdssf=icdssf&"普通|禁用|"

icdssx="项目|标题|副题|内容|会员|发布|版块|编码|顶级|上级|时间|更新|"
icdsxx="bb_bt|bb_bt|bb_ot|bb_nr|bb_us|bb_um|bb_ef|bb_sn|bb_dx|bb_sx|bb_tm|bb_t1|bb_xt|"
if e_gdj>2 then icdssx=icdssx&"系统|"

if right(icdssp,1)="|" then icdssp=left(icdssp,len(icdssp)-1)
if right(icdssf,1)="|" then icdssf=left(icdssf,len(icdssf)-1)
if right(icdssx,1)="|" then icdssx=left(icdssx,len(icdssx)-1)
icdssm=i_bsm
icdrrp=split(icdspx,"|")
icdrrf=split(icdsfx,"|")
icdrrx=split(icdsxx,"|")
End Function
'-----------------------------------
'=bbtj(bbfstr=频道ep/1分类ef/2排序ssp/3范围ssf/4项目ssx/5模式ssm/6关键词sss,bbffl=分类样式-多选分类|单选分类,bbfty)
'-----------------------------------
Function bbtj(bbfstr,bbffl,bbfty)
dim icdarr,icdsep,icdsef,icdbx
icdarr=split(bbfstr&"//////","/")
bbwhere="6=6"
bborder=bbordermo
icdbx=0
icdsep=trim(icdarr(0))
if aibj(icdsep,s_umqb) or aibj(icdsep,"0") or dkdir(0,icdsep) then icdsep=""
icdsef=trim(icdarr(1))
if aibj(icdsef,s_umqb) or aibj(icdsef,"0") or dkdir(0,icdsef) then icdsef=""
icvsp=aiint(icdarr(2))
icvsf=aiint(icdarr(3))
icvsx=aiint(icdarr(4))
icvsm=aiint(icdarr(5))
icvss=aijie(trim(icdarr(6)))
if aibj(icvss,s_umqb) or aibj(icvss,"0") or dkdir(0,icvss) then icvss=""

'ef
if icdsef<>"" then
icdbx=1
dim icdfvi,icdfvrr,icdfvrrx,icdfvrrxu,icdfvrrxi,icdfvrrxw
'----------------------------------ef0
if aiint(bbffl)>0 then
icdsef=icdsef
if len(icdsef&"0")>3 then
icdfvrr=split(icdsef,g_ura)
for icdfvi=0 to ubound(icdfvrr)
if not aibj(icdsef,s_umqb) and icdfvrr(icdfvi)<>"" then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
if left(icdfvrr(icdfvi),1)="0" then
'★★★★★this do for tags 0
dim bbltlie,bbltliez,bbltliezrr
bbltlie=right(left(icdfvrr(icdfvi),3),2)
if instr("xy,px,hi,xi,bd,bc,jg,jy,oz,oy",bbltlie)>0 then
bbltliez=right(icdfvrr(icdfvi),len(icdfvrr(icdfvi))-3)
bbltliezrr=split(bbltliez&"-","-")
if bbltliezrr(0)=bbltliezrr(1) then
bbwhere=bbwhere&"bb_"&bbltlie&"="&aiint(bbltliezrr(0))&""
elseif bbltliezrr(0)<>"" and bbltliezrr(1)<>"" then
bbwhere=bbwhere&"bb_"&bbltlie&">="&aiint(bbltliezrr(0))&" and bb_"&bbltlie&"<="&aiint(bbltliezrr(1))&""
elseif bbltliezrr(0)<>"" then
bbwhere=bbwhere&"bb_"&bbltlie&">="&aiint(bbltliezrr(0))&""
elseif bbltliezrr(1)<>"" then
bbwhere=bbwhere&"bb_"&bbltlie&"<="&aiint(bbltliezrr(1))&""
else
bbwhere=bbwhere&icdfvi&"="&icdfvi
end if
else
if not aibj(icdfvrr(icdfvi),s_umqb) then
icdbx=1
bbwhere=bbwhere&"bb_ef like '"&icdfvrr(icdfvi)&"%'"
else
bbwhere=bbwhere&"6=6"
end if
end if
'★★★★★this do for tags 1
else
if instr(icdfvrr(icdfvi),g_urb)>1 or (instr(icdfvrr(icdfvi),g_urb)>0 and right(icdfvrr(icdfvi),len(g_urb))<>g_urb) then
icdfvrrx=split(icdfvrr(icdfvi),g_urb)
icdfvrrxu=ubound(icdfvrrx)
icdfvrrxw=""
for icdfvrrxi=0 to icdfvrrxu
if not ainull(icdfvrrxw) and icdfvrrx(icdfvrrxi)<>"" and not aibj(icdfvrrx(icdfvrrxi),s_umqb) then icdfvrrxw=icdfvrrxw&" or "
if icdfvrrx(icdfvrrxi)<>"" and not aibj(icdfvrrx(icdfvrrxi),s_umqb) then icdfvrrxw=icdfvrrxw&"bb_ef like '"&icdfvrrx(icdfvrrxi)&"%'"
next
if icdfvrrxw<>"" then
bbwhere=bbwhere&"("&icdfvrrxw&")"
else
bbwhere=bbwhere&icdfvi&"="&icdfvi
end if
else
if not aibj(icdfvrr(icdfvi),s_umqb) then
icdbx=1
bbwhere=bbwhere&"bb_ef like '"&icdfvrr(icdfvi)&"%'"
else
bbwhere=bbwhere&"6=6"
end if
end if
end if
end if
next
end if
'cdv 1
else
'ef
icdbx=1
if not ainull(bbwhere) then bbwhere=" and "&bbwhere
'bbwhere="bb_ef='"&icdsef&"'"&bbwhere
bbwhere="bb_ef like '"&icdsef&"%'"&bbwhere
end if
'----------------------------------ef1
end if

'sp
if icvsp>0 then bborder=icdrrp(icvsp)

'ss
if icvss<>"" then
dim icvssrr,icvssi,icvssud,icvsslin
icvssrr=split(icvss," ")
icvssud=ubound(icvssrr)
icvsslin=""
for icvssi=0 to icvssud
if icvsslin<>"" then icvsslin=icvsslin&" or "
if icvssrr(icvssi)<>"" then
if icvsm=2 then
icvsslin=icvsslin&icdrrx(icvsx)&"='"&icvssrr(icvssi)&"'"
else
icvsslin=icvsslin&icdrrx(icvsx)&" like '%"&icvssrr(icvssi)&"%'"
end if
end if
next
if icvsslin<>"" then
bbwhere=bbwhere&" and ("&icvsslin&")"
iclapp=1
icdbx=1
end if
end if

'ew
if aiint(ew_sn)>0 and icdbx>0 then
bbwhere=bbwhere&" and bb_ew="&aiint(ew_sn)
end if

'sf
if icvsf>0 then
dim icvsflin
icvsflin=icdrrf(icvsf)
if aibj(right(icvsflin,2),"00") then
bbwhere="bb_id in (select top "&aiint(icvsflin)&" bb_id from "&sbbdbqz&"bb where "&bbwhere&" order by bb_id desc)"
else
bbwhere=bbwhere&" and "&icvsflin
end if
end if

'admin
if not aibj(g_u0,s_umgl) or e_gdj<3 then
if instr(bbwhere,"bb_xy>0")=0 then
if not ainull(bbwhere) then bbwhere=bbwhere&" and "
bbwhere=bbwhere&"(bb_xy>0 or bb_us='"&e_uer&"')"
end if
elseif e_gdj>2 then
iclapp=1
end if

bbwhere=replace(bbwhere,"6=6 and ","")
End Function
%>