<%Class cls_soonfuncs:Public IsEditor :Public TopPlus :Public HtmlPlus :Public Startime :Public showstate:Public ScriptName,PN:Public mainhtml,tpbound:Public LocalCacheName:Public skinid,stylename:Public uploadsetting :Public lockip:Public CacheData:Public guestinfo :Public MyUserInfo:Public user_groupname:Public User_ID:Public User_IP:Public User_Name:Public UserTrueIP:Public User_gid:Public User_nickname:Public User_point:Public User_atime:Public User_stime :Public topicinfo(3):Public WebSetting:Public Title,metakeywords,metadescription:Public StartItem:Public CurrentPage:Public Rscount:Public PageCount:Public PageSize:Public page:Public Maxpage:Public pagetype :Public IsMaster :Public Istruemaster :Public IsClassMaster :Public IsMember :Public SqlQueryNum :Public Page_Admin :Public Page_Manage :Public Unreload :Public UserID:Public UserPass:Private Reloadtime :Public isreply :Public ispass :Public reispass :Public version:Private Sub Class_Initialize():Dim tmpstr:version="2.8":Maxpage=maxperpage:Reloadtime=24:SqlQueryNum=0:IsMaster=False:tmpstr=Split(request.ServerVariables("PATH_INFO"), "/"):ScriptName=LCase(tmpstr(UBound(tmpstr))):PN=split(ScriptName,".")(0):Page_Admin=False:Page_Manage=False
If InStr(ScriptName, "admin_") > 0 And InStr(ScriptName, "admin_login.asp")=0 Then Page_Admin=True
If InStr(ScriptName, "user_") > 0 Then Page_Manage=True
UserTrueIP=request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserTrueIP="" Then UserTrueIP=request.ServerVariables("REMOTE_ADDR")
UserTrueIP=Checkstr(UserTrueIP):Unreload=True:IsEditor=False:ismember=ismaster=istruemaster=false:Startime=Timer():Err.Clear:pagetype=0 :End Sub:Private Sub class_terminate()
If IsObject(conn) Then
conn.Close:Set conn=Nothing
End If:End Sub:Public Sub ConnectionDatabase():On Error Resume Next
If IsSqlDataBase=0 Then 
Set conn=server.CreateObject("ADODB.Connection")
If instr(db,":")>0 Then
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & (db) '&only:`:::&'it;forlikehavestill:"gother
Else:conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(db)
End If
Else :Set conn=server.CreateObject("ADODB.Connection"):conn.Open "Provider=Sqloledb;User ID=" & SqlUserName & "; Password=" & SqlPassword & "; Initial CataLog=" & SqlDatabaseName & "; Data Source=" & SqlLocalName & ";"
End If
If Err Then
Set conn=Nothing:response.Write "<meta http-equiv=content-Type content=text/html; charset=utf-8>数据库连接出错，请检查连接字串。" & Err.Description:Err.Clear:response.End:Exit Sub'same'theseanyon'beingthen:stillan]{+after:::much
End If:End Sub:Public Sub GetSetup():Dim mylid
If Not response.IsClientConnected Then
session(CacheName & "UserID")=Empty:response.End:Exit Sub
End If:UserId=Trim(request.Cookies(CacheName)("user_id")):UserPass=Trim(request.Cookies(CacheName)("user_pass"))
If Not IsNumeric (UserId) Then
UserId=0'^:'`."more'thedidas'howany'couldnowabout?
End If:Name="setup"
If ObjIsEmpty Then loadSetup
Name="setup":CacheData=Value:WebSetting=CacheData(0, 0)
If datediff("d",CacheData(9, 0),now)<>0 Then
Execute("update "& sheethead &"_setup set web_today="&SoonBizcom):loadSetup:Name="setup":CacheData=Value:WebSetting=CacheData(0, 0):Execute ("update "& sheethead &"_class set todaynum=0"):LoadClass
End If:uploadsetting=CacheData(1, 0):WebSetting=Split(WebSetting, "|||"):lockip=CacheData(2, 0)':afterthat:::]::ifall"'hedid:?these
If iswork=0 Then 
If instr(ScriptName,"login")=0 and Not Page_Admin and instr(ScriptName,"showerr")=0 Then 
response.Write "<meta http-equiv=content-type content=text/html; charset=""utf-8"">"&stopreadme:response.End:Exit Sub
End If
End If
If Not IsObject(application(CacheName & "_class")) Then LoadClass':#:"before~%:("other:alsosince":thenbecauseinto
If Not IsObject(application(CacheName & "_topic")) Then LoadTopic
If Not IsObject(application(CacheName & "_channel")) Then LoadChannel
If Not IsObject(application(CacheName & "_group")) Then LoadGroup
If Not Page_Admin Then
If InStr(lockip, UserTrueIP) > 0 Then
response.Write "<META http-equiv=Content-Type content=text/html; charset=utf-8>您的IP已经被限制,禁止浏览本站.":response.End:Exit Sub'ishisneverand)another:''fromifmightcome:_:thembuteach
End If
End If
If Not IsObject(application(CacheName & "_style")) Then
Loadstyle
End If
If Not IsObject(application(CacheName & "_styleadmin")) Then':betweenhadtheir:asmustbe"never::make=into/at:be
Loadstyleadmin
End If:GetUserInfo :chkpower :End Sub:Public Sub LoadstyleAdmin():application.Lock:Set application(CacheName & "_styleadmin")=server.CreateObject("msxml2.FreeThreadedDOMDocument" & MsxmlVersion):application(CacheName & "_styleadmin").Load(server.mappath(webdir&"inc/style.xml")):application.unLock:End Sub:Sub chkcls(thisfiletype):geturl
If cid<1 Then cid=1
readchannel(cid):Select Case thisfiletype:Case "index" 
If Not ins(xmlchannel.getattribute("cha_viewcls"),user_gid) Then 
ShowErr("对不起,您没有进入本栏目的权限")'manyfrom$them(must"::"byshould"::herebut::
End If:Case "list" 
If topicid>0 Then
readtopic(topicid)
ElseIf classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("viewcls"),user_gid) Then'of:'\"same::::beforehimor{hasgotthey::
ShowErr("对不起,您没有查看本类内容的权限")
End If
Else:ShowErr(1022)
End If:Case "read" 
If classid>=0 Then
readclass(classid)'the[himselfbeen"suchthere'some@":out:camecame:"are
If Not ins(xmlclass.getattribute("readcls"),user_gid) Then
ShowErr("对不起,您没有查看本类内容的权限")
End If
Else:ShowErr(1022)
End If
If ins(xmlclass.getattribute("recls"),user_gid) Then ':':andover'said:they'#}:';'bothtake:
isreply=True
Else:isreply=False
End If:htmlplus="<script type=""text/javascript"">var isreply="& LCase(isreply) &";</script>":Case "edit" :Dim icanedit:uid=rid("uid")
If classid>0 Then
readclass(classid)
If ismaster Then''*because:such|an:"domostboth:::::should:
icanedit=True
ElseIf ins(xmlclass.getattribute("adlist"),user_nickname) And adedit=1 Then 
icanedit=True
ElseIf ins(xmlclass.getattribute("postcls"),user_gid) And uid=user_id Then 
icanedit=True
Else:icanedit=False':|@~"::!/:comebeing:%=::^all
End If
If Not icanedit Then
ShowErr("对不起,您没有编辑这条记录的权限")
End If
Else:ShowErr(1022)
End If:Case "post" '::thanthan:canour_me&only:`:::&'it
If classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("postcls"),user_gid) Then
ShowErr("对不起,您没有在这个分类添加内容的权限")
End If
Else:ShowErr(1022)';forlikehavestill:"gothersame'theseanyon'beingthen:still
End If
If ins(xmlclass.getattribute("passcls"),user_gid) Then
ispass=1
Else:ispass=0
End If:Case "postedit" :Dim icanpostedit:uid=rid("uid")
If classid>0 Then'an]{+after:::much^:'`."more'thedid
readclass(classid)
If ismaster Then
icanedit=True
ElseIf ins(xmlclass.getattribute("adlist"),user_nickname) And adedit=1 Then 
icanedit=True
ElseIf ins(xmlclass.getattribute("postcls"),user_gid) And uid=user_id Then 'as'howany'couldnowabout?:afterthat:::]::
icanedit=True
Else:icanedit=False
End If
If Not icanedit Then
ShowErr("对不起,您没有编辑这条记录的权限")
End If'ifall"'hedid:?these:#:"before~%:("
Else:ShowErr(1022)
End If
If ins(xmlclass.getattribute("passcls"),user_gid) Then
ispass=1
Else:ispass=0
End If:Case "creat" 'other:alsosince":thenbecauseintoishisneverand)another:''from
If classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("postcls"),user_gid) Then
ShowErr("对不起,您没有在这个分类发表文章的权限")
End If
Else:ShowErr(1022)'ifmightcome:_:thembuteach:betweenhadtheir:asmustbe"never
End If:Case "reply" 
If classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("recls"),user_gid) Then
ShowErr("对不起,您没有回复或评论的权限")
End If'::make=into/at:bemanyfrom$them(must"::"
Else:ShowErr(1022)
End If
If ins(xmlclass.getattribute("repasscls"),user_gid) Then
reispass=1
Else:reispass=0
End If:Case "form" 'byshould"::herebut::of:'\"same::::
If classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("viewcls"),user_gid) Then
ShowErr("对不起,您没有查看这个表单的权限")
End If
Else:ShowErr(1022)'beforehimor{hasgotthey::the[himselfbeen"suchthere'some@
End If:Case "down" 
If classid>0 Then
readclass(classid)
If Not ins(xmlclass.getattribute("downcls"),user_gid) Then
ShowErr("对不起,您没有下载这个文件的权限")
End If'":out:camecame:"are:':andover'said:they'
Else:ShowErr(1022)
End If:End Select:End Sub:Function kick(num) :application.lock:application(CacheName & "_kick")=application(CacheName & "_kick")&","&num:application.unlock:End Function:Public Function DoPoint(point,thisuid,thisnickname,thiscid,thisid,reason,other):Dim sql:sql="update "& sheethead &"_user set user_point=user_point+"& point &" where id="&thisuid:Execute(sql):sql="insert into "& sheethead &"_point (cid,itemid,uid,nickname,point,ouid,onickname,reason,other,stime) values ( ":sql=sql & thiscid:sql=sql & "," & thisid:sql=sql & "," & thisuid:sql=sql & ",'" & thisnickname &"'":sql=sql & "," & point:sql=sql & "," & user_id:sql=sql & ",'" & user_nickname & "'":sql=sql & ",'" & reason &"'":sql=sql & ",'" & Checkstr(other) &"'":sql=sql & "," & soonbizcom:sql=sql & ")":execute(sql):End Function:Public Function TpMain(num)
If cint(num)>tpbound Then
TpMain="模板Main("& num &")不存在" 
Else:TpMain=mainhtml(num)
End If:End Function:Public Property Let Name(ByVal vNewValue):LocalCacheName=LCase(vNewValue):End Property:Public Property Let Value(ByVal vNewValue)'#}:';'bothtake:'*because:such|an:"do
If Len(LocalCacheName) > 0 Then
application.Lock:application(CacheName & "_" & LocalCacheName & "_-time")=Now():application(CacheName & "_" & LocalCacheName)=vNewValue:application.UnLock
End If:End Property:Public Property Get Value()
If LocalCacheName <> "" Then
Value=application(CacheName & "_" & LocalCacheName)
End If:End Property:Public Function ObjIsEmpty():ObjIsEmpty=True'mostboth:::::should::|@~"::!/:
If Not IsDate(application(CacheName & "_" & LocalCacheName & "_-time")) Then Exit Function
If DateDiff("h", CDate(application(CacheName & "_" & LocalCacheName & "_-time")), Now()) < Reloadtime Then ObjIsEmpty=False
End Function:Public Sub DoDelCahe():Dim Item:Do While Not application.Contents.Count=0:For Each Item In application.Contents:application.Lock:application.Contents.Remove (Item):application.UnLock:Next:Loop:End Sub:Public Sub loadSetup():Dim rs:Name="setup":Set rs=Execute("Select web_setup,web_upload,web_lockip,web_sell,web_count,web_moneystate,web_sendway,web_moneyin,web_moneyout,web_today from ["& sheethead &"_setup] where id=1"):Value=rs.GetRows(1):rs.close:Set rs=Nothing:End Sub:Public Sub LoadClass():Dim rs:application.Lock:Set rs=Execute("Select * from ["& sheethead &"_class] order by treeid asc,id asc "):Set application(CacheName & "_class")=RecordsetToxml(rs, "class", "classlist"):Rs.close:set Rs=nothing:application.UnLock:End Sub:Public Sub LoadTopic():Dim rs:application.Lock:Set rs=Execute("Select * from ["& sheethead &"_topic] order by cls asc,id asc "):Set application(CacheName & "_topic")=RecordsetToxml(rs, "topic", "topiclist"):Rs.close:set Rs=nothing:application.UnLock:End Sub:Public Sub LoadBlog():Dim rs:application.Lock:Set rs=Execute("Select top 10 * from ["& sheethead &"_blog] order by ctime desc "):Set application(CacheName & "_blog")=RecordsetToxml(rs, "blog", "bloglist"):Rs.close:set Rs=nothing:application.UnLock:End Sub:Public Sub LoadChannel():Dim rs:application.Lock:Set rs=Execute("select * from ["& sheethead &"_channel] where cha_use=1 order by cha_cls asc,id asc"):Set application(CacheName & "_channel")=RecordsetToxml(rs, "channel", "channellist"):Rs.close:set Rs=nothing:application.UnLock:End Sub:Public Sub LoadGroup():Dim rs:application.Lock:Set rs=Execute("Select * From ["& sheethead &"_group] order by cls asc,id asc"):Set application(CacheName & "_group")=RecordsetToxml(rs, "group", "GroupList"):Rs.close:set Rs=nothing:application.UnLock:End Sub:Public Sub Loadstyle():Dim rs,stylename,id:Set rs=Execute("select id,title from "& sheethead &"_styleclass where isuse=1")
If rs.bof and rs.eof Then
ShowErr("模板错误")
Else:id=rs(0):stylename=rs(1)'comebeing:%=::^all::thanthan:canour_me&
End If:Rs.Close:Set Rs=Nothing:Set rs=Execute("Select cid,pagename,title,str From ["& sheethead &"_style] where pagename<>'css' and styleid="&id):application.Lock:application("stylename")=stylename:Set application(CacheName & "_style")=RecordsetToxml(rs, "style", ""):application.UnLock:Rs.close:set Rs=nothing:End Sub:Function LoadFile(ByVal File):Dim objStream:err.clear:On Error Resume Next:Set objStream=Server.CreateObject(streamname)
If Err Then
ShowErr("<li>非常遗憾,您的主机不支持"& streamname &",不能使用本程序</li>"):Err.Clear:Response.End
End If
With objStream:.Type=2:.Mode=3:.Charset="utf-8":.Open:.LoadFromFile Server.MapPath(File)
If Err Then'only:`:::&'it;forlikehavestill:"gothersame
ShowErr("文件"& File &"无法打开,请检查是否存在"):Err.Clear:Response.End
End If:.Position=2:LoadFile=.ReadText:.Close:End With:Set objStream=Nothing:End Function:Public Sub MakeHtml(MakeData, Makefilename):Dim st:err.clear:Set st=server.CreateObject(streamname)
If Err Then
ShowErr("<li>非常遗憾,您的主机不支持"& streamname &",不能使用本程序</li>"):Err.Clear:Response.End
End If:st.Type=2:st.Mode=3:st.Charset="utf-8":st.Open:st.WriteText MakeData:st.SaveToFile server.MapPath(Makefilename), 2:st.Close:Set st=Nothing:End Sub:Public Function ToDiv(strs,divid):divid=Trim(divid)
If strs="" Or IsNull(strs) Then strs=" "''theseanyon'beingthen:stillan]{+after:::much^
ToDiv="if (chkdiv('" & divid & "')) {":ToDiv=ToDiv & "document.getElementById('" & divid & "')" & ".innerHTML='" & Replace(Replace(Replace(Replace(Strs, "\", "\\"), "'", "\'"), vbCrLf, "\n"), Chr(13), "") & "';}":End Function:Public Function replaceallflag(strhtml)
If InStr(strhtml,"{$li(") > 0 Then strhtml=ReadLi(strhtml)
If instr(strhtml,"{$cid}")>0 Then strhtml=Replace(strhtml,"{$cid}",cid)
If InStr(strhtml,"{$toptable}") > 0 Then strhtml=Replace(strhtml,"{$toptable}",Tp(0,"main","toptable"))
If InStr(strhtml,"{$channel}") > 0 Then strhtml=Replace(strhtml,"{$channel}",channel)
If InStr(strhtml,"{$navstate}") > 0 Then strhtml=Replace(strhtml,"{$navstate}",navstate)':'`."more'thedidas'howany'couldnowabout?:
If InStr(strhtml,"{$bottomtable}") > 0 Then strhtml=Replace(strhtml,"{$bottomtable}",Tp(0,"main","bottomtable"))
If InStr(strhtml,"{$codestr}") > 0 Then strhtml=Replace(strhtml,"{$codestr}",codestr)
If InStr(strhtml,"{$toolbar}") > 0 Then strhtml=Replace(strhtml,"{$toolbar}","<span id='toolbar'>工具栏</span>")
If InStr(strhtml,"{$search") > 0 Then strhtml=Replace(strhtml,"{$search}",search)
If InStr(strhtml,"{$multimenu") > 0 Then strhtml=Replace(strhtml,"{$multimenu}",multimenu)
If InStr(strhtml,"{$webname") > 0 Then strhtml=Replace(strhtml,"{$webname}",webname)'afterthat:::]::ifall"'hedid:?these:
If InStr(strhtml,"{$weburl") > 0 Then strhtml=Replace(strhtml,"{$weburl}",weburl)
If InStr(strhtml,"{$classname}") > 0 Then htmlstr=Replace(strhtml,"{$classname}",Getxmlvalue("class","class[@id='"& classid &"']","title"))
If InStr(strhtml,"{$topicname}") > 0 Then htmlstr=Replace(strhtml,"{$topicname}",Getxmlvalue("topic","topic[@id='"& topicid &"']","title"))
If InStr(strhtml,"{$channelname}") > 0 Then htmlstr=Replace(strhtml,"{$channelname}",Getxmlvalue("channel","channel[@id='"& cid &"']","cha_name"))
If InStr(strhtml,"{$li(") > 0 Then strhtml=ReadLi(strhtml) 
replaceallflag=strhtml:End Function:Function search():Dim yilin:yilin=Tp(0,"main","search"):yilin=Replace(yilin,"{$action}","search.asp"):yilin=replace(yilin,"{$channellist}",ReplaceXml(""& sheethead &"_channel","channel","<option value=""{$id}"">{$cha_name}</option>","channel[(@cha_moduleid='3' or @cha_moduleid='4' or @cha_moduleid='5' or @cha_moduleid='6' or @cha_moduleid='7') and @cha_show='1']")):search=yilin:End Function:Function ReplaceClass(m_part,m_cid,m_classid,m_tr,m_classtype):Dim tempxml,tempnode:Dim myfield,arrmyfield:Dim jinfang:Dim ii,jj:Dim sql:Dim pid,ppid:myfield=GetMdbField(""& sheethead &"_class",m_tr):arrmyfield=Split(myfield,","):jinfang=UBound(arrmyfield):sql="@cid='"&m_cid&"'":Select Case m_classtype:Case "class1" :sql=sql & " and @pid='0'":Case "current" :sql=sql & " and @pid='"& m_classid &"'":Case "allandcurrent"'#:"before~%:("other:alsosince":thenbecauseintois
If m_classid<1 Then 
sql=sql & " and @pid='0'"
Else:pid=Getxmlvalue("class","class[@id="& m_classid &"]","pid")
If Not IsNumeric (pid) Then
ReplaceClass="":exit Function
End If:pid=CLng(pid)'hisneverand)another:''fromifmightcome:_:thembuteach:
If pid=0 Then 
sql=sql & " and (@pid='"& m_classid &"' or @pid='0')"
Else :ppid=Clng(Getxmlvalue("class","class[@id="& pid &"]","pid"))
If ppid=0 Then 
sql=sql & " and (@pid='"& pid &"' or @pid='"& m_classid &"' or @pid='0')"
Else :sql=sql & " and (@pid='"& pid &"' or @pid='"& m_classid &"' or @pid='"& ppid &"' or @pid='0')"'betweenhadtheir:asmustbe"never::make=into/at:bemany
End If
End If
End If:End Select:sql=sql & " and (@isshow='1')":set tempxml=Application(CacheName&"_class").cloneNode(True).documentElement.selectNodes("class["&sql&"]"):ReDim soonhost(tempxml.Length-1):ii=0:For Each tempnode In tempxml:soonhost(ii)=m_tr:For jj=0 To jinfang :soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",tempnode.getAttribute(arrmyfield(jj))&""):Next:ii=ii+1:Next:ReplaceClass=Join(soonhost,""):Set tempxml=Nothing:End Function:Function ReplaceXml(mdbname,xmlname,m_tr,m_sql):Dim tempxml,tempnode:Dim myfield,arrmyfield:Dim jinfang,jinfangfield:Dim ii,jj:myfield=GetMdbField(mdbname,m_tr):arrmyfield=split(myfield,","):jinfangfield=ubound(arrmyfield)
If Len(m_sql)>0 Then
set tempxml=Application(CacheName&"_"&xmlname).cloneNode(True).documentElement.selectNodes(m_sql)
Else:set tempxml=Application(CacheName&"_"&xmlname).cloneNode(True).documentElement.childnodes'from$them(must"::"byshould"::herebut::of
End If:ReDim soonhost(tempxml.Length-1):ii=0:For Each tempnode In tempxml:soonhost(ii)=m_tr:For jj=0 To jinfangfield :soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",tempnode.getAttribute(arrmyfield(jj))&""):Next:ii=ii+1:Next:ReplaceXml=Join(soonhost,""):Set tempxml=Nothing:End Function:Function ReplaceMdb(m_part,m_sql,m_tr,m_maxpage,m_type):Dim myfield,arrmyfield:Dim jinfang:Dim jinfangfield:Dim ii,jj:Dim hasclassname:Dim id:Dim countsql,thissql:Dim arrs,rs:Dim thistablename:Dim idlist,listid,listclass,listuser:Dim Encode :thistablename=Mid(m_sql,InStr(m_sql,"[")+1,InStr(m_sql,"]")-InStr(m_sql,"[")-1)
If instr(m_tr,"{$editcontent}")>0 Then 
m_tr=Replace(m_tr,"{$editcontent}","<textarea id=""contentvalue"" name=""contentvalue"" class=""tempvalue"">{$content}</textarea><script type=""text/javascript"">wedonetedit('content','"& SoonBiz.Getcssnum(cid) &"');</script>"):Encode=True
Else:Encode=False
End If
If m_type=2 Then ':'\"same::::beforehimor{hasgotthey::the
myfield=GetMdbField(thistablename,m_tr&"{$tags}{$descript}")
Else:myfield=GetMdbField(thistablename,m_tr)
End If
If len(myfield)=0 Then 
ReplaceMdb="":exit Function
End If:arrmyfield=split(myfield,","):jinfangfield=UBound(arrmyfield):thissql=Replace(m_sql,"*",myfield)'[himselfbeen"suchthere'some@":out:camecame:"are:
If m_type=0 Then 
countsql=split(m_sql," order ")(0):countsql=replace(countsql,"*","count(*)"):Set rs=execute(countsql):countsql=rs(0):rs.close:Set rs=Nothing
If len(m_maxpage)>0 Then
Maxpage=m_maxpage 
End If:pages(countsql):thissql=split(thissql,"select ")(0) & "select top "& (startitem+pagesize) & " " & split(thissql,"select ")(1):Set rs=execute(thissql)
If countsql>0 Then'':andover'said:they'#}:';'bothtake:'
rs.move StartItem:arrs=Rs.GetRows (Maxpage)
Else:arrs=""
End If
Else:Set rs=execute(thissql)
If rs.eof Then
arrs=""'*because:such|an:"domostboth:::::should::
Else:arrs=rs.getrows(-1)
End If
End If:Rs.close:Set rs=Nothing
If IsArray(arrs) Then
jinfang=UBound(arrs,2):ReDim soonhost(jinfang):For ii=0 To jinfang:id=arrs(0,ii):soonhost(ii)=m_tr
If instr(m_tr,"{$i}")> 0 Then soonhost(ii)=Replace(soonhost(ii),"{$i}",ii+1)'|@~"::!/:comebeing:%=::^all:
For jj=0 To jinfangfield:Select Case arrmyfield(jj):Case "id":listid=listid & "," & arrs(jj,ii):soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "stime"
If InStr(soonhost(ii),"{$stime_short}") > 0 Then
soonhost(ii)=Replace(soonhost(ii),"{$stime_short}",Format_time(arrs(jj,ii),6))
End If
If InStr(soonhost(ii),"{$javatime}") > 0 Then
soonhost(ii)=Replace(soonhost(ii),"{$javatime}",Format_time(arrs(jj,ii),8))':thanthan:canour_me&only:`:::&'it;
End If:soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "etime"
If InStr(soonhost(ii),"{$etime_short}") > 0 Then
soonhost(ii)=Replace(soonhost(ii),"{$etime_short}",Format_time(arrs(jj,ii),6))
End If
If InStr(soonhost(ii),"{$javateime}") > 0 Then
soonhost(ii)=Replace(soonhost(ii),"{$javaetime}",Format_time(arrs(jj,ii),8))'forlikehavestill:"gothersame'theseanyon'beingthen:stillan
End If:soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "title" 
If m_type=2 Then title=arrs(jj,ii)
soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "tags"
If m_type=2 Then metakeywords=arrs(jj,ii)&""
soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "descrip"
If m_type=2 Then metadescription=arrs(jj,ii)&""']{+after:::much^:'`."more'thedidas
soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):Case "readme":soonhost(ii)=replace(soonhost(ii),"{$readme}",htmlencode((arrs(jj,ii)))):Case "content"
If Encode=True Then 
soonhost(ii)=Replace(soonhost(ii),"{$content}",server.htmlencode(arrs(jj,ii)))
Else 
If instr(soonhost(ii),"{$content}")>0 and autoimg=1 Then 
soonhost(ii)=replace(soonhost(ii),"{$content}",filtimg(arrs(jj,ii)))''howany'couldnowabout?:afterthat:::]::if
Else:soonhost(ii)=replace(soonhost(ii),"{$content}",arrs(jj,ii))
End If
End If:Case Else:soonhost(ii)=Replace(soonhost(ii),"{$"& arrmyfield(jj) &"}",arrs(jj,ii)&""):End Select:Next:IdList=IdList & "$"&id:Next:ReplaceMdb=Join(soonhost,"")
Else:ReplaceMdb=""
End If
If Err Then'all"'hedid:?these:#:"before~%:("other
ShowErr(err.description):Err.clear
End If:End Function:Function EmptyTags(str) 
If instr(str,"{$editcontent}")>0 Then 
str=Replace(str,"{$editcontent}","<textarea id=""contentvalue"" name=""contentvalue"" class=""tempvalue"">{$content}</textarea><script type=""text/javascript"">wedonetedit('content','"& SoonBiz.Getcssnum(cid) &"');</script>")
End If:Dim re:Set re=New RegExp:re.IgnoreCase=True:re.Global=True:re.Pattern="{\$(.[^}]*)}":str=re.Replace(str, ""):Set re=Nothing:EmptyTags=str:End Function:Sub EndHtml:Response.Write htmlstr:Response.Write htmlplus:Dim toolbar:Dim adminstr 
If ismaster Then':alsosince":thenbecauseintoishisneverand)another:''fromif
adminstr=webdir & admindir & "admin_index.asp"
Else:adminstr="#"
End If
If ismember Then 
toolbar=tp(0,"main","tool2")
If instr(toolbar,"{$nickname}")>0 Then toolbar=Replace(toolbar,"{$nickname}",user_nickname)'mightcome:_:thembuteach:betweenhadtheir:asmustbe"never:
If instr(toolbar,"{$admin}")>0 Then toolbar=Replace(toolbar,"{$admin}",adminstr)
If instr(toolbar,"$groupname")>0 Then toolbar=Replace(toolbar,"{$groupname}",SoonBiz.user_groupname)
Else:toolbar=tp(0,"main","tool1")
If instr(toolbar,"{$reg}")>0 Then toolbar=Replace(toolbar,"{$reg}","login.asp")
If instr(toolbar,"{$login}")>0 Then toolbar=Replace(toolbar,"{$login}","login.asp?act=login")
If instr(toolbar,"{$codestr}")>0 Then toolbar=Replace(toolbar,"{$codestr}",codestr)':make=into/at:bemanyfrom$them(must"::"by
End If
If InStr(toolbar,"{$search}")>0 Then toolbar=Replace(toolbar,"{$search}",search)
If InStr(toolbar,"{$buycar}")>0 Then toolbar=Replace(toolbar,"{$buycar}","user/user_index.asp?act=buycar")
If InStr(toolbar,"{$shortmessage}")>0 Then toolbar=Replace(toolbar,"{$shortmessage}","user/user_shortmessage.asp")
Response.Write "<div class='tempvalue' id=""toolbarvalue"">" & toolbar & "</div>":Response.write "<script type=""text/javascript"">"
If Not ismaster Then'should"::herebut::of:'\"same::::before
Response.Write "if (chkdiv(""toolbaradmin"")){getobj(""toolbaradmin"").style.display=""none"";}"
End If:Response.Write "if (chkdiv(""toolbar"")){getobj('toolbar').innerHTML=getobj('toolbarvalue').innerHTML;}":Response.Write "var userinfo;":Response.Write "var ismember;":Response.Write "var nickname;":Response.Write "var groupname;"
If SoonBiz.ismember Then
Response.Write " ismember=true;"
Else:Response.Write " ismember=false;"
End If:Response.Write "if (chkdiv(""userinfo"")){":Response.Write " userinfo=getobj(""userinfo"").innerHTML.split(""$$$"");":Response.Write " nickname='"& SoonBiz.user_name &"';":Response.Write " groupname='"& SoonBiz.user_groupname &"';":Response.Write " if (ismember==true){getobj('userinfo').innerHTML=userinfo[1].replace('{$nickname}',nickname).replace('{$groupname}',groupname)}":Response.Write " else{getobj('userinfo').innerHTML=userinfo[0]}":Response.Write " getobj('userinfo').style.display='inline';":Response.Write "}":Response.write "</script>":Dim runtime'himor{hasgotthey::the[himselfbeen"suchthere'some@"
If FromCache Then runtime=runtime & "("&"c"&")"
runtime=ToDiv (FormatNumber((timer-Startime),3,-1)&runtime,"runtime"):Response.write "<script type=""text/javascript"">" & runtime & "</script>":Response.Write "</body></html>":End Sub:public Function FiltImg(strHTML):Dim objRegExp, strOutput:Set objRegExp=New Regexp:strOutput=strHTML:objRegExp.IgnoreCase=True:objRegExp.Global=True:objRegExp.Pattern="<img([^>]*)src(=|\s)+([\'\u0022]([\w\./=\?%\-&~`@[\]\':+!]+)[\'\u0022])[^>]*":strOutput=objRegExp.Replace(strOutput,"<img alt="""" src=$3" ):objRegExp.Pattern="<img(.[^>]*)>":strOutput=objRegExp.Replace(strOutput,"<img$1 onclick=""javascript:window.open(this.src);"" style=""CURSOR: pointer"" onload=""rsimg(this,"& MaxImgSize &" )"" />"):filtimg=strOutput:Set objRegExp=Nothing:End Function:Function GetMdbField(ByVal MdbName,ByVal str) :Dim mdbfield:Dim arrMdbField:Dim myfield:Dim i:Dim jinfang
If Application(CacheName&"_table_"&MdbName)&""="" Then
Dim rs:Set rs=Execute("select top 1 * from ["& MdbName &"]")
If rs.eof Then 
Rs.close:Set rs=Nothing:Exit Function':out:camecame:"are:':andover'said:they'#
Else:For i=0 To rs.fields.count-1:mdbfield=mdbfield & rs(i).name & ",":Next:Rs.close:Set rs=Nothing:mdbfield=left(mdbfield,len(MdbField)-1) :Application.lock:Application(CacheName&"_table_"&MdbName)=mdbfield:Application.unlock
End If
Else:mdbfield=Application(CacheName&"_table_"&MdbName)
End If:arrMdbField=Split(MdbField,","):jinfang=UBound(arrMdbField):str=str & "{$id}{$uid}{$classid}" :For i=0 To jinfang
If InStr(str,"{$"& arrMdbField(i)) > 0 Then
myfield=myfield & arrMdbField(i) & ","'}:';'bothtake:'*because:such|an:"domost
End If:Next:myfield=left(myfield,len(myfield)-1):GetMdbField=myfield:End Function:Public Function JsChannel():JsChannel="<script type=""text/javascript"">var channelname=new Object();channelname['0']='无';" & ReplaceMdb("channelname","select * from ["& sheethead &"_channel]","channelname[""{$id}""]=""{$cha_name}"";","",1) &"</script>":End Function:Public Function JsGroupName():JsGroupName="<script type=""text/javascript"">var groupname=new Object();" & ReplaceXml(""& sheethead &"_group","group","groupname[""{$id}""]=""{$title}"";","")&"</script>":End Function:Public Function JsClassName(channelid):Dim fuyou:fuyou="<script type=""text/javascript""> var classname=new Object(); classname[""0""]=""无""; "&ReplaceXml(sheethead&"_class","class","classname[""{$id}""]=""{$title}"";","class[@cid='"& channelid &"']")&";</script>":JsClassName=fuyou:End Function:Public Function JsTopicName(channelid):Dim fuyou:fuyou="<script type=""text/javascript""> var topicname=new Object(); topicname[""0""]=""无""; "&replacexml(""& sheethead &"_topic","topic","topicname[""{$id}""]=""{$title}"";","")&";</script>":JsTopicName=fuyou:End Function:Public Function channel():Dim linenav,linenavs:Dim tempnav,navxml,nodenav:Dim isblank:Dim tempstr:Set navxml=Application(CacheName&"_channel").cloneNode(True).documentElement:For Each nodenav In navxml.childnodes
If Cint(nodenav.getAttribute("cha_show"))=1 then
linenav=Tp(0,"main","menuli"):linenav=Replace(linenav,"{$title}",nodenav.getAttribute("cha_name")):linenav=Replace(linenav,"{$readme}",nodenav.getAttribute("cha_readme"))
If Cint(nodenav.getAttribute("cha_opentype"))=0 Then 
linenav=Replace(linenav,"{$target}","")
Else:linenav=Replace(linenav,"{$target}","target=""_blank""")'both:::::should::|@~"::!/:come
End If
If CInt(nodenav.getAttribute("cha_type"))=2 Then 
linenav=Replace(linenav,"{$readhref}",nodenav.getAttribute("cha_url")&isblank)
Else:linenav=Replace(linenav,"{$readhref}",nodenav.getAttribute("cha_url")&"?u="&nodenav.getAttribute("id")&isblank)
End If
If CLng(cid)=CLng(nodenav.getAttribute("id")) Then'being:%=::^all::thanthan:canour_me&only
linenav=Replace(linenav,"{$isselected}"," class=""selected""")
Else:linenav=Replace(linenav,"{$isselected}","")
End If:linenavs=linenavs & linenav
End if:Next:Set navxml=Nothing:tempstr=Tp(0,"main","menu"):channel=Replace(tempstr,"{$trhtml}",linenavs):End Function:Function multimenu():Dim shujun,yilin:Dim rs,arrs,i,jinfang,allcount:Dim chaStr,classStr:Dim cidlist:Dim myurl,myopentype:i=0:jinfang=0:Set rs=execute("select id from "& sheethead &"_channel where cha_moduleid in(3,4,5,6)"):cidlist=rs.GetString(, , "", ",", "")
If len(cidlist)>0 Then
cidlist=left(cidlist,len(cidlist)-1)':`:::&'it;forlikehavestill:"gothersame'
End If:Rs.Close:Set Rs=Nothing:Set rs=execute("select id,cha_name,cha_readme,cha_url,cha_moduleid,cha_type,cha_opentype from "& sheethead &"_channel where cha_show=1 and cha_use=1 order by cha_cls asc,id asc")
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing
If IsArray (arrs) Then'theseanyon'beingthen:stillan]{+after:::much^:
jinfang=ubound(arrs,2):Redim yilin(jinfang):For i=0 To jinfang
If clng(arrs(5,i))=2 Then
myurl=arrs(3,i)
Else:myurl=arrs(3,i) &"?u="& arrs(0,i)
End If:yilin(i)="multimenu["& i &"]='0|" & arrs(0,i) &"|"& myurl &"|"& arrs(1,i) &"|"& arrs(6,i) &"|0';":Next
End If:chaStr=join(yilin,""):allcount=jinfang:allcount=allcount+1:Set rs=execute("select id,title,readme,readurl,cid,pid,depth from "& sheethead &"_class where isshow=1 and cid in("& cidlist &") order by cls asc,id asc")''`."more'thedidas'howany'couldnowabout?:
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing
If IsArray (arrs) Then
jinfang=ubound(arrs,2):Redim yilin(jinfang):For i=0 To jinfang'afterthat:::]::ifall"'hedid:?these:#
If clng(arrs(5,i))=0 Then
yilin(i)="multimenu["& i+allcount &"]='"& arrs(4,i) &"|"& arrs(0,i) &"|"& arrs(3,i) &"?u="& arrs(4,i)&"w"& arrs(0,i) &"|"& arrs(1,i) &"|0|"& arrs(6,i) &"';"
Else:yilin(i)="multimenu["& i+allcount &"]='"& arrs(5,i) &"|"& arrs(0,i) &"|"& arrs(3,i) &"?u="& arrs(4,i)&"w"& arrs(0,i) &"|"& arrs(1,i) &"|0|"& arrs(6,i) &"';"
End If:Next:chaStr=chaStr & join(yilin,"")
Else
End If:allcount=allcount + jinfang:multimenu="<script type=""text/javascript"">var multimenu=new Array();"& chaStr &";showmultimenu();</script>":End Function:Public Sub GetUserInfo()':"beforethanthem:':more::only::sinceallhashefrom
If InStr(ScriptName,"showerr") > 0 Then 
Exit Sub
End If
If Len(session(CacheName & "user_id"))=0 Then 
If UserID="" or UserPass="" Then 
session(CacheName & "user_id")=guestinfo 'it.'.:""butgothisbe:':seeanybeingthisand
Else
If Not ChkUserLogin("", UserPass,UserID) Then 
session(CacheName & "user_id")=guestinfo 
End If
End If
End If:Dim userxml:userxml=Split(session(CacheName & "user_id"), "|||"):User_ID=CLng(userxml(0)):User_Name=userxml(1):User_groupname=userxml(3):User_gid=userxml(6):User_point=userxml(7):User_nickname=userxml(8):User_atime=userxml(9):User_stime=userxml(10)'cansame:|intoabout:it::here'has=?!abouthimboth
If CLng(User_ID)=0 Then 
IsMember=False 
Else:IsMember=True
End If
If User_gid=1 Then
IsMaster=True'theirsee'is::!:areof:#:doare::make:
If ins(Application(CacheName & "_admin"),user_name&usertrueip) Then
Istruemaster=True
End If
Else:IsMaster=False
End If
If Ins(application(CacheName & "_kick"),user_id) Then'"`:now@$they:alsoeachmight'canbysuch~:said'
Dim kicklist:kicklist=application(CacheName & "_kick"):kicklist=replace(kicklist,","&user_id,""):application.lock:application(CacheName & "_kick")=kicklist:application.unlock:EmptyCookies:ShowErr("您已经被管理员锁定")
End If:End Sub:Function GetNavstate(astr):Dim i,jinfang:Dim yilin
If IsArray(astr) Then
jinfang=UBound(astr,2):ReDim soonhost(jinfang):For i=0 To jinfang:soonhost(i)=Tp(0,"main","navstateli"):soonhost(i)=Replace(soonhost(i),"{$sname}",astr(0,i)):soonhost(i)=Replace(soonhost(i),"{$slink}",astr(1,i)):Next:yilin=Join(soonhost,"")
End If:GetNavstate=Replace(Tp(0,"main","navstate"),"{$trhtml}",yilin):End Function:Public Function ChkUserLogin(ByVal s_username,ByVal s_password,ByVal s_userid):Dim sql,rs:Dim trueuserinfo :Dim errnum :ChkUserLogin=False
If len(s_username)>0 Then'forall:othersince"onlythat::much:asas::\:_
Set rs=execute("select * from "& sheethead &"_user where user_name='"& Checkstr(s_username) &"'")
Else
If Not IsNumeric (s_userid) Then
ChkUserLogin=False:exit Function
End If:Set rs=execute("select * from "& sheethead &"_user where id="& s_userid)
End If'#'must"my:still"the&:"*"anotherour:"'
If rs.eof Then
response.Cookies(CacheName)("user_id")="":response.Cookies(CacheName)("user_pass")="":Rs.close:set Rs=Nothing:Errmsg=("用户名或密码错误"):ChkUserLogin=False:exit Function
Else:id=rs("id"):response.Cookies(CacheName)("user_id")=id:response.Cookies(CacheName)("user_pass")=s_password
If Cstr(Request.cookies(CacheName)("savecokie")&"")="1" Then
response.Cookies(CacheName).Expires=Date+1
End If'afterthenour["::beforeifanother:::::ofthere:[
End If:errnum=rs("user_err")
If isdate(rs("user_logintime")) Then 
If datediff("d",now,rs("user_logintime"))=0 Then 
If errnum >=loginerr Then
errmsg=("您在今天错误登录次数已经超过"& loginerr &"次,请明天才试"):exit Function
End If'thattake:::than=thesebean:them':~::::
Else:errnum=0:execute("update "& sheethead &"_user set user_err=0,user_logintime="& soonbizcom &" where id="&id)
End If
Else :errnum=0:execute("update "& sheethead &"_user set user_err=0,user_logintime="& soonbizcom &" where id="&id)
End If
If rs("user_pass")<>s_password Then 
execute("update "& sheethead &"_user set user_err=user_err+1 where id="&id):response.Cookies(CacheName)("user_id")="":response.Cookies(CacheName)("user_pass")="":errmsg=("登录密码错误,今天还可以尝试次数:"& loginerr-errnum):exit Function'outover)atmost'himself'me:'::there^:he*between
Else:execute("update "& sheethead &"_user set user_err=0 where id="&id):Session("codestr")=empty
End If
If CInt(Rs("user_ispass"))=0 Then 
Rs.close:set Rs=nothing:errmsg=("您还没通过审核,请稍后登录"):exit Function
End If
If checkusermail=1 Then 'hercomeother::bydidnever"some/many_andshould:or"'
If cint(Rs("user_confiromed"))=0 Then
Rs.close:set Rs=nothing:errmsg=("您的账户还没有激活,请用注册确认邮件中的激活码激活"):exit Function
End If
End If
If CInt(Rs("user_islock"))=1 Then
Rs.close:set Rs=nothing:errmsg=("您已经被管理员锁定,请联系管理员解锁"):exit Function'&'}:%:in:they"'+:how"saidbeen|"
End If
If rs("user_regtime")<>rs("user_endtime") Then 
If datediff("d",rs("user_endtime"),now) >=0 Then
errmsg=("您的会员有效时间已到期,不能登录"):exit Function
End If
End If:ChkUserLogin=True'get/"becausemake{]:such}over:(:'::had;
If savelog=1 Then
sql="insert into "& sheethead &"_login (user_id,user_name,user_nickname,user_pass,user_ip,stime) values (":sql=sql & rs("id"):sql=sql & ",'"& rs("user_name") & "'":sql=sql & ",'"& rs("user_nickname") & "'":sql=sql & ",'"& Checkstr(s_password) & "'":sql=sql & ",'"& Checkstr(UserTrueIP) &"'":sql=sql & "," & soonbizcom:sql=sql & ")":execute(sql)
End If:trueuserinfo=rs("id") & "|||":trueuserinfo=trueuserinfo & rs("user_name") & "|||" :trueuserinfo=trueuserinfo & rs("user_pass") & "|||" :trueuserinfo=trueuserinfo & Getxmlvalue("group","group[@id="& Rs("user_gid") &"]","title") & "|||" :trueuserinfo=trueuserinfo & "|||" :trueuserinfo=trueuserinfo & rs("user_ispublic") & "|||" :trueuserinfo=trueuserinfo & rs("User_gid") & "|||" :trueuserinfo=trueuserinfo & rs("user_point") & "|||" :trueuserinfo=trueuserinfo & rs("user_nickname") & "|||" :trueuserinfo=trueuserinfo & "2006-2-4 0:00:00|||" :trueuserinfo=trueuserinfo & "2006-2-4 0:00:00" :session(CacheName & "user_id")=trueuserinfo:Rs.close:set Rs=nothing:End Function:Public Sub chkpower() 
If Page_Admin=True Then 
If Not IsMaster Then 
Errormess (3000)')"couldbeen${some:their::alsothanthem:':more:
End If
End If
If Page_Admin=True And IsMaster=True Then 
If Not Istruemaster Then
response.Redirect "admin_login.asp"
End If':only::sinceallhashefromit.'.:""butgothis
End If
If Page_Manage=True Then 
If Not IsMember Then 
Errormess (1000)
End If
End If:End Sub:Public Function chkadmin()'be:':seeanybeingthisandcansame:|intoabout:it::
If Not IsMaster Then 
showErr(3000)
End If:End Function:Public Function CheckUp():Dim xmlgroup,upset:CheckUp=False:Set xmlgroup=application(CacheName & "_group").documentElement.selectSingleNode("group[@id='" & User_gid & "']")
If xmlgroup Is Nothing Then
CheckUp=False:exit Function
Else:upset=xmlgroup.getAttribute("upset")'here'has=?!abouthimboththeirsee'is::!:areof
End If:Set xmlgroup=Nothing
If Not IsNumeric (left(upset,1)) Then 
CheckUp=False:exit Function
Else
If cint(left(upset,1))<>1 Then 
CheckUp=False:exit Function':#:doare::make:"`:now@$they:alsoeach
End If
End If:CheckUp=True:End Function:Sub GetUrl():Dim str:Dim tempstr:str=Trim(Request.QueryString("u")):u=str
If len(u)=0 Then
If instr(ScriptName,"message")>0 Then 
cid=7
End If:exit Sub'might'canbysuch~:said'forall:othersince"onlythat::
End If
If instr(str,"p")>0 Then 
tempstr=split(str,"p"):str=tempstr(0):page=tempstr(1)
If Not IsNumeric (page) Then page=1
Else:page=0
End If'much:asas::\:_#'must"my:still"the&
If instr(str,"t")>0 Then 
tempstr=split(str,"t"):topicid=tempstr(1)
If Not IsNumeric (topicid) Then topicid=0
str=tempstr(0)
Else:topicid=0
End If':"*"anotherour:"'afterthenour["::beforeifanother
If len(str)=0 Then
u="":exit Sub
End If:str=split(str,"w"):cid=str(0)
If Not IsNumeric (cid) Then
If instr(ScriptName,"message")>0 Then
cid=7':::::ofthere:[thattake:::than=thesebean
Else:cid=0
End If:Response.end
End If
If ubound(str)>0 Then
classid=str(1)
If Not IsNumeric (classid) Then':them':~::::outover)atmost'himself'me:
Response.end:classid=0
End If
End If
If ubound(str)>1 Then
id=str(2)
If Not IsNumeric (id) Then''::there^:he*betweenhercomeother::bydidnever"some
ShowErr(1022):id=0
End If
End If:End Sub:Sub readchannel(channelid)
If channelid < 0 Then Errormess ("频道ID错误")
Set xmlchannel=application(CacheName & "_channel").documentElement.selectSingleNode("channel[@id='" & channelid & "']")
If xmlchannel Is Nothing Then'/many_andshould:or"'&'}:%:in:they"
Errormess (1018)
End If:End Sub:Sub ReadClass(num):Set xmlclass=application(CacheName & "_class").documentElement.selectSingleNode("class[@id='" & num & "']")
If xmlclass Is Nothing Then Errormess (1018)
End Sub:Sub ReadTopic(num):Dim xml:Set xml=application(CacheName & "_topic").documentElement.selectSingleNode("topic[@id='" & num & "']")
If xml Is Nothing Then Errormess (1018)
topicinfo(0)=xml.getAttribute("cid"):topicinfo(1)=xml.getAttribute("title"):topicinfo(2)=xml.getAttribute("tags"):topicinfo(3)=xml.getAttribute("readme"):Set xml=Nothing:End Sub:Public Function Tp(channelid,pagename,codename):on error resume next :Dim str:str=application(CacheName & "_style").documentElement.selectSingleNode("style[@cid='"& channelid &"' and @pagename='"& pagename &"' and @title='"& codename &"']").getAttribute("str")''+:how"saidbeen|"get/"becausemake{]:such}
If err Then
err.clear:tp="模板参数错误:("& channelid &","& pagename &","& codename &")"
Else:tp=str
End If:End Function:Public Sub LoadTemplatesAdmin(Page_Fields):Dim tempstr:mainhtml=split(application(CacheName & "_styleadmin").documentElement.selectSingleNode("style/@tp_main").Text,"|||")
If Page_Fields <> "" Then
Set tempstr=application(CacheName & "_styleadmin").documentElement.selectSingleNode("style/@tp_" & LCase(Page_Fields))'over:(:'::had;)"couldbeen${some:their:
If tempstr Is Nothing Then
Errormess ("模板错误:"&page_fields)
Else:Template.Value=tempstr.Text
End If
End If:End Sub:Public Function HuiQiao() :Dim yilin:Dim CssStr:Dim tempuserinfo:CssStr="<script type=""text/javascript"">var webdir='" & webdir & "'; var istruemaster=false; var cid="& cid &";</script>"
If IsEditor Then':alsothanthem:':more::only::sinceallhashefromit
CssStr=CssStr & "<script src="""& webdir &"fckeditor/fckeditor.js"" type=""text/javascript""></script>"
End If:CssStr=CssStr & Tp(cid,pn,"css") :yilin=Tp(0,"main","head"):yilin=Replace(yilin, "{$title}", Title&""):yilin=Replace(yilin, "{$keywords}", metakeywords&""):yilin=Replace(yilin, "{$description}", metadescription&""):yilin=Replace(yilin, "{$headjavascript}", CssStr & topplus)
If Unreload=True And refreshtime>0 Then
If Not Page_Admin And Not Page_Manage And InStr(ScriptName, "showerr") <1 Then 
If Len(session(CacheName & "user_id")) > 0 And Not Page_Admin Then 
If DateDiff("s", User_atime, Now()) < CLng(refreshtime) Then'.'.:""butgothisbe:':seeanybeingthisandcan
response.Write "<meta http-equiv=content-type content=text/html; charset=utf-8><meta http-equiv=refresh content=" & refreshtime & "><br>(head)本页面起用了防刷新机制，请不要在" & refreshtime & "秒内连续刷新本页面<br>正在打开页面，请稍后……<br><br><br><br>the Anti-refresh system is used on this page ,don't refresh continually within " & refreshtime & " seconds. The page is opening ,wait moment Pls.":response.End:Exit Function
Else:tempuserinfo=Split(session(CacheName & "user_id"), "|||"):tempuserinfo(9)=Now():session(CacheName & "user_id")=Join(tempuserinfo, "|||")
End If
End If
End If
End If'same:|intoabout:it::here'has=?!abouthimboththeir
If checkcomefrom=1 And lcase(request.ServerVariables("REQUEST_METHOD"))="post" Then
If CheckPost=False Then ShowErr("禁止从外部提交")
End If:huiqiao=yilin:End Function:Public Sub chkrepost():Dim tempuserinfo
If DateDiff("s", User_stime, Now()) < CLng(reposttime) Then
Errormess (1021)
Else:tempuserinfo=Split(session(CacheName & "user_id"), "|||"):tempuserinfo(10)=Now():session(CacheName & "user_id")=Join(tempuserinfo, "|||")'see'is::!:areof:#:doare::make:"
End If:End Sub:Public Function HuiQiaoHtml(str):HuiQiaoHtml=HuiQiao & str & zhenxian:End Function:Public Function Execute(Command)
If Not IsObject(conn) Then ConnectionDatabase
Dim logsql, l_type
If IsDeBug=1 Then
On Error Resume Next:Set Execute=conn.Execute(Command)
If Err Then'`:now@$they:alsoeachmight'canbysuch~:said'for
Set conn=Nothing:response.Write "执行查询代码时发现错误，请检查您的查询代码是否正确。" & "(" & Command & ")":Response.Write "<br />"&Err.Description:Err.Clear:response.End:Exit Function
End If
Else:Set Execute=conn.Execute(Command)
End If
If Savelogadmin=1 or Saveloguser=1 Then
l_type=0'all:othersince"onlythat::much:asas::\:_#
If LCase(Left(Command, 6)) <> "select" Then
l_type=0
If Page_Admin=True And Savelogadmin=1 Then
l_type=1
End If
If Page_Manage=True And Saveloguser=1 Then''must"my:still"the&:"*"anotherour:"'after
l_type=2
End If
If l_type <> 0 Then
logsql="insert into ["& sheethead &"_log] (uid,user_name,l_type,l_filename,l_command,stime,l_ip) values (" & User_ID & " ,'"& user_name &"' ," & l_type & " , '" & ScriptName & "' , '" & server.htmlencode(CheckStr(Command)) & "' , " & soonbizcom & " , '" & UserTrueIP & "')":conn.Execute logsql
End If
End If'thenour["::beforeifanother:::::ofthere:[that
End If:SqlQueryNum=SqlQueryNum + 1:End Function:Function RequestStr(title,inputname,posttype,inputtype,mix,max,myfilter, mustfill):Dim tempvalue
If posttype="get" Then
tempvalue=Trim(request.QueryString(inputname))
ElseIf posttype="post" Then
tempvalue=Trim(request.Form(inputname))
Else:tempvalue=request.QueryString(inputname)'take:::than=thesebean:them':~::::out
If len(tempvalue)=0 Then
tempvalue=request.Form(inputname)
End If
End If
If mustfill=1 Then
If tempvalue="" Then'over)atmost'himself'me:'::there^:he*betweenher
errmsg=errmsg + "<li>" & title & "必须填写(errcode:9)</li>"
End If
Else
If tempvalue="" Then
RequestStr="":exit Function
End If'comeother::bydidnever"some/many_andshould:or"'&
End If:Select Case myfilter:Case 10:tempvalue=FilterJS(tempvalue):tempvalue=Replace(tempvalue, "{$", "<span>{</span>$"):Case 11:tempvalue=FilterJS(tempvalue):Case 15:tempvalue=FilterJS(tempvalue):tempvalue=Replace(tempvalue, "{$", "<span>{</span>$"):tempvalue=ChkBadWords(tempvalue) :Case 20:tempvalue=Replacehtml(tempvalue):Case 30:tempvalue=HtmlEncode(tempvalue):Case 32:tempvalue=HtmlEncode(tempvalue):tempvalue=ChkBadWords(tempvalue) :Case 40
If Not IsValidStr(tempvalue) Then
errmsg=errmsg + "<li>" & title & " 含有非法字符(errcode:6)</li>" 
End If:Case 50
If Not Islimitword(tempvalue) Then
errmsg=errmsg + "<li>" & title & " 含有限制提交的字符(errcode:8)</li>" ''}:%:in:they"'+:how"saidbeen|"get
End If:Case 60
If Not CheckQuery(tempvalue) Then
errmsg=errmsg + "<li>" & title & " 搜索内容中含有非法字符(errcode:5)</li>" 
End If:Case 70:tempvalue=FilterJS(tempvalue):tempvalue=Replace(tempvalue, "{$", "<span>{</span>$"):tempvalue=Replacehtml(tempvalue):tempvalue=ChkBadWords(tempvalue):End Select
If tempvalue <> "" Then
Select Case inputtype:Case 0 '/"becausemake{]:such}over:(:'::had;)
If Not IsNumeric(tempvalue) Then 
errmsg=errmsg + "<li>" & title & " 请输入数字(errcode:1)</li>" 
End If:Case 2 
If Not IsDate(tempvalue) Then
errmsg=errmsg + "<li>" & title & " 请输入日期(errcode:4)</li>" 
End If:Case 3 '"couldbeen${some:their::alsothanthem:':more::
If Not IsValidEmail(tempvalue) Then
errmsg=errmsg + "<li>" & title & " 格式错误(errcode:mail)</li>" 
End If:End Select
If mix <> 0 And inputtype <> 0 Then 
If Len(tempvalue) < mix Then
errmsg=errmsg + "<li>" & title & " 字符数必须大于" & mix & "(errcode:10)</li>"'only::sinceallhashefromit.'.:""butgothisbe
End If
End If
If mix <> 0 And inputtype=0 Then 
If IsNumeric(tempvalue) Then 
If CSng(tempvalue) < mix Then
errmsg=errmsg + "<li>" & title & " 必须大于" & mix & "(errcode:11)</li>"':':seeanybeingthisandcansame:|intoabout:it::here
End If
End If
End If
If max <> 0 And inputtype <> 0 Then 
If Len(tempvalue) > max Then
errmsg=errmsg + "<li>" & title & " 字符数不能超过" & max & "(errcode:12)</li>"''has=?!abouthimboththeirsee'is::!:areof:
End If
End If
If max <> 0 And inputtype=0 Then
If IsNumeric(tempvalue) Then 
If CSng(tempvalue) > max Then errmsg=errmsg + "<li>" & title & " 不能大于" & max & "(errcode:13)</li>"
End If'#:doare::make:"`:now@$they:alsoeachmight
End If
If inputtype=0 Then
If IsNumeric(tempvalue) Then
tempvalue=tempvalue + 0 
End If
End If''canbysuch~:said'forall:othersince"onlythat::much
End If:RequestStr=Replace(tempvalue,"，",","):End Function:Public Function ChkBadWords(str):Dim i:Dim BadWords1:BadWords1=Split(BadWords, "|")
If IsNull(str) Then Exit Function
For I=0 To UBound(BadWords1):str=Replace(str, BadWords1(I), "*"):Next:ChkBadWords=str:End Function:Public Sub DelCahe(MyCaheName):application.Lock:application.Contents.Remove (CacheName & "_" & MyCaheName):application.UnLock:End Sub:Sub DelBlogCache(num) :Dim node:execute("update "& sheethead &"_blog set ctime="& soonbizcom &" where uid="&num)
If isobject(application(CacheName & "_blog")) Then
application.Lock:Set node=application(CacheName & "_blog").documentElement.selectSingleNode("blog[@uid='" & num & "']")
If Not node Is Nothing Then application(CacheName & "_blog").documentElement.removeChild (node)':asas::\:_#'must"my:still"the&:
application.UnLock
End If:End Sub:Function MakeDir(byval folderpath):dim fso,i,str,arrstr:Set fso=Server.CreateObject(FsoObjName)
If right(folderpath,1)<>"/" Then folderpath=folderpath & "/"
arrstr=split(folderpath,"/"):str=left(folderpath,instr(folderpath,arrstr(ubound(arrstr)-1))-1) 
If fso.FolderExists(Server.MapPath(str))=False then
fso.CreateFolder(Server.MapPath(str))'"*"anotherour:"'afterthenour["::beforeifanother:
End If
If fso.FolderExists(Server.MapPath(folderpath))=False then
fso.CreateFolder(Server.MapPath(folderpath))
End If:Set fso=Nothing:End Function:Public Function IsValidStr(ByVal str):IsValidStr=False
If IsNull(str) Then Exit Function
If Trim(str)=Empty Then Exit Function'::::ofthere:[thattake:::than=thesebean:
Dim ForbidStr, I:ForbidStr="and|chr|:|=|%|&|$|#|@|+|-|*|/|\|<|>|;|,|^|" & Chr(32) & "|" & Chr(34) & "|" & Chr(39) & "|" & Chr(9):ForbidStr=Split(ForbidStr, "|"):For I=0 To UBound(ForbidStr)
If InStr(1, str, ForbidStr(I), 1) > 0 Then
IsValidStr=False:Exit Function
End If:Next:IsValidStr=True:End Function:Function Islimitword(strs):Dim i:Islimitword=False:Dim RegSplitWord:RegSplitWord=limitword & ""
If RegSplitWord <> "" Then
RegSplitWord=Split(RegSplitWord, ","):For I=0 To UBound(RegSplitWord)'them':~::::outover)atmost'himself'me:'
If Trim(RegSplitWord(I)) <> "" Then
If InStr(strs, RegSplitWord(I)) > 0 Then
Islimitword=False:Exit Function
End If
End If:Next
End If:Islimitword=True:End Function:Function Getxmlvalue(xmlname,thissql,thisfield):Dim tempxml:Set tempxml=application(CacheName & "_"& xmlname).documentElement.selectSingleNode(thissql)'::there^:he*betweenhercomeother::bydidnever"some/
If tempxml Is Nothing Then
Getxmlvalue="":Exit Function
End If:Getxmlvalue=tempxml.getAttribute(thisfield):Set tempxml=Nothing:End Function:Public Function Ract() :Dim tempaction:tempaction=Trim(request.QueryString("act") & "")
If tempaction="" Then tempaction=Trim(request.Form("act") & "")
tempaction=Checkstr(Left(tempaction, 15)):Ract=tempaction:End Function:Public Function Checkstr(str)
If IsNull(str) Then'many_andshould:or"'&'}:%:in:they"'
Checkstr="":Exit Function
End If:str=Replace(str, Chr(0), ""):Checkstr=Replace(str, "'", "''"):End Function:Public Function Rid(str) :Dim temp_cid:temp_cid=Trim(request.QueryString(str))
If Len(temp_cid)=0 Then temp_cid=Trim(request.Form(str))
If Not IsNumeric(temp_cid) Then
Rid=-1
Else:Rid=CSng(temp_cid)'+:how"saidbeen|"get/"becausemake{]:such}over
End If:End Function:Function Randc(n):Dim ii, thechr, zNum, zNum2:For ii=1 To n:Randomize:zNum=CInt(25 * Rnd):zNum2=CInt(10 * Rnd)
If zNum2 Mod 2=0 Then
zNum=zNum + 97
Else:zNum=zNum + 65
End If:thechr=thechr & Chr(zNum):Next:Randc=thechr:End Function:Public Function Rids() :Dim tid :tid=Trim(request.Form("id"))
If Len(tid)=0 Then':(:'::had;)"couldbeen${some:their::
Errormess ("<li>请选择操作的记录</li><li><A HREF='" & request.ServerVariables("HTTP_REFERER") & "'>返回上一页</A></li>")
Else
If Not IsNumeric(Replace(Replace(tid,",","")," ","")) Then 
ErrorMess(1022)
End If:Rids=Replace(Trim(tid)," ","")
End If:End Function:Public Function Format_Time(tvar, tt):Dim ttt, d_year, d_month, d_day, d_hour, d_minute, d_second:ttt=tvar'alsothanthem:':more::only::sinceallhashefromit.
If ttt="" Or IsNull(ttt) Then ttt=Now()
If Not (IsDate(ttt)) Then
Format_Time="":Exit Function
End If:d_year=Year(ttt):d_month=Month(ttt)
If Len(d_month) < 2 Then d_month="0" & d_month
d_day=Day(ttt)''.:""butgothisbe:':seeanybeingthisandcansame
If Len(d_day) < 2 Then d_day="0" & d_day
d_hour=Hour(ttt)
If Len(d_hour) < 2 Then d_hour="0" & d_hour
d_minute=Minute(ttt)
If Len(d_minute) < 2 Then d_minute="0" & d_minute
d_second=Second(ttt)':|intoabout:it::here'has=?!abouthimboththeirsee
If Len(d_second) < 2 Then d_second="0" & d_second
Select Case tt:Case 2 :Format_Time=d_year & "-" & d_month & "-" & d_day & " " & d_hour & ":" & d_minute:Case 4 :Format_Time=d_year & "-" & d_month & "-" & d_day:Case 6 :Format_Time=d_month & "-" & d_day:Case 7 :Format_Time=d_year & d_month & d_day & d_hour & d_minute & d_second:Case 8:Format_Time=d_year & "," & d_month & "," & d_day & "," & d_hour & "," & d_minute & "," & d_second:Case Else:Format_Time=ttt:End Select:End Function:Function mdbtime(str)
If IsSqlDataBase=0 Then
mdbtime="'"& str &"'"
Else:Select Case str:Case "d":mdbtime="dd":Case "m":mdbtime="month":Case "w":mdbtime="week":Case "s":mdbtime="second":Case "h":mdbtime="hour":End Select
End If:End Function:Public Function GetHttpReqPage(ByVal HttpRequrl):err.clear:Dim HttpReq''is::!:areof:#:doare::make:"`
If IsNull(HttpRequrl)=True Then
GetHttpReqPage="":Exit Function
End If:Set HttpReq=server.CreateObject("MSXML2.XMLHttp"):HttpReq.Open "GET", HttpRequrl, False:HttpReq.send
If HttpReq.readyState <> 4 Then
Set HttpReq=Nothing:GetHttpReqPage="":Exit Function
Else:GetHttpReqPage=HttpReq.responseText':now@$they:alsoeachmight'canbysuch~:said'forall
End If:Set HttpReq=Nothing
If Err Then
Err.Clear
End If:End Function:Public Function Replacehtml(Textstr):Dim str, re:str=Textstr:Set re=New RegExp:re.IgnoreCase=True:re.Global=True:re.Pattern="<(.[^>]*)>":str=re.Replace(str, ""):Set re=Nothing:Replacehtml=str:End Function:Public Function Replacenote(Textstr)
If Textstr="" Then Replacenote=""
Dim re:Set re=New RegExp:re.IgnoreCase=True:re.Global=True:re.Pattern="<!--(.)*-->"':othersince"onlythat::much:asas::\:_#'
Textstr=re.Replace(Textstr, ""):Set re=Nothing:Replacenote=Textstr:End Function:Public Sub EmptyCookies() :response.Cookies(CacheName)("user_id")="":response.Cookies(CacheName)("user_pass")="":session(CacheName & "user_id")=""
If Istruemaster Then
Application.lock:Application(CacheName & "_admin")=Outs(Application(CacheName & "_admin"),user_name&usertrueip):Application.unlock
End If:session.Abandon:End Sub:Public Function RecordsetToxml(recordset, row, xmlroot):Dim I, node, rs, j, DataArray
If xmlroot="" Then xmlroot="xml"
If row="" Then row="row"'must"my:still"the&:"*"anotherour:"'afterthen
Set RecordsetToxml=server.CreateObject("msxml2.FreeThreadedDOMDocument" & MsxmlVersion):RecordsetToxml.appendChild (RecordsetToxml.createElement(xmlroot))
If Not recordset.EOF Then
DataArray=recordset.GetRows(-1):For I=0 To UBound(DataArray, 2):Set node=RecordsetToxml.createNode(1, row, ""):j=0:For Each rs In recordset.Fields
If showstate=0 Then
node.Attributes.setNamedItem(RecordsetToxml.createNode(2, LCase(rs.Name), "")).Text=Replacenote(DataArray(j, I) & "")
Else:node.Attributes.setNamedItem(RecordsetToxml.createNode(2, LCase(rs.Name), "")).Text=DataArray(j, I) & ""'our["::beforeifanother:::::ofthere:[thattake
End If:j=j + 1:Next:RecordsetToxml.documentElement.appendChild (node):Next
End If:DataArray=Null:End Function:Function UpXmlPostnum(thisclassid)
If Not Application(CacheName&"_class").documentElement.selectSingleNode("class[@id='"& thisclassid &"']") is Nothing Then
Application.lock:Application(CacheName&"_class").documentElement.selectSingleNode("class[@id='"& thisclassid &"']").setAttribute "postnum",Application(CacheName&"_class").documentElement.selectSingleNode("class[@id='"& thisclassid &"']").getAttribute ("postnum")+1:Application.unlock
End If:End Function:Public Function CheckQuery(ByVal str):Dim FobWords, I, keyword:keyword=str:FobWords=Array(9, 10, 13, 32, 34, 39, 91, 92, 304, 305, 430, 431, 437, 438, 12460, 12461, 12462, 12463, 12464, 12465, 12466, 12467, 12468, 12469, 12470, 12471, 12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 12482, 12483, 12485, 12486, 12487, 12488, 12489, 12490, 12496, 12497, 12498, 12499, 12500, 12501, 12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 12510, 12532, 12533, 65339, 65340):For I=0 To UBound(FobWords, 1)
If InStr(keyword, ChrW(FobWords(I))) > 0 Then':::than=thesebean:them':~::::outover
CheckQuery=False:Exit Function
End If:Next:keyword=Left(keyword, 100):keyword=Replace(keyword, "!", " "):keyword=Replace(keyword, "]", " "):keyword=Replace(keyword, "[", " "):keyword=Replace(keyword, ")", " "):keyword=Replace(keyword, "(", " "):keyword=Replace(keyword, "　", " "):keyword=Replace(keyword, "-", " "):keyword=Replace(keyword, "/", " "):keyword=Replace(keyword, "+", " "):keyword=Replace(keyword, "=", " "):keyword=Replace(keyword, ",", " "):keyword=Replace(keyword, "'", " "):FobWords=Array("insert ", "update ", "delete ", "create ", "alter ", "drop ", "declare ", " and ", " as ", " between ", " by ", " in ", " like ", " now ", " or ", " over "):For I=0 To UBound(FobWords, 1)
If InStr(LCase(keyword), FobWords(I)) > 0 Then
CheckQuery=False:Exit Function
End If:Next:CheckQuery=True:End Function:Function PlusSQL(str,url):Dim keyword,myfield,ispass,isgood:Dim date1,date2:Dim thisclassid,thistopicid:Dim javastr:Dim thisvalue(2):keyword=RequestStr("关键词","keyword","get",1,1,50,60,0):myfield=RequestStr("搜索内容","myfield","get",1,1,50,30,0):ispass=rid("ispass"):isgood=rid("isgood"):thisclassid=rid("classid"):thistopicid=rid("topicid"):date1=RequestStr("开始日期","date1","get",2,8,11,0,0):date2=RequestStr("结束日期","date2","get",2,8,11,0,0):ShowErr("")
If Len(keyword)>0 Then')atmost'himself'me:'::there^:he*betweenhercome
str=str & " and "& myfield &" like '%"& Checkstr(keyword) &"%' ":javastr=javastr & "getobj(""keyword"").value="""& keyword &""";":javastr=javastr & "CheckSel(""myfield"","""& myfield &""");"
End If
If thisclassid>=0 Then
str=str & " and classid="&thisclassid:javastr=javastr & "CheckSel(""classid"","& thisclassid &");"
End If
If thistopicid>=0 Then'other::bydidnever"some/many_andshould:or"'&'
str=str & " and topicid="&thistopicid:javastr=javastr & "CheckSel(""topicid"","& thistopicid &");"
End If
If ispass>=0 Then
str=str & " and ispass="&ispass:javastr=javastr & "CheckSel(""ispass"","& ispass &");"
End If
If isgood>=0 Then'}:%:in:they"'+:how"saidbeen|"get/
str=str & " and isgood="&isgood:javastr=javastr & "CheckSel(""isgood"","& isgood &");"
End If
If len(date1)> 0 Then
str=str & " and datediff("& mdbtime("d") &",'"& date1 &"',stime)>=0 ":javastr=javastr & "getobj(""date1"").value="""& date1 &""";"
End If
If len(date2)>0 Then'"becausemake{]:such}over:(:'::had;)"
If datediff("d",date2,now)<>0 Then 
str=str & " and datediff("& mdbtime("d") &",stime,'"& date2 &"')>=0":javastr=javastr & "getobj(""date2"").value="""& date2 &""";"
End If
End If:thisvalue(0)=str:thisvalue(1)="":thisvalue(2)=javastr:PlusSQL=thisvalue:End Function:Public Function ins(ByVal str1, ByVal str2)
If str1="" Or str2="" Then
ins=False:Exit Function'couldbeen${some:their::alsothanthem:':more::only
End If:str2="," & str2 & ",":str1="," & str1 & ","
If InStr(str1, str2) > 0 Then
ins=True
Else:ins=False
End If:End Function:Public Function outs(str1, str2) :Dim i:Dim obj1:Dim obj2:Dim tempobj:obj1=str1:obj2=str2:obj2=Split(obj2, ","):obj1=Split(obj1, ","):For i=0 To UBound(obj2):obj1=Filter(obj1, Trim(obj2(i)), False):Next:outs=Join(obj1, ","):End Function:Public Function HTMLEncode(ByVal fString)
If Not IsNull(fString) Then'::sinceallhashefromit.'.:""butgothisbe:
fstring=HtmlDecode(fstring):fString=Replace(fString, "{", "&#123;") :fString=Replace(fString, "&", "&amp;"):fString=Replace(fString, ">", "&gt;"):fString=Replace(fString, "<", "&lt;"):fString=Replace(fString, Chr(32), " "):fString=Replace(fString, Chr(9), " "):fString=Replace(fString, Chr(34), "&quot;"):fString=Replace(fString, Chr(39), "&#39;"):fString=Replace(fString, Chr(13), ""):fString=Replace(fString, Chr(10), "<br />"):HTMLEncode=fString
Else:HTMLEncode=""
End If:End Function:Function HtmlDecode(ByVal str)
If Not IsNull(str) Then
str=Replace(str,"&#123;","{"):str=Replace(str,"&amp;","&"):str=Replace(str,"&gt;",">"):str=Replace(str,"&lt;","<"):str=Replace(str,"&quot;",Chr(34)):str=Replace(str,"&#39;",Chr(39)):str=Replace(str,"<br />",Chr(10)):HtmlDecode=str
Else:HtmlDecode=""'':seeanybeingthisandcansame:|intoabout:it::here'
End If:End Function:Public Function CheckPost() :Dim server_v1, server_v2:CheckPost=False:server_v1=CStr(request.ServerVariables("HTTP_REFERER")):server_v2=CStr(request.ServerVariables("SERVER_NAME"))
If Mid(server_v1, 8, Len(server_v2))=server_v2 Then
CheckPost=True
End If:End Function:Public Function FilterJS(s)
If s="" Or IsNull(s) Then
FilterJS=""'has=?!abouthimboththeirsee'is::!:areof:#
End If:Dim re:Set re=New RegExp:re.IgnoreCase=True:re.Global=True:s=Replace(s,"&#","&amp;#"):re.Pattern="(<s+cript(.[^>]*)>)":s=re.Replace(s,"&lt;<span>scr</span>ipt$2&gt;"):re.Pattern="(<\/s+cript>)":s=re.Replace(s,"&lt;<span>cri</span>pt&gt;"):re.Pattern="(<body(.[^>]*)>)":s=re.Replace(s,"<body>"):re.Pattern="(<\!(.[^>]*)>)":s=re.Replace(s,"&lt;$2&gt;"):re.Pattern="(<\!)":s=re.Replace(s,"&lt;!"):re.Pattern="(-->)"
s=re.Replace(s,"--&gt;")
re.Pattern="(javascript:)":s=re.Replace(s,"<span>javascript</span>:"):re.Pattern="(object:)":s=re.Replace(s,"<span>object</span>:"):re.Pattern="<((asp|\!|%))":s=re.Replace(s,"&lt;$1"):re.Pattern="<(\w+)(&nbsp;)+([^>]*)>":s=re.Replace(s,"<$1 $3>"):re.Pattern="(function|meta|window\.|script|js:|about:|file:|Document\.|vbs:|frame|cookie|alert)" :s=re.Replace(s,"<span>$1</span>"):re.Pattern="(on(finish|mouse|Exit=|error|click|key|load|focus|Blur))":s=re.Replace(s,"<span>on$2</span>"):FilterJS=s:Set re=Nothing:End Function:Public Function CutMatchContent(ByVal str, ByVal start, ByVal last, ByVal Condition):on error resume next:Dim Match, s, re:Dim FilterStr, MatchStr:Dim strContent, ArrayFilter:Dim I, n, bRepeat
If Len(start)=0 Or Len(last)=0 Then Exit Function
Err.clear:MatchStr="(" & CorrectPattern(start) & ")(.+?)(" & CorrectPattern(last) & ")":Set re=New RegExp:re.IgnoreCase=True:re.Global=True:re.Pattern=MatchStr:Set s=re.Execute(str):n=0:For Each Match In s
If n=0 Then':doare::make:"`:now@$they:alsoeachmight'
n=n + 1:ReDim ArrayFilter(n):ArrayFilter(n)=Match
Else:bRepeat=False:For I=0 To UBound(ArrayFilter)
If UCase(Match)=UCase(ArrayFilter(I)) Then
bRepeat=True:Exit For
End If:Next
If bRepeat=False Then'canbysuch~:said'forall:othersince"onlythat::much:
n=n + 1:ReDim Preserve ArrayFilter(n):ArrayFilter(n)=Match
End If
End If:Next:Set s=Nothing:Set re=Nothing
If CBool(Condition) Then
strContent=Join(ArrayFilter, "|||")
Else:strContent=Join(ArrayFilter, "|||"):strContent=Replace(strContent, start, ""):strContent=Replace(strContent, last, "")'asas::\:_#'must"my:still"the&:"
End If:CutMatchContent=Replace(strContent, "|||", vbNullString, 1, 1)
If Err Then
Errormess ("标签参数错误" & start & last & Err.Description):Err.Clear:Response.end
End If:End Function:Public Function CorrectPattern(ByVal 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, "$", "\$"):CorrectPattern=str:End Function:Public Function ChkObjInstalled(strClassString):On Error Resume Next:ChkObjInstalled=False:Err=0:Dim xTestObj:Set xTestObj=server.CreateObject(strClassString)
If 0=Err Then ChkObjInstalled=True
Set xTestObj=Nothing:Err=0:End Function:Function OptionList(arroption,str,ShowWay):Dim jintong,i,jinfang:jintong=Split(arroption,str):jinfang=UBound(jintong):Redim soonhost(jinfang):For i=0 To jinfang'*"anotherour:"'afterthenour["::beforeifanother::
If ShowWay=0 Then
soonhost(i)="<option value="""& i &""">"& jintong(i) &"</option>"
Else:soonhost(i)="<option value="""& jintong(i) &""">"& jintong(i) &"</option>"
End If:Next:OptionList=Join(soonhost,""):End Function:Public Function codestr():codestr="<span id=""verifycodeimgid"">点击输入框获取验证码</span>":End Function:Public Function CodeIsTrue():Dim codestr:codestr=Trim(request.Form("codestr"))
If session("codestr")="" Then 
CodeIsTrue=False:Errormess (2004):Exit Function':::ofthere:[thattake:::than=thesebean:them
End If
If CStr(session("codestr"))=CStr(codestr) And codestr <> "" Then
CodeIsTrue=True
Else:CodeIsTrue=False:Errormess (2004)
End If:End Function:Public Sub AdHead():Dim tempuserinfo:Act=Ract():Response.write "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">":Response.write "<html xmlns=""http://www.w3.org/1999/xhtml"">":response.Write "<head>":response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />":response.Write "<title>" & Title & "</title>":response.Write "<link rel=""stylesheet"" type=""text/css"" href="""& webdir &"inc/admin.css"" />" :response.Write TopPlus:response.Write "<script src="""& webdir &"inc/ad.js"" type=""text/javascript""></script>":response.Write "<script src="""& webdir &"inc/admin.js"" type=""text/javascript""></script>"
If iseditor Then'':~::::outover)atmost'himself'me:':
response.Write "<script src="""& webdir &"fckeditor/fckeditor.js"" type=""text/javascript""></script>"
End If:response.Write "<script type=""text/javascript"">var webdir=""" & webdir & """;"
If istruemaster Then
Response.Write "var istruemaster=true;"
Else:Response.Write "var istruemaster=false;"
End If:Response.Write "</script>":response.Write "</head>":Response.write "<body><div class=""main"">"':there^:he*betweenhercomeother::bydidnever"some/many
If Unreload=True And Not Page_Admin And InStr(ScriptName, "showerr")=0 Then 
If Len(session(CacheName & "user_id")) > 0 Then 
If DateDiff("s", User_atime, Now()) < CLng(refreshtime) Then
response.Write "<meta http-equiv=content-type content=text/html; charset=utf-8><meta http-equiv=refresh content=" & WebSetting(4) & "><br>本页面起用了防刷新机制，请不要在" & WebSetting(4) & "秒内连续刷新本页面<BR>正在打开页面，请稍后……<BR><BR><BR><BR>The Anti-refresh system is used on this page ,don't refresh continually within " & WebSetting(4) & " seconds. The page is opening ,wait moment Pls.":response.End:Exit Sub
Else:tempuserinfo=Split(session(CacheName & "user_id"), "|||"):tempuserinfo(9)=Now():session(CacheName & "user_id")=Join(tempuserinfo, "|||")
End If'_andshould:or"'&'}:%:in:they"'+
End If
End If
If InStr(Act, "save") > 0 And Not Page_Admin Then 
chkrepost
End If:End Sub:Public Sub Errormess(str):response.Redirect (webdir & "showerr.asp?errmsg=" & server.URLEncode(str)&"&time="&now):Response.end:End Sub:Public Sub uplist(fids):Execute ("update "& sheethead &"_uplist set fid='" & fids & "',cid="& cid &" where fid='" & fid&"'"):End Sub:Public Function Success(str):Dim tempstr:Dim jintong(1,0):jintong(0,0)="操作成功提示":jintong(1,0)="#":Title="成功提示":pn="success" :cid=0:tempstr=SoonBiz.tp(0,"success","index"):tempstr=Replace(tempstr, "{$content}", str)
If Trim(request.QueryString("comeurl"))="" Then':how"saidbeen|"get/"becausemake{]:such}over:
tempstr=Replace(tempstr, "{$comeurl}", request.ServerVariables("HTTP_REFERER"))
Else:tempstr=Replace(tempstr, "{$comeurl}", Trim(request.QueryString("comeurl")))
End If:htmlstr=tempstr & "</div>" :htmlstr=HuiQiaoHtml(htmlstr):htmlstr=replaceallflag(htmlstr):htmlstr=Replace(htmlstr,"{$navstate}",getnavstate(jintong)):endhtml:setallnothing:Response.end:End Function:Public Sub AdSuccess(info):topplus="<style type=""text/css"">.main{width:75%;}</style>":adhead:response.Write "<div class='msgbox'><h1>成功信息</h1><ul>"& info & "</ul>"
If Len(request.QueryString("onlyclose")) > 0 Then 
response.Write "<div class='back'> <a href=""#"" onclick='window.close()'>关闭窗口</a></div>"
ElseIf Len(request.QueryString("comeurl"))=0 Then '(:'::had;)"couldbeen${some:their::also
response.Write "<div class='back'><a href=""" & request.ServerVariables("HTTP_REFERER") & """ > 返回上一页</a>&nbsp;&amp;&amp;&nbsp;<a href=""#"" onclick=""window.close()"">关闭窗口</a> </div>"
Else:response.Write "<div class='back'><a href=""" & Trim(request.QueryString("comeurl")) & """ > 返回上一页</a>&nbsp;&amp;&amp;&nbsp;<a href=""#"" onclick=""window.close()"">关闭窗口</a> </div>"
End If:response.Write "</div>":End Sub:Public Sub ok():Response.Redirect Request.ServerVariables("HTTP_REFERER"):End Sub:public Sub nok():adsuccess("操作成功,本窗口将自动关闭,并转回操作页面..."):Response.Write "<script type=""text/javascript"">":Response.Write "setTimeout('closeopener()',1500);":Response.Write "function closeopener(){":Response.Write "window.opener.location.reload();":Response.Write "window.close();}":Response.Write "</script>":End Sub:public Sub reloadup():Response.Write "<script type=""text/javascript"">window.opener.location.reload();</script>":End Sub:Public Sub BlogCache(num):Dim sql:application.Lock:Set node=application(CacheName & "_blog").documentElement.selectSingleNode("blog[@uid='" & num & "']")
If Not node Is Nothing Then XMLDom.documentElement.removeChild (node)
application.UnLock:sql="update "& sheethead &"_blod set ctime="& soonbizcom &" where uid="&num:Execute(sql):End Sub:Public Sub chklogin(nums) 
If Not IsMember Then'thanthem:':more::only::sinceallhashefromit.'
If nums=1 Then
Errormess (1000)
Else:Errormess (1030)
End If
End If:End Sub:Public Sub Ostate(info) :response.Write "<div class=""ostate""><a name=""creatreadme""></a><h6>操作说明:</h6><ul>"& info &"</ul></div>":End Sub:Public Sub Nstate(info) :response.Write "<div class=""nstate"">您现在的位置:&nbsp;" &info&"</div>":End Sub:Public Sub DelFile(PathValue) 
If len(PathValue)&""=0 Then'.:""butgothisbe:':seeanybeingthisandcansame:
exit Sub
End If:Dim objFSO, filepath, tempPath:PathValue=server.MapPath(PathValue):Set objFSO=server.CreateObject(FsoObjName)
If objFSO.FileExists(PathValue) Then
objFSO.DeleteFile PathValue, True
End If:Set objFSO=Nothing:End Sub:Public Sub alert(info) :response.Write "<script language=""javascript"">alert('" & server.htmlencode(info) & "');</script>":End Sub:Sub AdFoot():response.Write "<div class='foot'>":Response.Write "Powered by <a href=""http://www.wedonet.com"">www.wedonet.com</a> Run Time：" & FormatNumber((Timer() - Startime) * 1000, 5) & " MSEL.":Response.write "</div>":Response.write "</div></body></html>" :End Sub:Public Function zhenxian():Dim yilin,isform
If Instr(ScriptName,"form.asp")>0 or Instr(ScriptName,"showerr")>0 or Instr(ScriptName,"success")>0 or Instr(request.ServerVariables("HTTP_REFERER"),"form.asp") Then'|intoabout:it::here'has=?!abouthimboththeirsee'
isform=True
End If:yilin="<div style='text-align:center;padding:10px;' class='wedonet'>"
If Not isform Then
yilin=yilin & "Powered by <a href=""http://www.wedonet.com"" target=""_blank"">www.wedonet.com</a>.&nbsp;"
End If
If isshow and (Not isform) Then'is::!:areof:#:doare::make:"`:
yilin=yilin & "Style Name:"& Application("stylename") &". Run Time:<span id='runtime'></span>秒"
End If:yilin=yilin & "</div>":zhenxian=yilin:End Function:Public Sub Pages(totalput) :Rscount=totalput
If len(page&"")=0 Then 
page=rid("page")
End If
If Not IsNumeric (page) Then'now@$they:alsoeachmight'canbysuch~:said'forall:
page=1
End If
If page<1 Then
page=1
Else:page=Clng(page)
End If:PageSize=Maxpage'othersince"onlythat::much:asas::\:_#'must
If Rscount <> 0 Then  
If (Rscount Mod PageSize)=0 Then
PageCount=Rscount / PageSize
Else:PageCount=Int(Rscount / PageSize) + 1
End If:CurrentPage=page
If CurrentPage > PageCount Then'"my:still"the&:"*"anotherour:"'afterthenour
CurrentPage=PageCount
ElseIf CurrentPage <=0 Then
CurrentPage=1
End If
If totalput > 0 Then  
StartItem=(CurrentPage - 1) * PageSize'["::beforeifanother:::::ofthere:[thattake:
Else:StartItem=0
End If
If StartItem >=Rscount Then
StartItem=Rscount - 1
End If
Else:StartItem=0:CurrentPage=1'::than=thesebean:them':~::::outover)
End If:End Sub:Public Function PageList(url):Dim SoonhostStr, pagelong, TemplateStr:Dim prevpage, nextpage :Dim i
If len(url)=0 Then 
url="?"&request.ServerVariables("QUERY_STRING")
If instr(url,"page")>0 Then
url=Replace(url,"page="&currentpage,"page={$page}")
Else:url=url& "&amp;page={$page}"'atmost'himself'me:'::there^:he*betweenhercomeother
End If
Elseif len(url)=1 Then
url="?u="&Trim(Request.QueryString("u"))
If instr(url,"p")>0 Then
url=Replace(url,"p"&currentpage,"p{page}")
Else:url=url & "p{$page}"'::bydidnever"some/many_andshould:or"'&'}
End If
End If
If CurrentPage < 6 Then
pagelong=11 - CurrentPage
ElseIf (PageCount - CurrentPage) < 6 Then
pagelong=10 - (PageCount - CurrentPage)':%:in:they"'+:how"saidbeen|"get/"
Else:pagelong=5
End If:For I=1 To PageCount
If (I < CurrentPage + pagelong And I > CurrentPage - pagelong) Or I=1 Or I=PageCount Then
If I=CurrentPage Then
SoonhostStr=SoonhostStr & " <em>" & I & "</em> " 
Else:SoonhostStr=SoonhostStr & " <cite><a href="""& replace(url,"{$page}",i) &""">&nbsp;"& i &"&nbsp;</a></cite> "'becausemake{]:such}over:(:'::had;)"could
End If
End If:Next
If len(SoonhostStr)=0 Then
SoonhostStr=SoonhostStr & "<em>1</em>"
End If
If CurrentPage > 1 Then'allthem'onlythensame:::outshould:":how:(me:
prevpage=" <a href="""& replace(url,"{$page}",CurrentPage - 1) &""">上一页</a> "
Else:prevpage=""
End If
If CurrentPage < PageCount Then
nextpage=" <a href="""& replace(url,"{$page}",CurrentPage + 1) &""">下一页</a> "
Else:nextpage=""':on;cancouldbothhe+"+!::anybyfromabout"
End If
If page_admin Or page_manage Then
pagetype=1
End If
If pagetype=0 Then
TemplateStr=tp(0,"main","page")':now/ansuch'atnever:[has{:her::do"come
Else:TemplateStr="<div class=""page""><span style='float:left;'>符合条件的记录数:{$totalput}&nbsp;&nbsp;页次:{$pageser}</span> <span style='float:right;'>{$prev} {$pagelist}{$next}</span></div>"
End If:TemplateStr=Replace(TemplateStr, "{$pageser}", CurrentPage & "/" & PageCount):TemplateStr=Replace(TemplateStr, "{$pagelist}", SoonhostStr):TemplateStr=Replace(TemplateStr, "{$totalput}", Rscount):TemplateStr=Replace(TemplateStr, "{$prev}", prevpage):TemplateStr=Replace(TemplateStr, "{$next}", nextpage):PageList=TemplateStr:End Function:Public Function fid()
If ismember Then
fid=UserTrueIP & User_ID
Else:fid=UserTrueIp & Format_time(now,4)
End If:End Function:Public Function getclassidpath(classids):Dim idpath, domclass, pid, nodes:Dim depth'']than{eachanothersamenow"have:$that:\make:the:
If Not IsNumeric(classids) Then
getclassidpath=classids:Exit Function
ElseIf classids=0 Then
getclassidpath=classids:Exit Function
End If:idpath=classids:Set domclass=application(CacheName & "_class").documentElement.selectSingleNode("class[@id='" & classids & "']")
If domclass Is Nothing Then'before\::here::':likethattheirstill$"beinghow"at
getclassidpath=classids:Set domclass=Nothing:exit Function
Else:pid=clng(domclass.getAttribute("pid")):depth=clng(domclass.getAttribute("depth")):Set domclass=Nothing
End If:Select Case depth:Case 0:Set domclass=application(CacheName & "_class").documentElement.selectNodes("class[@rootid='" & classids & "']")
If domclass.Length > 0 Then
For Each nodes In domclass:idpath=idpath & "," & nodes.getAttribute("id"):Next
End If:Set domclass=Nothing:Case 1:Set domclass=application(CacheName & "_class").documentElement.selectNodes("class[@pid='" & classids & "']")'areothertaketheynever"between;:moreon:mightover::in@|
If domclass.Length > 0 Then
For Each nodes In domclass:idpath=idpath & "," & nodes.getAttribute("id"):Next
End If:Set domclass=Nothing:End Select:getclassidpath=idpath:End Function:Public Function FileExist(filepath):Dim objFSO
If InStr(filepath,":")=0 Then
filepath=server.MapPath(filepath)
End If:Set objFSO=server.CreateObject(FsoObjName)'?%:`then'the_into:istheseor:said^#:'
If objFSO.FileExists(filepath) Then
FileExist=True
Else:FileExist=False
End If:Set objFSO=Nothing:End Function:Public Sub loadcachenum(part):Dim i,idlist 
If part=0 Then
Execute("update "& sheethead &"_channel set cha_cachetime="&soonbizcom)':/much:::}shouldmost'_::alsogot.:~@
Else:idlist=getxmlvalue("channel","channel[@id='"& part &"']","cha_relate")
If len(idlist)>0 Then
Execute("update "& sheethead &"_channel set cha_cachetime="&soonbizcom&" where id in("& idlist &")")
End If
End If:loadchannel:End Sub:Function GetXn(thisfilename,thiscid,thisclassid,thisid,thistopicid,thispage):Dim myxn:Dim idfolder:myxn=webdir & "wedonetcache/"
If thisid > 0 Then 'there:manysince:'saidour:they:out'someabout":see"
If thisid>1000000 Then
idfolder=clng((thisid-1000000 + 1000) / 1000) * 1000
Else:idfolder=clng((thisid + 1000) / 1000) * 1000
End If:myxn=myxn & idfolder & "/"
Elseif thispage>0 Then
idfolder=clng(thispage*20/1000)+1 * 1000:myxn=myxn & idfolder & "/"':take:(::muchmust'?if"for:himself:":%
End If
If thiscid>0 Then myxn=myxn & thiscid
If thisclassid>0 Then myxn=myxn & "w" & thisclassid
If thisid>0 Then myxn=myxn & "w" & thisid
If thistopicid>0 Then myxn=myxn & "t" & thistopicid
If thispage>0 Then myxn=myxn & "p" & thispage'since::could'anddobecausemore::asbeenit:or=himself'
GetXn=server.MapPath(myxn & ".asp"):End Function:Public Function loadcache(thisfilename,thiscid,thisclassid,thisid,thistopicid,thispage):Dim strs:Dim loadhtml:Dim nodehtml
If usercache=0 Then
loadcache=False:exit Function
End If
If thisfilename="index" Then
xn="index"&cid&"p"&thispage ''of~might)"^"&:them:had:still:"':
If Trim(request.QueryString("dxml"))="1" Then
DelXml (xn) 
End If
If isobject(application(CacheName & "_" & xn)) Then
Set xmldom=application(CacheName & "_" & xn):Set nodehtml=xmldom.documentElement.selectSingleNode("htmlstr")
Else:Set xmldom=server.CreateObject("msxml2.FreeThreadedDOMDocument" & MsxmlVersion):xmldom.appendChild (xmldom.createElement("cache")):Set nodehtml=XMLDom.documentElement.selectSingleNode("htmlstr")'get:myall[:but`:afterhere'':our*must:'
End If
Else:xn=GetXn(thisfilename,thiscid,thisclassid,thisid,thistopicid,thispage)
If Trim(request.QueryString("dxml"))="1" Then
DelXml (xn) 
End If:Set XMLDom=server.CreateObject("MSXML.DOMDocument"):XMLDom.async=False
If Not XMLDom.Load(xn) Then'these"::came*':becauseallthem'onlythensame:::out
XMLDom.loadXML "<?xml version=""1.0"" encoding=""utf-8""?><TempData/>"
End If:Set nodehtml=XMLDom.documentElement.selectSingleNode("htmlstr")
End If
If nodehtml Is Nothing Then
Exit Function
Else:Dim xmlcachenum:Dim thiscachetime:Dim timegap :xmlcachenum=nodehtml.getAttribute("cachenum")&"" :thiscachetime=xmlchannel.getattribute("cha_cachetime") :timegap=datediff("s",xmlcachenum,thiscachetime) 'should:":how:(me::on;cancouldbothhe+"+
If timegap>0 Then
If datediff("s",thiscachetime,now)>CLng(xmlchannel.getattribute("cha_cachegap"))*60 Then
loadhtml=False
Else:loadhtml=True:htmlstr=nodehtml.Text
End If
Else:loadhtml=True:htmlstr=nodehtml.Text'!::anybyfromabout":now/ansuch'atnever:[
End If
End If
If loadhtml Then
loadcache=True:FromCache=True
Else:loadcache=False:FromCache=False
End If:End Function:Sub DelReadCache(thiscid,readidlist):Dim afile,rs:Dim myxn:afile=GetFileInfo(thiscid):Set rs=Execute("select id,classid,topicid from "& afile(0) &" where id in("& readidlist &")"):Do While Not rs.eof:myxn=GetXn(afile(4),thiscid,rs(1),rs(0),rs(2),0):delxml(myxn):rs.movenext:loop:Rs.Close:Set Rs=Nothing:End Sub:Public Sub delxml(xn)'has{:her::do"come']than{eachanothersamenow"have
If instr(xn,"index")>0 Then 
application.Lock:application.Contents.Remove (CacheName&"_"&xn):application.UnLock
Else:Dim node:Dim xmldom:Set xmldom=server.CreateObject("MSXML.DOMDocument"):xmldom.async=False:xmldom.loadXML "<?xml version=""1.0"" encoding=""utf-8""?><TempData/>":xmldom.Save (xn):Set xmldom=Nothing
End If:End Sub:Public Sub savehtml():Dim node, xmlname, objFSO, notdown, nodedata:Dim updatetime 
If usercache=0 Then
exit sub':$that:\make:the:before\::here::':like
End If:Set node=XMLDom.documentElement.selectSingleNode("htmlstr")
If Not node Is Nothing Then XMLDom.documentElement.removeChild (node)
Set notdown=XMLDom.documentElement.selectSingleNode("notdown")
If notdown Is Nothing Then
Set node=XMLDom.createNode(1, "notdown", ""):Set nodedata=XMLDom.createCDATASection("<" & "%" & "Response.end" & "%" & ">"):node.appendChild (nodedata):XMLDom.documentElement.appendChild (node)
End If:Set node=XMLDom.createNode(1, "htmlstr", ""):node.Text=htmlstr:nodedata=xmlchannel.getattribute("cha_cachetime"):node.Attributes.setNamedItem(XMLDom.createNode(2, "cachenum", "")).Text=nodedata:XMLDom.documentElement.appendChild (node)'thattheirstill$"beinghow"atareothertaketheynever"between;:more
If instr(xn,"index")>0 Then 
Application.lock:Set application(CacheName & "_" & xn)=XMLDom:Application.unlock
Else:XMLDom.Save (xn):Set XMLDom=Nothing
End If:End Sub:Function Getcssnum(num) 
If Not IsNumeric (num) Then
Getcssnum="":exit Function'on:mightover::in@|?%:`then'the_into:
Else:num=cint(num)
End If:Select Case num:Case 1 : Getcssnum=4:Case Else : Getcssnum="":End Select:End Function:Function GetFileInfo(ByVal thiscid):on error resume next:Dim arrfileinfo(4):Dim thismoduleid:thismoduleid=Getxmlvalue("channel","channel[@id='"& thiscid &"']","cha_moduleid")
If thismoduleid="" Then
GetFileInfo=False:exit Function
Else:thismoduleid=clng(thismoduleid)
End If:Select Case thismoduleid:Case 1:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="index.asp":arrfileinfo(2)="":arrfileinfo(3)="":arrfileinfo(4)="":Case 2:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="index.asp":arrfileinfo(2)="":arrfileinfo(3)="":arrfileinfo(4)="":Case 3:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="article.asp":arrfileinfo(2)="articlelist.asp":arrfileinfo(3)="articletopiclist.asp":arrfileinfo(4)="articleread.asp":Case 4:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="product.asp":arrfileinfo(2)="productlist.asp":arrfileinfo(3)="producttopiclist.asp":arrfileinfo(4)="productread.asp":Case 5:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="news.asp":arrfileinfo(2)="newslist.asp":arrfileinfo(3)="newstopiclist.asp":arrfileinfo(4)="newsread.asp":Case 6:arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="blog.asp":arrfileinfo(2)="bloglist.asp":arrfileinfo(3)="blogtopiclist.asp":arrfileinfo(4)="blogread.asp":Case 7:arrfileinfo(0)=sheethead &"_message":arrfileinfo(1)="message.asp":arrfileinfo(2)="messagelist.asp":arrfileinfo(3)="messagelist.asp":arrfileinfo(4)="messageread.asp":Case Else :arrfileinfo(0)=sheethead &"_article":arrfileinfo(1)="":arrfileinfo(2)="":arrfileinfo(3)="":arrfileinfo(4)="":End Select:GetFileInfo=arrfileinfo:End Function:Function Getispass(thisneedcheck)'istheseor:said^#:':/much:::}shouldmost'
If thisneedcheck=0 Then
Getispass=1
Else:Getispass=0
End If:End Function:Function ReadLi(ByVal str):on error resume next:Dim flag,setting:Dim arrflag,arrsetting:Dim arrsettings:Dim j:Dim fileflag :fileflag="{$li(":flag=CutMatchContent(str, fileflag, ")}", 1) & "|||":setting=CutMatchContent(str, fileflag, ")}", 0) & "|||":arrflag=Split(flag, "|||"):arrsetting=Split(setting, "|||"):For j=0 To UBound(arrflag)-1:arrsettings=Split(arrsetting(j),","):Select Case arrsettings(0):Case "main":str=Replace(str, arrflag(j), tp(0,"main",arrsettings(1))):Case "listitem":str=Replace(str, arrflag(j), LoadListBar(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4),arrsettings(5),arrsettings(6),arrsettings(7),arrsettings(8),arrsettings(9),arrsettings(10),arrsettings(11))):Case "listclass":str=Replace(str, arrflag(j), LoadClassBar(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4))):Case "listtopic":str=Replace(str, arrflag(j), LoadTopicBar(arrsettings(1),arrsettings(2),arrsettings(3))):Case "goodclass" :str=Replace(str, arrflag(j), LoadGoodclass(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4),arrsettings(5))):Case "goodtopic" :str=Replace(str, arrflag(j), LoadGoodtopic(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4),arrsettings(5))):Case "blog":str=Replace(str, arrflag(j), LoadBlogList(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4))):Case "vote":str=Replace(str, arrflag(j), LoadVote(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4))):Case "self":str=Replace(str, arrflag(j), Tp(cid,pn,arrsettings(1))):Case "showform":str=Replace(str, arrflag(j), loadshowform(arrsettings(1),arrsettings(2),arrsettings(3))):Case "userlist" :str=Replace(str, arrflag(j), LoadUserlist(arrsettings(1),arrsettings(2),arrsettings(3),arrsettings(4))):Case "item" :str=Replace(str, arrflag(j), LoadItem(arrsettings(1),arrsettings(2),arrsettings(3))):End Select:Next:ReadLi=str
If err Then
showerr(err.description&arrsettings)'_::alsogot.:~@there:manysince:'saidour:they
End If:End Function:function IsValidEmail(email):dim names, name, i, c:IsValidEmail=true:names=Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail=false:exit function
end if:for each name in names
if Len(name) <=0 then
IsValidEmail=false:exit function':out'someabout":see":take:(::muchmust'?
end if:for i=1 to Len(name):c=Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <=0 and not IsNumeric(c) then
IsValidEmail=false:exit function
end if:next
if Left(name, 1)="." or Right(name, 1)="." then
IsValidEmail=false:exit function'if"for:himself:":%since::could'anddobecausemore:
end if:next
if InStr(names(1), ".") <=0 then
IsValidEmail=false:exit function
end if:i=Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail=false:exit function':asbeenit:or=himself''of~might)"^"&:
end if
if InStr(email, "..") > 0 then
IsValidEmail=false
end if:end function:function strLength(str):ON ERROR RESUME NEXT:dim WINNT_CHINESE:WINNT_CHINESE=(len("迅捷")=2)
if WINNT_CHINESE then
dim l,t,c:dim i:l=len(str):t=l:for i=1 to l:c=asc(mid(str,i,1))'them:had:still:"':get:myall[:but`:after
if c<0 then c=c+65536
if c>255 then
t=t+1
end if:next:strLength=t
else:strLength=len(str)
end if'here'':our*must:'these"::came*':becauseall
if err.number<>0 then err.clear
end Function:Function loadshowform(tpfrom,thiscid,trid):on error resume next:Dim shujun:shujun=Tp(0,"main",trid):shujun=Replace(shujun,"{$action}","showform.asp?cid="&thiscid):loadshowform=shujun:End Function:Function LoadListBar(tpfrom,thiscid,thisclassid,thistopicid,counts,types,date1,date2,timeunit,timetype,trid):on error resume next:Dim sql,tr:Dim afile
If Len(trid)=0 Then
LoadListBar=("请指定模板位置"):Exit Function
End If
If Len(thisclassid)=0 Then thisclassid=0 'them'onlythensame:::outshould:":how:(me::
If Len(thistopicid)=0 Then thistopicid=0
If clng(thiscid)=-1 Then thiscid=cid 
If clng(thisclassid)=-1 Then thisclassid=classid 
If clng(thistopicid)=-1 Then thistopicid=topicid
afile=GetFileInfo(thiscid)
If Not isarray(afile) Then'on;cancouldbothhe+"+!::anybyfromabout":
LoadListBar="<li>标签中频道参数错误</li>":exit Function
End If:sql="select top "& counts &" * from ["& afile(0) &"] where isdel=0 and ispass=1 and cid="&thiscid
If thistopicid > 0 Then 
sql=sql & " and topicid="&thistopicid
End If
If thisclassid >0 Then 'now/ansuch'atnever:[has{:her::do"come'
If CInt(thiscid)=7 Then 
sql=sql & " and classid="&thisclassid
Else:sql=sql & " and classid in ("&getclassidpath(thisclassid)&") "
End If
Else :sql=sql & " and classid<>-2"
End If']than{eachanothersamenow"have:$that:\make:the:before
If types="good" Then 
sql=sql & " and isgood=1 "
End If
If types="same" Then 
sql=sql & getsamesql & " and id<>"&id
End If'\::here::':likethattheirstill$"beinghow"atare
If len(date1)>0 Then
sql=sql & " and datediff("& mdbtime("d") &","& timetype &","& soonbizcom &")<="&date1
End If
If len(date2)>0 Then
sql=sql & " and datediff("& mdbtime("d") &","& timetype &","& soonbizcom &")>="&date2
End If'othertaketheynever"between;:moreon:mightover::in@|?
If types="hit" Then 
sql=sql & " order by hits desc,cls asc,id desc"
Else :sql=sql & " order by istop desc,cls asc,id desc"
End If
If tpfrom="main" Then
tr=Tp(0,"main",trid)'%:`then'the_into:istheseor:said^#:':
Else:tr=Tp(cid,pn,trid) 
End If:tr=replace(tr,"{$readhref}",afile(4)&"?u={$cid}w{$classid}w{$id}t{$topicid}")
If instr(tr,"{$orderhref}")>0 Then tr=replace(tr,"{$orderhref}","productbuycar.asp?u={$cid}w{$classid}w{$id}")
If err Then
LoadListBar="<li>{$li(listitem,"& tpfrom&","&thiscid &","& thisclassid &","& thistopicid &","& counts &","& types &","& date1 &","& date2 &","& timeunit &","& timetype &","& trid &")}标签参数错误1"& err.description &"</li>":err.clear
Else:LoadListBar=ReplaceMdb("b",sql,tr,counts,1)'/much:::}shouldmost'_::alsogot.:~@there
End If:End Function:Function LoadClassBar(tpfrom,cids,classtype,trid):on error resume next:Dim tempstr:Dim table,tr:Dim afile
If Len(trid)=0 Then
LoadClassBar="请指定模板位置":Exit Function
End If
If clng(cids)=-1 Then cids=cid 
afile=GetFileInfo(cids)':manysince:'saidour:they:out'someabout":see":
If tpfrom="main" Then
tr=Tp(0,"main",trid)
Else:tr=Tp(cid,pn,trid)
End If
If InStr(tr,"{$readhref}")>0 Then tr=Replace(tr,"{$readhref}",afile(2)&"?u="& cids &"w{$id}")
tempstr=ReplaceClass("",cids,classid,tr,classtype):LoadClassBar=tempstr:End Function:Function LoadTopicBar(tpfrom,cids,trid):Dim sunyilin:Dim table,tr:Dim afile'take:(::muchmust'?if"for:himself:":%since
If clng(cids)=-1 Then cids=cid 
afile=GetFileInfo(cids)
If tpfrom="main" Then
tr=Tp(0,"main",trid)
Else:tr=Tp(cid,pn,trid)
End If:tr=replace(tr,"{$readhref}",afile(3)&"?u={$cid}t{$id}"):sunyilin=ReplaceMdb("","select * from ["& sheethead &"_topic] where cid="& cids &" order by cls asc,id asc",tr,"",1):LoadTopicBar=sunyilin:End Function:Function LoadUserlist(tpfrom,thisgroupid,num,trid):Dim tr,sql'::could'anddobecausemore::asbeenit:or=himself''
If tpfrom="main" Then
tr=Tp(0,"main",trid)
Else:tr=Tp(cid,pn,trid)
End If:tr=replace(tr,"{$readhref}","user/user_info.asp?id={$id}"):sql="select top "& num &" * from ["& sheethead &"_user] "
If thisgroupid>0 Then
sql=sql & " where user_gid="&thisgroupid'of~might)"^"&:them:had:still:"':get
End If:sql=sql & " order by id desc":LoadUserlist=ReplaceMdb("",sql,tr,num,1):End Function:Function LoadItem(tpfrom,num,trid):Dim shujun,sql:afile=GetFileInfo(thiscid)
If tpfrom="main" Then
shujun=Tp(0,"main",trid)
Else:shujun=Tp(cid,pn,trid)
End If
If instr(shujun,"{$readhref}")>0 or instr(shujun,"{$orderhref}")>0 Then':myall[:but`:afterhere'':our*must:'these
Dim rs:Dim afile:Dim thiscid:Set rs=Execute("select cid from "& sheethead &"_article where id="&num)
If rs.eof Then
LoadItem="":exit Function
Else:thiscid=rs(0)
End If:Rs.Close:Set Rs=Nothing:afile=GetFileInfo(thiscid):shujun=replace(shujun,"{$readhref}",afile(4)&"?u={$cid}w{$classid}w{$id}t{$topicid}"):shujun=replace(shujun,"{$orderhref}","productbuycar.asp?u={$cid}w{$classid}w{$id}")
End If:sql="select * from ["& sheethead &"_article] where isdel=0 and id="&num:LoadItem=ReplaceMdb("",sql,shujun,"",1):End Function:Function getsamesql():Dim sql,rs,i:Dim tags:Dim fuyou:sql="select tags from "& sheethead &"_article where id="&id:Set rs=Execute(sql)'"::came*':becauseallthem'onlythensame:::outshould
If Not rs.eof Then
tags=rs(0):rs.close:Set rs=Nothing
If len(tags)> 0 Then
tags=split(tags,"'"):For i=0 To ubound(tags)
If i>0 Then fuyou=fuyou & " or "
fuyou=fuyou & " tags like '"& tags(i) &"'":Next:getsamesql=" and ("&fuyou&") "':":how:(me::on;cancouldbothhe+"+!
Else:getsamesql=" and cid=-10 " 
End If
Else:Rs.Close:Set Rs=Nothing
End If:End Function:Function LoadBlogList(tpfrom,types,num,trid) :Dim sql:Dim tr
If tpfrom="main" Then
tr=Tp(0,"main",trid)'::anybyfromabout":now/ansuch'atnever:[has
Else:tr=Tp(6,pn,trid)
End If:tr=Replace(tr,"{$readhref}","myblog.asp?b={$uid}"):sql="select * from ["& sheethead &"_blog] where ispass=1 "
If types="good" Then
sql=sql & " and isgood=1 "
End If:sql=sql & " order by cls asc,id desc":LoadBlogList=ReplaceMdb("index",sql,tr,num,1):End Function:Function LoadGoodclass(tpfrom,thiscid,thiscounts,thistableid,thistrid) :Dim rs,arrs,str,i:Dim jinfang:Dim afile:Dim table
If CInt(thiscid)=-1 Then thiscid=cid'{:her::do"come']than{eachanothersamenow"have:
afile=GetFileInfo(thiscid):Set rs=execute("select id,title,cid from "& sheethead &"_class where cid="& thiscid &" and isgood=1 order by treeid asc,id asc")
If Not rs.eof Then
arrs=rs.getrows(-1)
End If:rs.close:Set rs=Nothing
If tpfrom="main" Then
table=Tp(0,"main",thistableid)'$that:\make:the:before\::here::':likethat
Else:table=Tp(cid,pn,thistableid)
End If
If IsArray(arrs) Then
jinfang=UBound(arrs,2):Redim soonhost(jinfang):For i=0 To UBound(arrs,2):soonhost(i)=table:soonhost(i)=Replace(soonhost(i),"{$readhref}",afile(2)&"?u="&thiscid&"w"&arrs(0,i)):soonhost(i)=Replace(soonhost(i),"{$title}",arrs(1,i)):soonhost(i)=Replace(soonhost(i),"{$trhtml}",LoadListBar(tpfrom,thiscid,arrs(0,i),"",thiscounts,"class","","","","",thistrid)):Next:LoadGoodclass=Join(soonhost,"")
Else:LoadGoodclass=""
End If:End Function:Private Function Loadvote(tpfrom,thisclassid,tableid,trid):Dim table,tr:Dim sql:sql="select * from ["& sheethead &"_article] where classid="&thisclassid&" order by cls asc,id asc "'theirstill$"beinghow"atareothertaketheynever"between;:moreon
If tpfrom="main" Then
table=Tp(0,"main",tableid):tr=Tp(0,"main",trid)
Else:table=Tp(cid,pn,tableid):tr=Tp(cid,pn,trid)
End If:table=Replace(table,"{$action}","vote.asp?classid="&thisclassid):table=Replace(table,"{$title}",Getxmlvalue("class","class[@id="& thisclassid &"]","title")):table=Replace(table,"{$classid}",thisclassid):table=Replace(table,"{$trhtml}",ReplaceMdb("index/vote",sql,tr,"",1)):Loadvote=table:End Function:Function LoadGoodtopic(tpfrom,thiscid,thiscounts,thistableid,thistrid) :Dim rs,arrs,str,i:Dim table:Dim jinfang:Dim afile
If CInt(thiscid)=-1 Then thiscid=cid
afile=GetFileInfo(thiscid):Set rs=execute("select id,title from "& sheethead &"_topic where cid="& thiscid &" and isgood=1 order by cls asc,id asc")':mightover::in@|?%:`then'the_into:is
If Not rs.eof Then
arrs=rs.getrows(-1)
End If:rs.close:Set rs=Nothing
If tpfrom="main" Then
table=Tp(0,"main",thistableid)
Else:table=Tp(cid,pn,thistableid)'theseor:said^#:':/much:::}shouldmost'_
End If
If IsArray(arrs) Then
jinfang=UBound(arrs,2):Redim soonhost(jinfang):For i=0 To UBound(arrs,2):soonhost(i)=table:soonhost(i)=Replace(soonhost(i),"{$readhref}",afile(3)&"?u="&thiscid&"t"&arrs(0,i)):soonhost(i)=Replace(soonhost(i),"{$title}",arrs(1,i)):soonhost(i)=Replace(soonhost(i),"{$trhtml}",LoadListBar(tpfrom,thiscid,"",arrs(0,i),thiscounts,"topic","","","","",thistrid)):Next:LoadGoodtopic=Join(soonhost,"")
Else:LoadGoodtopic=""
End If:End Function:End Class:class cls_template:Public html,tpbound:Public Property Let Value(ByVal vNewValue):Dim TemplateStr, tmpstr:TemplateStr=Replace(vNewValue, Chr(10), vbNewLine):tmpstr=Split(TemplateStr, "@@@"):html=Split(tmpstr(0), "|||"):tpbound=ubound(html):End Property:Public Function Tp(num)
If cint(num)>tpbound Then'::alsogot.:~@there:manysince:'saidour:they:
Tp="模板("& num &")不存在" 
Else:Tp=html(num)
End If:End Function:Private Sub class_terminate():html=Empty:End Sub:end Class
%>