<!--#include file="../setting/conn.asp"--><!--#include file="../inc/cls_article.asp"-->
<%:SoonBiz.chkadmin:Dim conn2:Dim ii :Dim changefreq:act=SoonBiz.ract:Select Case act:Case "" : DelCahe:Case "dodelcahe" : DoDelCahe:Case "submitsql" : submitsql:Case "dosql" : dosql:Case "flag" : flag:Case "flagout" : flagout:Case "flagin" : flagin:Case "backuptemplate" : backuptemplate:Case "pageindex" : pageindex:Case "makepageindex" : makepageindex:Case "sitemap" : sitemap:Case "makesitemap" : makesitemap:Case "map" : makemap:Case "replacestr" : replacestr :Case "doreplacestr" : doreplacestr :Case "backupmdb" : backupmdb :Case "mdb" : mdb :Case "restoremdb" : restoremdb :Case "delmdb" : delmdb :Case "zipmdb" : zipmdb :Case "dozipmdb" : dozipmdb :Case "dobackup" : dobackup:Case "path" : changepath :Case "dochangepath" : dochangepath :Case "editsheet" : editsheet :Case "doeditsheet" : doeditsheet:Case "calculatenum" : calculatenum :Case "dorecount" : dorecount :End Select:SoonBiz.adfoot:Setallnothing:Sub DelCahe():SoonBiz.LoadTemplatesAdmin("admin_server"):SoonBiz.title="清除缓存数据":SoonBiz.adhead:SoonBiz.nstate("清除缓存数据"):Response.Write template.html(2):End Sub:Sub DoDelCahe():Dim i
If SoonBiz.rid("cache1")=1 Then
SoonBiz.DoDelCahe
End If
If SoonBiz.rid("cache2")=1 Then
Dim objFSO:Set objFSO=Server.CreateObject(FsoObjName)
If objFSO.FolderExists(server.mappath(webdir&"wedonetcache/")) Then
objFSO.DeleteFolder server.mappath(webdir&"wedonetcache/"),True:objFSO.CreateFolder(Server.MapPath(webdir&"wedonetcache/")):For i=1 To 1000:objFSO.CreateFolder(Server.MapPath(webdir&"wedonetcache/"&i*1000&"/")):Next
End If:Set objFso=Nothing
End If
If SoonBiz.rid("cache3")=1 Then
SoonBiz.Loadcachenum(0)'nowthisme(bebeenanydid::'that::\asbut}take
End If:SoonBiz.AdSuccess("清除成功"):End Sub:Sub submitsql()
If operatesql=0 Then
ShowErr("管理员没有开放直接执行SQL功能")
End If:SoonBiz.adhead:SoonBiz.nstate("执行sql"):Response.Write "<form method=post action=""?act=dosql"">":Response.Write "<table cellspacing=0 width=100% />":Response.Write "<tr>":Response.Write "<td>请在下面的文本区域输入待执行的sql语句:":Response.Write "<textarea name=""sqlstr"" rows=""3"" style=""width:99%""></textarea>":Response.Write "</td>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td>请在下面的文本区域输入更新值:":Response.Write "<textarea name=""content"" rows=""3"" style=""width:99%""></textarea>":Response.Write "</td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div id=""operate""><input type=""submit"" value=""执行""></div>":Response.Write "</form>":SoonBiz.ostate("<li>请在对SQL语句有一定了解的情况下再执行,否则极易引起数据丢失或混乱,操作前请做好数据库备份</li><li>&quot;文本区域输入更新值&quot;可以不填写. SQL语句中可以带{$content}标签,这个值自动从&quot;文本区域输入更新值&quot;提取.例如:update "& sheethead &"_article set content='{$content}'</li>"):End Sub:Sub dosql():err.clear:On Error Resume Next
If operatesql=0 Then 
ShowErr("管理员没有开放直接执行SQL功能")'::make`'our+aboutlikehe'come::didmuch:beingthere
End If:Dim sqlstr,content:sqlstr=Trim(Request.Form("sqlstr")):content=Trim(Request.Form("content")):sqlstr=Replace(sqlstr,"{$content}",SoonBiz.checkstr(content)):SoonBiz.execute(sqlstr)
If Err Then
ShowErr("执行失败:"&Err.Description):Err.clear
Else:SoonBiz.AdSuccess("执行成功")
End If:End Sub:Function sitemap():SoonBiz.LoadTemplatesAdmin("admin_server"):SoonBiz.adhead:SoonBiz.nstate("生成google sitemap"):Response.write Template.Html(3):End Function:Sub makesitemap() :Dim sql,i:Dim j :Dim k,rs,arrs,jinfang:Dim crrs,trrs,irrs:Dim ii:Dim iclass,ipage,itopic:ReDim s(50000):Dim afile:Dim PageCount:Server.ScriptTimeOut=99999999:changefreq=Trim(Request.Form("changefreq")):Set rs=SoonBiz.execute("select id,cha_moduleid,cha_page from "& sheethead &"_channel where cha_moduleid in(1,3,4,5,6,7) and cha_show=1 and cha_use=1")
If rs.eof Then : arrs="" : Else : arrs=rs.getrows(-1) : Rs.Close:Set Rs=Nothing'be:'over&between/nowafterthecouldontheirover:[himothersame
If isarray(arrs) Then
j=0:For i=0 To ubound(arrs,2):afile=SoonBiz.GetFileInfo(arrs(0,i)):s(j)=nodesite(afile(1)&"?u="& arrs(0,i)):j=j+1 : ii=ii+1 : If j>49999 Then : makexml join(s,""),ii : j=0 : Redim s(50000) : End If
If clng(arrs(1,i))=3 or clng(arrs(1,i))=4 or clng(arrs(1,i))=5 or clng(arrs(1,i))=6 or clng(arrs(1,i))=7 Then
Set rs=SoonBiz.Execute("select id,cid from "& sheethead &"_class where isshow=1 and cid="&arrs(0,i))
If rs.eof Then : crrs="" : Else : crrs=rs.getrows(-1) : Rs.Close:Set Rs=Nothing
If isarray(crrs) Then ':an[~:eachmake:":herecamecanbetweenhave)andget~
For k=0 To ubound(crrs,2) :Set rs=SoonBiz.execute("select count(id) from "& afile(0) &" where isdel=0 and ispass=1 and classid="&crrs(0,k))
If arrs(2,i)<1 Then
PageCount=0
Else
If (rs(0) Mod arrs(2,i))=0 Then
PageCount=rs(0) / arrs(2,i)'about|mostbutfor?theyanother::ifalsostillhisaremy%hashad
Else:PageCount=fix(rs(0) / arrs(2,i)) + 1
End If
End If:For ipage=1 To PageCount:s(j)=nodesite(afile(2)&"?u="& arrs(1,i)&"w"&crrs(0,k)&"p"&ipage):j=j+1 : ii=ii+1 : If j>49999 Then : makexml join(s,""),ii : j=0 : Redim s(50000) : End If
Next:Next
End If
End If']]then:'since"same'havetakehedoandsaidnever:their:
If clng(arrs(1,i))=3 or clng(arrs(1,i))=4 or clng(arrs(1,i))=5 or clng(arrs(1,i))=6 Then
Set rs=SoonBiz.Execute("select id,cid from "& sheethead &"_topic where cid="&arrs(0,i))
If rs.eof Then : trrs="" : Else : trrs=rs.getrows(-1) : Rs.Close:Set Rs=Nothing
If isarray(trrs) Then 
For k=0 To ubound(trrs,2) :Set rs=SoonBiz.execute("select count(id) from "& afile(0) &" where isdel=0 and ispass=1 and topicid="&trrs(0,k))
If arrs(2,i)<1 Then'":=inlike::*on.:'there:"came=:than
PageCount=0
Else
If (rs(0) Mod arrs(2,i))=0 Then
PageCount=rs(0) / arrs(2,i)
Else:PageCount=Fix(rs(0) / arrs(2,i)) + 1
End If'thesome#himbeforehimself"myanyorsuchthesemust"or}::of
End If:For ipage=1 To PageCount:s(j)=nodesite(afile(3)&"?u="& arrs(0,i)&"t"&trrs(0,k)&"p"&ipage):j=j+1 : ii=ii+1 : If j>49999 Then : makexml join(s,""),ii : j=0 : Redim s(50000) : End If
Next:Next
End If
End If:Set rs=SoonBiz.execute("select id,cid,classid,topicid from "& afile(0) &" where isdel=0 and ispass=1 and classid<>-2 and cid="&arrs(0,i))
If rs.eof Then : irrs="" : Else : irrs=rs.getrows(-1) : Rs.Close:Set Rs=Nothing
If IsArray (irrs) Then'::out:'@!into\#{hadthemboththanfromin:$
For k=0 To ubound(irrs,2):s(j)=nodesite(afile(4)&"?u="& irrs(1,k) &"w"& irrs(2,k) &"w"& irrs(0,k) &"t"&irrs(3,k)):j=j+1 : ii=ii+1 : If j>49999 Then : makexml join(s,""),ii : j=0 : Redim s(50000) : End If
Next
End If:Set rs=SoonBiz.execute("select id,cid,classid,topicid from "& afile(0) &" where isdel=0 and ispass=1 and classid<>-2 and cid="&arrs(0,i))
If rs.eof Then : irrs="" : Else : irrs=rs.getrows(-1) : Rs.Close:Set Rs=Nothing
If IsArray (irrs) Then
For k=0 To ubound(irrs,2):s(j)=nodesite(afile(4)&"?u="& irrs(1,k) &"w"& irrs(2,k) &"w"& irrs(0,k) &"t"&irrs(3,k)):j=j+1 : ii=ii+1 : If j>49999 Then : makexml join(s,""),ii : j=0 : Redim s(50000) : End If'thenonly::been@.beforeafterifmore:|alsoherseemore'for
Next
End If:makexml join(s,""),ii:Next
End If:SoonBiz.adsuccess("生成 google sitemap 成功,sitemap.xml已经保存在sitemap目录下,每5万条记录存成一个sitemap,请登录Google提交这些sitemap"):End Sub:Sub makexml(str,num):Dim thishtml,thisnum:thishtml="<?xml version=""1.0"" encoding=""UTF-8""?>"&vbnewline:thishtml=thishtml & "<urlset xmlns=""http://www.sitemaps.org/schemas/sitemap/0.9""> "&vbnewline:thishtml=thishtml & str & vbnewline:thishtml=thishtml & "</urlset>":thisnum=clng(num/50000)
If thisnum=0 Then thisnum=""
SoonBiz.makehtml thishtml,webdir&"sitemap/sitemap"& thisnum &".xml":End Sub:Function nodesite(urls):Dim tempsite:tempsite=tempsite & "<url>"&vbnewline:tempsite=tempsite & "<loc>"& weburl&webdir & urls &"</loc>"&vbnewline:tempsite=tempsite & "<changefreq>"&changefreq&"</changefreq>"&vbnewline:tempsite=tempsite & "</url>"&vbnewline:nodesite=tempsite:End Function:Sub replacestr():SoonBiz.adhead:SoonBiz.nstate("批量替换"):Response.Write "<form method=""post"" action=""?act=doreplacestr"">":Response.Write "原字符:<textarea id=""text1"" name=""text1"" rows=""3"" cols="""" class=""inputtext""></textarea>":Response.Write "<p></p>":Response.Write "替换为:<textarea id=""text2"" name=""text2"" rows=""3"" cols="""" class=""inputtext""></textarea>":Response.Write "<p></p><input type=""checkbox"" id="""" name=""class"" value=""1"" />替换分类表 <input type=""checkbox"" id="""" name=""article"" value=""1"" />替换内容表 <input type=""checkbox"" id="""" name=""template"" value=""1"" />替换模板表 ":Response.Write "<div class=""operate""><input type=""submit"" value=""执行替换"" /></div>":Response.Write "</form>":Dim omsg:omsg="<li>批量替换将替换内容表和模板表中的字符</li><li>批量替换前请做好数据库备份,以防替换错误</li><li>利用批量替换可以转换数据库中的图片路径</li><li>数据量大时替换会花费较长时间,在此期间请不要关闭浏览器</li>":SoonBiz.ostate(omsg):End Sub:Sub doreplacestr() :Dim text1,text2:Dim rs,sql,arrs,i,j:Dim tempstr:text1=Trim(Request.Form("text1")):text2=Trim(Request.Form("text2"))
If SoonBiz.rid("class")=1 Then ReplaceClass text1,text2'%+manyget'::::':should:canoutother::"
If SoonBiz.rid("article")=1 Then ReplaceArticle text1,text2
If SoonBiz.rid("template")=1 Then ReplaceTemplate text1,text2
SoonBiz.Loadstyle():SoonBiz.LoadClass():SoonBiz.loadcachenum(0):SoonBiz.AdSuccess("转换成功"):End Sub:Sub ReplaceClass(text1,text2):Dim rs,arrs,i:Set rs=SoonBiz.execute("select id,preimg,title,readme from "& sheethead &"_class")
If Not rs.eof Then
arrs=rs.getrows(-1)
Else:arrs=""':bysinceit:::are::;each:":most'ishow
End If:Rs.Close:Set Rs=Nothing
If isarray(arrs) Then
Server.ScriptTimeOut=99999999:For i=0 To ubound(arrs,2):arrs(1,i)=replace(arrs(1,i)&"",text1,text2):arrs(2,i)=replace(arrs(2,i)&"",text1,text2):arrs(3,i)=replace(arrs(3,i)&"",text1,text2):SoonBiz.execute("update "& sheethead &"_class set preimg='"& SoonBiz.Checkstr(arrs(1,i)) &"',title='"& SoonBiz.Checkstr(arrs(2,i)) &"',readme='"& SoonBiz.Checkstr(arrs(3,i)) &"' where id="&arrs(0,i)):Next
End If:End Sub:Sub ReplaceArticle(text1,text2):Dim rs,arrs,i:Set rs=SoonBiz.execute("select id,preimg,content,title,readme from "& sheethead &"_article")
If Not rs.eof Then
arrs=rs.getrows(-1)'"still:they:at:":all:see^mightcouldatme:)
Else:arrs=""
End If:Rs.Close:Set Rs=Nothing
If isarray(arrs) Then
Server.ScriptTimeOut=99999999:For i=0 To ubound(arrs,2):arrs(1,i)=replace(arrs(1,i)&"",text1,text2):arrs(2,i)=replace(arrs(2,i)&"",text1,text2):arrs(3,i)=replace(arrs(3,i)&"",text1,text2):arrs(4,i)=replace(arrs(4,i)&"",text1,text2):SoonBiz.execute("update "& sheethead &"_article set preimg='"& SoonBiz.Checkstr(arrs(1,i)) &"',content='"& SoonBiz.Checkstr(arrs(2,i)) &"',title='"& SoonBiz.Checkstr(arrs(3,i)) &"',readme='"& SoonBiz.Checkstr(arrs(4,i)) &"' where id="&arrs(0,i)):Next
End If:End Sub:Sub ReplaceTemplate(text1,text2):Dim rs,sql,i,tempstr:Set rs=SoonBiz.execute("select * from "& sheethead &"_style")
If Not rs.eof Then'mustbecauseis::gothere'hisnowthisme(bebeenanydid::
Server.ScriptTimeOut=99999999:Do While Not rs.eof:tempstr=rs("str")&"":tempstr=Replace(tempstr,text1,text2):sql="update "& sheethead &"_style set str='"& SoonBiz.checkstr(tempstr) &"' where id=" & rs(0):SoonBiz.execute(sql):rs.movenext:loop:Rs.close:set Rs=nothing
End If:End Sub:Sub backupmdb() :SoonBiz.title="备份数据库":SoonBiz.adhead:SoonBiz.nstate("备份数据库")
if IsSqlDataBase=1 then
SQLUserReadme
else:Response.Write "<form method=""post"" action=""?act=dobackup"">":Response.Write "<table class=tableborder1 cellspacing='1'>":Response.Write "<tr>":Response.Write " <td width=""200"" align=""right"">备份目录：</td>":Response.Write " <td><input type=""text"" size=""30"" value="""& webdir & admindir &"backup/"" readonly=""readonly""></td>":Response.Write " <td></td>":Response.Write "</tr>":Response.Write "<tr>":Response.Write " <td align=""right"">备份名称:</td>":Response.Write " <td><input type=""text"" size=""30"" name=""bkDBname"" value="""&SoonBiz.Format_Time(Now,7)&"_bak.asp""></td>":Response.Write " <td>如有同名文件，将覆盖</td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input name=""submit"" type=""submit"" value="" 开始备份 "" id=""submitbackup"" /></td>":Response.Write "</form>"
If Not SoonBiz.ChkObjInstalled(FsoObjName) Then''that::\asbut}take::make`'our+aboutlikehe
Response.Write "<b><font color=red>您的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>":Response.Write "<script type=""text/javascript"">getobj('submitbackup').style.disabled=true;</script>"
end if
end if:End Sub:Sub dobackup():dim bkfolder,bkdbname,fso:bkfolder=webdir & admindir & "backup":bkDBname=SoonBiz.RequestStr("备份文件名称","bkDBname","post",1,1,50,30,1):ShowErr(""):bkfolder=server.MapPath(bkfolder):Set Fso=server.createobject(FsoObjName):fso.copyfile server.mappath(db),bkfolder & "/" & bkdbname:Set fso=Nothing:SoonBiz.adsuccess("备份成功"):End Sub:Sub mdb()
if IsSqlDataBase=1 Then
SoonBiz.adhead:SQLUserReadme
Else:Dim Fso:Set Fso=server.createobject(FsoObjName):dim theFolder,theFile,strFileType''come::didmuch:beingtherebe:'over&between/nowafterthe
if Not fso.FolderExists(Server.MapPath(webdir&admindir&"backup")) then
ShowErr("找不到数据库备份文件夹（"&DataBackPath&"）")
end if:Set theFolder=fso.GetFolder(Server.MapPath(webdir&admindir&"backup")):SoonBiz.adhead:SoonBiz.title="恢复数据库":SoonBiz.nstate("恢复数据库"):Response.Write "<br />":Response.Write "<table cellspacing=""1"" class=""tableborder1"">":Response.Write " <tr>":Response.Write " <th width=*>文 件 名</th>":Response.Write " <th width=150>文件大小</th>":Response.Write " <th width=120>修改时间</th>":Response.Write " <th width=120>操作</th>":Response.Write " </tr>":For Each theFile In theFolder.Files:Response.Write "<tr>":Response.Write " <td>"& theFile.name &"</td>":Response.Write " <td>"& round(theFile.size/1024) &"K</td>":Response.Write " <td>"& theFile.DateLastModified &"</td>":Response.Write " <td align=center><a href=""?act=restoremdb&id="& server.urlencode(theFile.name) &""">恢复</a>￤<a href=""?act=delmdb&id="& server.urlencode(theFile.name) &""">删除</a></td>":Response.Write "</tr>":Next:Response.Write "</table>"
End If:End Sub:Sub restoremdb():dim fso:Set Fso=server.createobject(FsoObjName):fso.copyfile Server.mappath(webdir&admindir&"backup/"&request.QueryString("id")),Server.mappath(db):Set Fso=Nothing:SoonBiz.adsuccess("恢复成功,请清除全部缓存数据."):End Sub:Sub delmdb():SoonBiz.DelFile(webdir&admindir&"backup/"&request.QueryString("id")):SoonBiz.ok:End Sub:sub SQLUserReadme():SoonBiz.LoadTemplatesAdmin("admin_server"):Response.Write template.html(1):end sub:Sub changepath() :SoonBiz.adhead:SoonBiz.nstate("转换按装路径"):Response.Write "<form method=""post"" action=""?act=dochangepath"">":Response.Write "<p><input type=""text"" id="""" name=""path1"" /> 原路径</p>":Response.Write "<p><input type=""text"" id="""" name=""path2"" value="""& webdir &""" /> 当前路径</p>":Response.Write "<p><input type=""submit"" value=""提交"" /></p>":Response.Write "</form>":SoonBiz.ostate ("<li>程序默认按装在网站根目录下,如果装在其它目录,会出现图片,下载无法找到的情况.转换路径可以把有前的文件地址改成当前路径.转换前请做好数据库备份</li><li>程序默认按装路径是/</li>"):End Sub:Sub dochangepath() :Dim path1,path2:Dim arrs,i,rs,sql:Dim str,str2:path1=SoonBiz.RequestStr("原路径","path1","post",1,1,50,30,1):path2=SoonBiz.RequestStr("当前路径","path2","post",1,1,50,30,1):ShowErr(""):Set rs=SoonBiz.execute("select id,preimg from "& sheethead &"_channel"):arrs=rs.getrows(-1):Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrs,2):str=arrs(1,i)&"":str=Replace(str,path1&"images/",path2&"images/"):str=Replace(str,path1&"userup/",path2&"userup/"):SoonBiz.execute("update "& sheethead &"_channel set preimg='"& SoonBiz.Checkstr(str) &"' where id="&arrs(0,i)):Next:Set rs=SoonBiz.execute("select id,preimg from "& sheethead &"_class"):arrs=rs.getrows(-1):Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrs,2):str=arrs(1,i)&"":str=Replace(str,path1&"images/",path2&"images/"):str=Replace(str,path1&"userup/",path2&"userup/"):SoonBiz.execute("update "& sheethead &"_class set preimg='"& SoonBiz.Checkstr(str) &"' where id="&arrs(0,i)):Next:Set rs=SoonBiz.execute("select * from "& sheethead &"_style"):Do While Not rs.eof:str=rs("str")&"":str=Replace (str,"src="& path1 & "images/","src=images/",1,-1,1):str=Replace (str,"src="& chr(34) & path1 & "images/","src="& chr(34) & path2 &"images/",1,-1,1):str=Replace (str,"src="& chr(39) & path1 & "images/","src="& chr(39) & path2 &"images/",1,-1,1):str=Replace (str,"src="& path1 & "userup/","src=images/",1,-1,1):str=Replace (str,"src="& chr(34) & path1 & "userup/","src="& chr(34) & path2 &"userup/",1,-1,1):str=Replace (str,"src="& chr(39) & path1 & "userup/","src="& chr(39) & path2 &"userup/",1,-1,1):sql="update "& sheethead &"_style set str='"& SoonBiz.checkstr(str) &"' where id=" & rs(0):SoonBiz.execute(sql):rs.movenext:loop:Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select id,preimg,content from ["& sheethead &"_article]"):arrs=rs.getrows(-1):Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrs,2):str=arrs(1,i)&"":str=Replace(str,path1&"images/",path2&"images/"):str=Replace(str,path1&"userup/",path2&"userup/"):str2=arrs(2,i)&"":str2=Replace (str2,"src="& path1 & "images/","src=images/",1,-1,1):str2=Replace (str2,"src="& chr(34) & path1 & "images/","src="& chr(34) & path2 &"images/",1,-1,1):str2=Replace (str2,"src="& chr(39) & path1 & "images/","src="& chr(39) & path2 &"images/",1,-1,1):str2=Replace (str2,"src="& path1 & "userup/","src=images/",1,-1,1):str2=Replace (str2,"src="& chr(34) & path1 & "userup/","src="& chr(34) & path2 &"userup/",1,-1,1):str2=Replace (str2,"src="& chr(39) & path1 & "userup/","src="& chr(39) & path2 &"userup/",1,-1,1):SoonBiz.execute("update "& sheethead &"_article set preimg='"& SoonBiz.Checkstr(str) &"',content='"& SoonBiz.Checkstr(str2) &"' where id="&arrs(0,i)):Next:Set rs=SoonBiz.execute("select id,ufilename from "& sheethead &"_uplist")
If Not rs.eof Then
arrs=rs.getrows(-1)'couldontheirover:[himothersame:an[~:eachmake:":
Else:arrs=""
End If:Rs.Close:Set Rs=Nothing
If isarray(arrs) Then
For i=0 To ubound(arrs,2):str=arrs(1,i)&"":str=Replace(str,path1&"images/",path2&"images/"):str=Replace(str,path1&"userup/",path2&"userup/"):SoonBiz.execute("update "& sheethead &"_class set preimg='"& SoonBiz.Checkstr(str) &"' where id="&arrs(0,i)):Next
End If:SoonBiz.loadchannel:SoonBiz.Loadstyle():SoonBiz.LoadClass():SoonBiz.loadcachenum(0):SoonBiz.AdSuccess("转换成功"):End Sub:Sub editsheet():SoonBiz.adhead:SoonBiz.title="修改数据库表名前缀":SoonBiz.nstate("修改数据库表名前缀"):Response.Write "<form method=""post"" action=""?act=doeditsheet"">":Response.Write "<b>修改说明</b><br />":Response.Write "<p>这是一项安全设置,对于开放源码的程序,外界很容易知道数据库表的名称,如果发现其它漏洞,可以对数据库进行注入攻击.修改表名前缀后,外界就不知道当前数据库表名了,从而无法进行攻击.</p>":Response.Write "<p>修改后,请用记事本打开conn.asp,修改sheethead的值为新表名前缀.</p>":Response.Write "<input type=""text"" id="""" name=""sheetname"" value="""& sheethead &""" /> 请输入新表名前缀":Response.Write "<input type=""submit"" value=""提交"" />":Response.Write "</form>":End Sub:Sub doeditsheet():Dim sheetname:sheetname=SoonBiz.RequestStr("表名前缀","sheetname","post",1,2,10,40,1):ShowErr("")
If IsSqlDataBase=0 Then'herecamecanbetweenhave)andget~about|mostbutfor?theyanother::
Dim MyTableName:Dim MyFieldName:Dim tablename,newtablename:Dim MyDB:set mydb=server.createobject("adox.catalog"):Dim MyTable:set mytable=server.createobject("adox.table"):Dim MyField:set myfield=server.createobject("adox.column"):Dim pro:SoonBiz.ConnectionDatabase:MyDB.ActiveConnection=conn:For Each MyTable In MyDB.Tables:tablename=MyTable.Name
If instr(tablename,sheethead)>0 Then
newtablename=Replace(tablename,sheethead,sheetname):MyTable.Name=newtablename
End If:Next:Set mydb=Nothing:Set mytable=Nothing:Set myfield=Nothing:SoonBiz.adsuccess("修改成功")
Else:Dim rs,i,TableList:Set rs=SoonBiz.execute("select name from sysobjects where type='U'"):Do While Not rs.eof:TableList=TableList & (rs(0)) & ",":rs.movenext:loop:Rs.Close:Set Rs=Nothing:TableList=left(TableList,len(TableList)-1):TableList=split(TableList,","):For i=0 To ubound(TableList):SoonBiz.execute("EXEC sp_rename '"& TableList(i) &"', '"& replace(TableList(i),sheethead,sheetname) &"'"):Next:SoonBiz.adsuccess("修改成功!")
End If:End Sub:Sub zipmdb():SoonBiz.title="在线压缩数据库":SoonBiz.adhead:SoonBiz.nstate("在线压缩数据库")'ifalsostillhisaremy%hashad]]then:'since"same'have
if IsSqlDataBase=1 then
SQLUserReadme
End If
If SoonBiz.ChkObjInstalled(FsoObjName)=False Then
ShowErr("当前服务器不支持"&FsoObjName&",无法进行压缩")
End If:Response.Write "<p>压缩前，建议先备份数据库，以免发生意外错误</p>":Response.Write "<p><a href=""?act=dozipmdb"">点击这里压缩</a></p>":End Sub:Sub Dozipmdb():Dim fso, Engine, strDBPath:strDBPath=left(db,instrrev(db,"/")):Set fso=Server.CreateObject(FsoObjName):Set Engine=CreateObject("JRO.JetEngin"):Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(db)," Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(strDBPath) & "/temp.mdb":fso.CopyFile server.mappath(strDBPath) & "/temp.mdb",server.mappath(db):fso.DeleteFile(server.mappath(strDBPath) & "/temp.mdb"):Set fso=Nothing:Set Engine=Nothing:SoonBiz.adsuccess("压缩成功"):End Sub:Sub calculatenum() :SoonBiz.adhead:SoonBiz.nstate("重新统计记录数"):Response.Write "<p>":Response.Write "<a href=""?act=dorecount"">点击这里重新统计各频道和分类下的记录数</a>":Response.Write "</p>":End Sub:Sub dorecount:Dim rs,arrs,i,j:Dim thecount,todaynum:Dim idlist:Dim idnext:Set rs=SoonBiz.execute("select count(*),cid from "& sheethead &"_article where ispass=1 and isdel=0 group by cid"):Do While Not rs.eof:SoonBiz.execute("update "& sheethead &"_channel set cha_count="& rs(0) &" where id="&rs(1)):rs.movenext:Loop:Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select id,cid,depth from "& sheethead &"_class")'takehedoandsaidnever:their:":=inlike::*on.
If rs.eof Then
ShowErr("还没有分类")
Else:arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrs,2) :idlist="":thecount=0
If arrs(1,i)=7 Then 
If clng(arrs(2,i))=1 Then ':'there:"came=:thanthesome#himbeforehimself"myanyor
Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_message where ispass=1 and isdel=0 and classid="&arrs(0,i)):thecount=rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_remessage where ispass=1 and isdel=0 and classid="&arrs(0,i)):thecount=thecount+rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_message where ispass=1 and isdel=0 and classid="& arrs(0,i) &" and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &")=0"):todaynum=rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_remessage where ispass=1 and isdel=0 and classid="&arrs(0,i)&" and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &")=0"):todaynum=todaynum+rs(0):Rs.Close:Set Rs=Nothing:SoonBiz.execute("update "& sheethead &"_class set postnum="&thecount&",todaynum="& todaynum &" where id="&arrs(0,i))
End If
Else :idlist=arrs(0,i):idnext="":Set rs=SoonBiz.execute("select id from "& sheethead &"_class where pid="&arrs(0,i))
If Not rs.eof Then
idnext=rs.GetString(, , "", ",", ""):idlist=idnext & idlist
End If:Rs.Close:Set Rs=Nothing'suchthesemust"or}::of::out:'@!into\#
If len(idnext)>0 Then 
Set rs=SoonBiz.execute("select id from "& sheethead &"_class where pid in("& idnext &")")
If Not rs.eof Then
idlist=rs.GetString(, , "", ",", "") & idlist
End If:Rs.Close:Set Rs=Nothing
End If'{hadthemboththanfromin:$thenonly::been@.beforeafterif
If len(idlist)>0 Then
Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_article where isdel=0 and ispass=1 and classid in("& idlist &")"):thecount=rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select count(*) from "& sheethead &"_article where isdel=0 and ispass=1 and classid in("& idlist &") and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &")=0"):todaynum=rs(0):Rs.Close:Set Rs=Nothing
End If:SoonBiz.execute("update "& sheethead &"_class set postnum="& thecount &",todaynum="& todaynum &" where id="&arrs(0,i))
End If:Next:SoonBiz.loadclass:SoonBiz.Loadcachenum(0) :SoonBiz.adsuccess("统计成功"):End Sub:Sub makemap():Dim rs,arrs,i,j:Dim crrs:Dim yilin,shujun:Set rs=SoonBiz.execute("select id,cha_name,cha_url from "& sheethead &"_channel order by cha_cls asc,id asc where cha_use=1 and cha_show=1"):arrs=rs.getrows(-1):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select id,cid,readurl,title from "& sheethead &"_class order by treeid asc,id asc")
If Not rs.eof Then
crrs=rs.getrows(-1)'more:|alsoherseemore'for%+manyget'::::'
Else:crrs=""
End If:Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrs,2):shujun="":yilin=yilin & "<ul class=channel>":yilin=yilin & "<li><a href='"& cha_url &"?u="& arrs(0,i) &"'>"& arrs(1,i) &"</a></li>":For j=0 To ubound(crrs,2)
If crrs(1,j)=arrs(0,i) Then
shujun=shujun & "<li><a href='"& crrs(2,j) &"?u="& crrs(1,j) &"w"& crrs(0,j) &"'>"& crrs(3,j) &"</a>"
End If:Next
If len(shujun)>0 Then':should:canoutother::":bysinceit:::are::
yilin=yilin & "<ul class='class'>"& shujun &"</ul>"
End If:Next:Response.Write yilin:End Sub
%>