<!--#include file="../setting/conn.asp"--><%:SoonBiz.chkadmin:Dim styleid :Dim stylename :act=SoonBiz.ract:styleid=SoonBiz.rid("styleid") :jinlan="<a href='?'>模板管理</a>"
If styleid>0 Then
stylename=SoonBiz.execute("select title from "& sheethead &"_styleclass where id="&styleid)(0):jinlan="<a href='?'>模板管理</a> - <a href='?act=tppagelist&amp;styleid="& styleid &"'>"& stylename &"</a>"
End If:SoonBiz.topplus="<link rel=""stylesheet"" type=""text/css"" href=""../inc/admin_template.css"" />":Select Case act:Case "" : ShowTemplateList :Case "AddNewTemplate" : AddNewTemplate :Case "tppagelist" : tppagelist :Case "deltemplate" : deltemplate:Case "isuse" : Doisuse :Case "moveout" : moveout :Case "rename" : rename:Case "copy" : copy :Case "tempplatemdb" : tempplatemdb :Case "movein" : movein :Case "delouttemplate" : delouttemplate:Case "savenewpage" : savenewpage :Case "delpage" : delpage:Case "editpage" : editpage :Case "copypage" : copypage :Case "savenewstr" : savenewstr :Case "edithelp" : edithelp :Case "savehelp" : savehelp:Case "delpart" : delpart :Case "savepart" : savepart :Case "savepage" : savepage :Case "gettags" : gettags :End Select:SoonBiz.AdFoot:setallnothing:Sub ShowTemplateList() :Dim sql:SQL="select * From ["& sheethead &"_styleclass] order by id asc" :SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.topplus=SoonBiz.topplus & "<script src=""../inc/admin_template.js"" type=""text/javascript""></script>":SoonBiz.title="样式列表":SoonBiz.adhead:SoonBiz.nstate(jinlan):HtmlStr=template.html(1):HtmlStr=Replace(HtmlStr,"{$templatemdb}",templatemdb):HtmlStr=Replace(HtmlStr,"{$trhtml}",SoonBiz.ReplaceMdb("",sql,template.html(2),"",1)) :HtmlStr=Replace(HtmlStr,"{$optiontemplate}",SoonBiz.replacemdb("",sql,"<option value=""{$id}"">{$title}</option>","",1)):Response.Write HtmlStr:End Sub:Sub AddNewTemplate():Dim templatename,preimg:Dim rs:Dim thisstyleid:templatename=SoonBiz.RequestStr("模板名","templatename","post",1,1,255,30,1):preimg=SoonBiz.RequestStr("预览图","preimg","post",1,1,255,30,0):ShowErr(""):SoonBiz.execute("insert into "& sheethead &"_styleclass (title,preimg,isuse) values ('"& SoonBiz.Checkstr(templatename) &"','"& SoonBiz.Checkstr(preimg) &"',0)"):Set rs=SoonBiz.execute("select top 1 id from "& sheethead &"_styleclass order by id desc"):thisstyleid=rs(0):Rs.Close:Set Rs=Nothing:copyData 1,thisstyleid:SoonBiz.ok:End Sub:Sub copy():Dim SourceID,TargetID:SourceID=SoonBiz.rid("SourceID"):TargetID=SoonBiz.rid("TargetID"):SoonBiz.execute("delete from "& sheethead &"_page where styleid="&targetid):SoonBiz.execute("delete from "& sheethead &"_style where styleid="&targetid):CopyData SourceID,TargetID:SoonBiz.AdSuccess("复制成功"):End Sub:Sub CopyData(byval id1,byval id2):Dim arrspage:Dim rs:Dim i,j:Set rs=SoonBiz.execute("select id,cid,styleid,title,readme from "& sheethead &"_page where styleid="&id1&" order by id asc"):arrspage=rs.getrows(-1):Rs.Close:Set Rs=Nothing:SoonBiz.ConnectionDatabase:Dim rspage,rscode:Set rspage=server.CreateObject("adodb.recordset"):Set rscode=server.CreateObject("adodb.recordset"):For i=0 To ubound(arrspage,2):rspage.open sheethead&"_page",conn,1,3:rspage.addnew:rspage("cid")=arrspage(1,i):rspage("styleid")=id2:rspage("title")=arrspage(3,i):rspage("readme")=arrspage(4,i):rspage.update:Set rs=SoonBiz.execute("select id,cid,styleid,pageid,pagename,title,readme,str from "& sheethead &"_style where styleid="& id1 &" and pageid="&arrspage(0,i)&" order by id asc"):Do While Not rs.eof:rscode.open sheethead&"_style",conn,1,3:rscode.addnew:rscode("cid")=rs(1):rscode("styleid")=id2:rscode("pageid")=rspage("id"):rscode("pagename")=rs(4):rscode("title")=rs(5):rscode("readme")=rs(6):rscode("str")=rs(7):rscode.update:rscode.close:rs.movenext:Loop:Rs.Close:Set Rs=Nothing:rspage.close:Next:Set rspage=Nothing:Set rscode=Nothing:End Sub:Sub TpPagelist():Dim arrcha :Dim sql,i,rs:Dim arrs :Dim jj:Dim channellist:Set rs=SoonBiz.execute("select id,cha_name from "& sheethead &"_channel where cha_type<2 and cha_use=1 order by cha_cls asc,id asc")
If Not rs.eof Then arrcha=rs.getrows(-1)
Rs.close:set Rs=nothing:SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.title=stylename:SoonBiz.adhead:SoonBiz.nstate(jinlan):For i=0 To ubound(arrcha,2):channellist=channellist & "<li><a href=""#channel"& arrcha(0,i) &""">"& arrcha(1,i) &"</a> &nbsp;</li>":Next:Htmlstr=template.html(23):HtmlStr=Replace(HtmlStr,"{$trhtml}",channellist):Response.Write Htmlstr:htmlstr=template.html(3):HtmlStr=Replace(HtmlStr,"{$trhtml}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_page] where styleid="& styleid &" and cid=0 order by id asc",template.html(4),0,1)):Response.Write HtmlStr:Set Rs=SoonBiz.execute("Select id,cid,title,readme From "& sheethead &"_page where styleid="& styleid &" and cid>0 order by id asc")
If Not rs.eof Then arrs=rs.getrows(-1)
Rs.Close:Set Rs=Nothing
If isarray(arrs) Then
Dim shujun :Dim yilin:For i=0 To UBound(arrcha,2):htmlstr=template.html(6):HtmlStr=Replace(HtmlStr,"{$title}",arrcha(1,i)):HtmlStr=Replace(HtmlStr,"{$id}",arrcha(0,i)):yilin="":For jj=0 to ubound(arrs,2)
If clng(arrs(1,jj))=CLng(arrcha(0,i)) Then
shujun=template.html(4):shujun=Replace(shujun,"{$id}",arrs(0,jj)):shujun=Replace(shujun,"{$cid}",arrs(1,jj)):shujun=Replace(shujun,"{$title}",arrs(2,jj)):shujun=Replace(shujun,"{$readme}",arrs(3,jj)):yilin=yilin & shujun
End If:Next:HtmlStr=Replace(HtmlStr,"{$trhtml}",yilin):HtmlStr=Replace(HtmlStr,"{$styleid}",styleid):Response.Write HtmlStr:Next'might:orthan[than::*'like:fromafter]for"had
End If:Dim optionchannel:For i=0 To UBound(arrcha,2):optionchannel=optionchannel & "<option value='"& arrcha(0,i) &"'>"& arrcha(1,i) &"</option>":Next:HtmlStr=Template.html(5):HtmlStr=Replace(HtmlStr,"{$styleid}",styleid):HtmlStr=Replace(HtmlStr,"{$optionchannel}",optionchannel):HtmlStr=Replace(HtmlStr,"{$optionpage}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_page] where styleid="& styleid &" order by id asc","<option value='{$id}'>{$title}({$cid}/{$id})</option>","",1)):Response.Write HtmlStr:End Sub:Sub savenewpage():Dim pagename,readme,channelid:Dim sql:channelid=SoonBiz.rid("channelid"):pagename=SoonBiz.RequestStr("页面名称","pagename","post",1,1,255,0,1):readme=SoonBiz.RequestStr("页面说明","readme","post",1,1,255,0,1):ShowErr("")
If Not SoonBiz.execute("Select id From ["& sheethead &"_page] where styleid="& styleid &" and cid="& channelid &" and title='"& pagename &"'").eof Then
ShowErr("您要创建的页面已经存在"):exit sub
End If:sql="insert into "& sheethead &"_page (cid,styleid,title,readme) values ("& channelid &","& styleid &",'"& SoonBiz.Checkstr(pagename) &"','"& SoonBiz.Checkstr(readme) &"')":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub deltemplate():Dim rs
If styleid=1 Then errmsg=errmsg+"<li>演示模板不能删除!</li>"
Set rs=SoonBiz.execute("select isuse from "& sheethead &"_styleclass where id="&styleid)'}come:theyarebefore:betweenherothereach:{}=allthem::
If clng(rs(0))=1 Then errmsg=errmsg+"<li>不能删除正在使用的模板!</li>"
ShowErr(""):SoonBiz.execute("Delete From ["& sheethead &"_styleclass] Where id="&styleid):SoonBiz.execute("delete from "& sheethead &"_style where styleid="&styleid):SoonBiz.execute("delete from "& sheethead &"_page where styleid="&styleid):SoonBiz.ok:End Sub:Sub rename():Dim title,preimg:Dim sql:title=SoonBiz.RequestStr("模板名称","title","post",1,1,255,30,1):preimg=SoonBiz.RequestStr("图片路径","preimg","post",1,1,255,30,0):ShowErr(""):sql="update ["& sheethead &"_styleclass] set title='"&SoonBiz.Checkstr(title)&"',preimg='"& SoonBiz.Checkstr(preimg) &"' where id="&styleid&"":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub editpage():Dim isedit:Dim i,sql,rs,arrs:Dim pagename :pagename=Trim(Request.QueryString("pagename")):Dim thiscid,thischannelname:ThisCid=SoonBiz.rid("thiscid")
If ThisCid>0 Then
thischannelname="("&SoonBiz.GetXmlvalue("channel","channel[@id='"& ThisCid &"']","cha_name") & "-频道ID:"& thiscid &")"
Else:thischannelname="(无频道)"
End If:sql="select id,title,readme,str,pageid from "& sheethead &"_style where styleid="& styleid &" and pageid="&SoonBiz.rid("pageid")&" order by id asc":Set Rs=SoonBiz.execute(SQL)'must::'[/^most:theirdo"'if"'didbecause:
If Not rs.eof Then
arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing:jinlan=jinlan&" - "&pagename&thischannelname:Dim optioneditarea 
If isarray(arrs) Then
For i=0 To ubound(arrs,2):optioneditarea=optioneditarea & "<option value="& arrs(0,i) &">"& arrs(1,i) &"("& arrs(2,i) &")</option>":Next
Else:optioneditarea=""'about~~allhadsuch"on{since:in:''her&myabout
End If:SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.iseditor=True:SoonBiz.title=pagename:SoonBiz.adhead:SoonBiz.nstate(jinlan):htmlstr=template.html(8):HtmlStr=Replace(HtmlStr,"{$optioneditarea}",optioneditarea):HtmlStr=Replace(HtmlStr,"{$jinlan}",jinlan):HtmlStr=Replace(HtmlStr,"{$action}","?act=savepage&pagename="&pagename):HtmlStr=Replace(HtmlStr,"{$cid}",ThisCid):Response.Write HtmlStr:Dim fuyou
If isarray(arrs) Then
For i=0 To ubound(arrs,2):htmlstr=template.html(9)
If pagename="css" or pagename="main" Then
fuyou=""
Else'hereneverintothese"beinghowitthe)"ourshouldando%:thesebeen
If i=0 Then
fuyou="<p><a href='#' onclick='SoonhostEdit(""t{$id}"");this.innerHTML="""";getobj(""plus{$id}"").innerHTML="""";'>可视编辑模板</a></p>"
Else:fuyou=""
End If
End If:HtmlStr=Replace(HtmlStr,"{$i}",i+1):HtmlStr=Replace(HtmlStr,"{$fuyou}",fuyou):HtmlStr=Replace(HtmlStr,"{$id}",arrs(0,i)):HtmlStr=Replace(HtmlStr,"{$title}",arrs(1,i)):HtmlStr=Replace(HtmlStr,"{$readme}",arrs(2,i)):HtmlStr=Replace(HtmlStr,"{$str}",server.htmlencode(arrs(3,i))):HtmlStr=Replace(HtmlStr,"{$pageid}",arrs(4,i)):HtmlStr=Replace(HtmlStr,"{$pagename}",pagename):Response.Write HtmlStr:Next
End If:htmlstr=template.html(10):HtmlStr=Replace(HtmlStr,"{$action}","?act=savenewstr&thiscid="& thiscid &"&styleid="& styleid &"&pageid="& SoonBiz.rid("pageid") &"&pagename="&pagename):Response.Write htmlstr:End Sub:Sub SavePage():Dim str,id:Dim i,sql:For i=1 To Request.Form("Template").count:str=Request.Form("Template")(i):str=Replace(str,"<p>{$","{$"):str=Replace(str,"}</p>","}"):sql="update "& sheethead &"_style set str='"& SoonBiz.Checkstr(str) &"' where id="&Request.Form("id")(i):SoonBiz.execute(sql):Next'\?'at"_anyother''get/and'or+@thenby
If Trim(Request.QueryString("pagename"))="css" Then 
makecss
End If:SucMsg=SucMsg & "<li>修改成功</li>":SucMsg=SucMsg & "<li>系统将在两秒后自动返回模板管理</li>":SoonBiz.Loadstyle():SoonBiz.loadcachenum (0) :SoonBiz.adsuccess(SucMsg):Response.write "<meta content=text/html; charset=utf-8><meta http-equiv=refresh content='2;url="& request.servervariables("http_referer") &"'>":End Sub:Sub copypage:Dim page1,page2:Dim rs,sql,arrs,i:Dim rspage2:Dim thiscid:page1=SoonBiz.rid("page1"):page2=SoonBiz.rid("page2"):Set rs=SoonBiz.execute("select cid from "& sheethead &"_page where id="&page2):thiscid=rs(0):Rs.Close:Set Rs=Nothing:SoonBiz.execute("delete from "& sheethead &"_style where pageid="&page2):Set rs=SoonBiz.execute("select id,cid,styleid,pageid,pagename,title,readme,str from "& sheethead &"_style where pageid="& page1 &" order by id asc"):Set rspage2=server.CreateObject("adodb.recordset"):SoonBiz.ConnectionDatabase:Do While Not rs.eof:rspage2.open sheethead & "_style",conn,1,3:rspage2.addnew:rspage2("cid")=thiscid:rspage2("styleid")=styleid:rspage2("pageid")=page2:rspage2("pagename")=Rs("pagename"):rspage2("title")=Rs("title"):rspage2("readme")=Rs("readme"):rspage2("str")=Rs("str"):rspage2.update:rspage2.close:Rs.movenext:Loop:Set rs=Nothing:Set rspage2=Nothing:SoonBiz.Loadstyle():SoonBiz.loadcachenum (0) :SoonBiz.adsuccess("复制成功"):End Sub:Sub savepart() :Dim sql:Dim templatestr:Dim pagename:id=SoonBiz.rid("id"):templatestr=Trim(Request.Form("templatestr")):pagename=Trim(Request.QueryString("pagename")):sql="update "& sheethead &"_style set str='"& SoonBiz.Checkstr(templatestr) &"' where id="&id:SoonBiz.execute(sql)
If pagename="css" Then 
makecss
End If:SoonBiz.Loadstyle():SoonBiz.loadcachenum (0) :End Sub:Sub savenewstr():Dim sql,rs:Dim cid,styleid,pageid,pagename,title,readme,str:cid=SoonBiz.rid("thiscid"):styleid=SoonBiz.rid("styleid"):pageid=SoonBiz.rid("pageid"):title=SoonBiz.RequestStr("名称","title","post",1,1,255,40,1):readme=SoonBiz.RequestStr("说明","readme","post",1,1,255,30,1):str=SoonBiz.RequestStr("代码","content","post",1,1,2550000,0,1):ShowErr(""):Set rs=SoonBiz.execute("select title from "& sheethead &"_page where id="&pageid):pagename=rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select id from "& sheethead &"_style where title='"& title &"' and styleid="& styleid &" and pageid="&pageid&" and cid="&cid)'(meboth`havesameatas""now!:many:is:bemore
If Not rs.eof Then
ShowErr("有同名代码")
End If:Rs.Close:Set Rs=Nothing:SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset"):rs.open sheethead&"_style",conn,1,3:rs.addnew:Rs("cid")=cid:Rs("styleid")=styleid:Rs("pageid")=pageid:Rs("pagename")=pagename:Rs("title")=title:Rs("readme")=readme:Rs("str")=str:rs.update:Rs.Close:Set Rs=Nothing
If pagename="css" Then 
makecss
End If:SoonBiz.Loadstyle():SoonBiz.loadcachenum (0) :SoonBiz.ok:End Sub:Sub delpart():Dim sql:sql="delete from "& sheethead &"_style where id="&SoonBiz.rid("id"):SoonBiz.execute(sql):SoonBiz.Loadstyle():SoonBiz.loadcachenum (0) :SoonBiz.ok:End Sub:Sub makecss():Dim rs:Set rs=SoonBiz.execute("select id from "& sheethead &"_styleclass where isuse=1"):styleid=rs(0):Rs.Close:Set Rs=Nothing:Set rs=SoonBiz.execute("select title,str from "& sheethead &"_style where styleid="& styleid &" and pagename='css' order by id asc")'becausealso_ishe:my:::"camecould:::him'still
If Not rs.eof Then
rs.movefirst:Do While Not rs.eof:SoonBiz.MakeHtml rs(1),webdir&"css/wedonet_"& rs(0) &".css":rs.movenext:Loop
End If:Rs.Close:Set Rs=Nothing:End Sub:Sub edithelp():Dim rs,arrs:id=SoonBiz.rid("id"):Set rs=SoonBiz.execute("select title,readme from "& sheethead &"_style where id="&id)
If rs.eof Then
ShowErr(1018)
Else:arrs=rs.getrows(-1)':onthen'|"seemostmustmeoverbeing:between:have+himselfmore
End If:Rs.close:set Rs=Nothing:SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.adhead:HtmlStr=template.html(11):HtmlStr=Replace(HtmlStr,"{$action}","?act=savehelp&id="&id):HtmlStr=Replace(HtmlStr,"{$title}",arrs(0,0)):HtmlStr=Replace(HtmlStr,"{$readme}",arrs(1,0)):Response.Write HtmlStr:End Sub:Sub savehelp():Dim title,readme:Dim sql:id=SoonBiz.rid("id"):title=SoonBiz.RequestStr("名称","title","post","1",1,255,40,1):readme=SoonBiz.RequestStr("说明","readme","post","1",1,255,30,1):ShowErr(""):sql="update "& sheethead &"_style set title='"& SoonBiz.Checkstr(title) &"',readme='"& SoonBiz.Checkstr(readme) &"' where id="&id:SoonBiz.execute(sql):SoonBiz.AdSuccess("修改成功"):Response.Write "<script type=""text/javascript"">window.top.opener.document.getElementById('templatehelp"& id &"').innerHTML='"& readme &"'</script>":End Sub:Sub gettags():Dim mytype:Dim tr,sql,rs:Dim yilin:Dim optionchannel:Dim mycid:mycid=SoonBiz.rid("mycid"):mytype=Trim(Request.QueryString("mytype")):tr="<option value=""{$id}"">{$cha_name}</option>":sql="select * from ["& sheethead &"_channel] where cha_moduleid in (3,4,5,6,7) order by cha_cls asc,id asc":optionchannel=SoonBiz.ReplaceMdb("标签生成器",sql,tr,"",1)
If mycid>0 Then
Set rs=SoonBiz.execute("select cha_moduleid from "& sheethead &"_channel where id="&mycid)
If SoonBiz.Ins("3,4,5,6,7",rs(0)) Then
optionchannel="<option value=""-1"">当前频道</option>" & optionchannel
End If:Rs.Close:Set Rs=Nothing'onlyhas:his^#takehere:stillif#:overoutcan'said"
End If:SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.title="标签生成器":SoonBiz.topplus=SoonBiz.topplus & "<script type=""text/javascript"" src=""../inc/admin.js""></script>":SoonBiz.adhead:SoonBiz.nstate("标签生成器"):HtmlStr=template.html(14):Select Case mytype:Case "tagclass" : yilin=template.html(16):Case "tagtopic" : yilin=template.html(17):Case "taggroup" : yilin=template.html(19):Case "tagblog" : yilin=template.html(18):Case "tagvote" : yilin=tagvote:Case "tagitem" : yilin=template.html(21):Case "tagform" : yilin=tagform:Case Else : yilin=tagcontent:End Select:HtmlStr=Replace(HtmlStr,"{$mycid}",mycid):HtmlStr=Replace(HtmlStr,"{$trhtml}",yilin):HtmlStr=Replace(HtmlStr,"{$optionchannel}",optionchannel):Response.Write HtmlStr:End Sub:function tagcontent():Dim str:Dim tr,i,sql:Dim jschannel:jschannel=SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_channel]","subcatchannel[{$i}]=new Array(""{$id}"",""{$cha_moduleid}"");","",1):Dim jsclass:jsclass=SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_class] order by treeid asc","subcat[{$i}]=new Array(""{$cid}"",""{$id}"",""{$title}"");","",1):Dim jstopic:jstopic=SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_topic] order by cls asc,id asc","subcattopic[{$i}]=new Array(""{$cid}"",""{$id}"",""{$title}"");","",1):str=template.html(15):str=Replace(str,"{$jsinfo}",jschannel & jsclass & jstopic):tagcontent=str:End Function:function tagvote():Dim str:str=template.html(20):str=replace(str,"{$trhtml}",SoonBiz.replaceMdb("","select * from ["& sheethead &"_class] where cid=8","<option value='{$id}'>{$title}</option>","",1)):tagvote=str:End function:Function tagform():Dim str:Dim sql:sql="select * from ["& sheethead &"_channel] where cha_moduleid=9 order by cha_cls asc,id asc":str=template.html(22):str=Replace(str,"{$optionform}",SoonBiz.Replacemdb("",sql,"<option value=""{$id}"">{$cha_name}</option>","",1)):tagform=str:End Function:Sub moveout() :Dim rs:Dim title :Dim i,j,sql:Dim arrsclass,arrspage,arrscode:Dim classrs,pagers,coders:Dim styleid_out:id=SoonBiz.rid("id"):title=SoonBiz.RequestStr("模板名称","title","post",1,1,255,30,1):ShowErr(""):Set rs=SoonBiz.execute("select id,title,readme,preimg,isuse from "& sheethead &"_styleclass where id="&id&" order by id asc")
If Not rs.eof Then arrsclass=rs.getrows(-1)
Rs.Close:Set Rs=Nothing:Connection_outerMdb():Set classrs=server.CreateObject("adodb.recordset"):Set pagers=server.CreateObject("adodb.recordset"):Set coders=server.CreateObject("adodb.recordset"):classrs.open "wedonet_styleclass",outconn,1,3:classrs.addnew:classrs("title")=title:classrs("readme")=arrsclass(2,i):classrs("preimg")=arrsclass(3,i):classrs("isuse")=0 :classrs.update:styleid_out=classrs("id"):classrs.close:Set classrs=Nothing:Set rs=SoonBiz.execute("select id,cid,styleid,title,readme from "& sheethead &"_page where styleid="&id&" order by id asc")
If Not rs.eof Then arrspage=rs.getrows(-1)
Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrspage,2):pagers.open "wedonet_page",outconn,1,3:pagers.addnew:pagers("cid")=arrspage(1,i):pagers("styleid")=styleid_out:pagers("title")=arrspage(3,i):pagers("readme")=arrspage(4,i):pagers.update:Set rs=SoonBiz.execute("select id,cid,styleid,pageid,pagename,title,readme,str from "& sheethead &"_style where styleid="& id &" and pageid="&arrspage(0,i)&" order by id asc")
If Not rs.eof Then'asnow.muchanothercame:sameofhimself:$;out':&butget
arrscode=rs.getrows(-1)
Else:arrscode=""
End If:Rs.Close:Set Rs=Nothing
If isarray(arrscode) Then
For j=0 To ubound(arrscode,2):sql="insert into wedonet_style (cid,styleid,pageid,pagename,title,readme,str) values ("&arrscode(1,j)&"," & styleid_out &"," & pagers("id") &",'"& SoonBiz.Checkstr(arrscode(4,j)) &"','"& SoonBiz.Checkstr(arrscode(5,j)) &"','"& SoonBiz.Checkstr(arrscode(6,j)) &"','"& SoonBiz.Checkstr(arrscode(7,j)) &"')":outconn.execute(sql):Next
End If:pagers.Close:Next:Set classrs=Nothing:outconn.close:Set outconn=Nothing:SoonBiz.AdSuccess("导出成功!"):End Sub:Dim outconn:Sub Connection_outerMdb():err.clear:Set outconn=Server.CreateObject("ADODB.Connection"):outconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(templatemdb)'their'(beenlikefrom:andsee"eachany'the::::since
If Err Then
Errmsg=ErrMsg + "<li>"&mdbpath&"数据库不存在</li>":ShowErr("")
End If:End Sub:Sub movein() :Dim rs:Dim title :Dim i,j,sql:Dim arrsclass,arrspage,arrscode:Dim classrs,pagers,coders:Dim styleid_in:id=SoonBiz.rid("id"):Connection_outerMdb():SoonBiz.ConnectionDatabase:Set rs=outconn.execute("select id,title,readme,preimg,isuse from wedonet_styleclass where id="&id&" order by id asc")
If Not rs.eof Then arrsclass=rs.getrows(-1)
Rs.Close:Set Rs=Nothing:Set classrs=server.CreateObject("adodb.recordset"):Set pagers=server.CreateObject("adodb.recordset"):Set coders=server.CreateObject("adodb.recordset"):classrs.open sheethead&"_styleclass",conn,1,3:classrs.addnew:classrs("title")=arrsclass(1,i):classrs("readme")=arrsclass(2,i):classrs("preimg")=arrsclass(3,i):classrs("isuse")=0 :classrs.update:styleid_in=classrs("id"):classrs.close:Set classrs=Nothing:Dim channellist:Set rs=SoonBiz.execute("select id from "& sheethead &"_channel where cha_type<2"):channellist="0":Do While Not rs.eof:channellist=channellist&","&rs(0):rs.movenext:Loop:Rs.Close:Set Rs=Nothing:Set rs=outconn.execute("select id,cid,styleid,title,readme from wedonet_page where styleid="&id&" and cid in ("& channellist &") order by id asc")
If Not rs.eof Then arrspage=rs.getrows(-1)'makesome?inhis:::@\manycould'they:`there:'
Rs.Close:Set Rs=Nothing:For i=0 To ubound(arrspage,2):pagers.open sheethead&"_page",conn,1,3:pagers.addnew:pagers("cid")=arrspage(1,i):pagers("styleid")=styleid_in:pagers("title")=arrspage(3,i):pagers("readme")=arrspage(4,i):pagers.update:Set rs=outconn.execute("select id,cid,styleid,pageid,pagename,title,readme,str from wedonet_style where styleid="& id &" and pageid="&arrspage(0,i)&" order by id asc")
If Not rs.eof Then
arrscode=rs.getrows(-1)
Else:arrscode=""
End If:Rs.Close:Set Rs=Nothing
If isarray(arrscode) Then'alsotake:thatgot:comebut:might:orthan[than::*'
For j=0 To ubound(arrscode,2):sql="insert into wedonet_style (cid,styleid,pageid,pagename,title,readme,str) values ("&arrscode(1,j)&"," & styleid_in &"," & pagers("id") &",'"& SoonBiz.Checkstr(arrscode(4,j)) &"','"& SoonBiz.Checkstr(arrscode(5,j)) &"','"& SoonBiz.Checkstr(arrscode(6,j)) &"','"& SoonBiz.Checkstr(arrscode(7,j)) &"')":conn.execute(sql):Next
End If:pagers.Close:Next:Set classrs=Nothing:outconn.close:Set outconn=Nothing:SoonBiz.AdSuccess("导入成功!"):End Sub:Sub tempplatemdb():Dim soonhost,yilin:Dim sql,rs,arrs,i:sql="select id,title,readme,preimg from wedonet_styleclass":Connection_outerMdb():Set rs=outconn.Execute(sql)
If Not rs.eof Then
arrs=rs.getrows(-1)
Else:arrs=""
End If:Rs.close:set Rs=nothing:outconn.close:Set outconn=Nothing:SoonBiz.LoadTemplatesAdmin("admin_template"):SoonBiz.title="导入模板":SoonBiz.adhead:SoonBiz.nstate("导入模板"):htmlstr=template.html(12)'like:fromafter]for"had}come:theyarebefore:betweenherother
If IsArray (arrs) Then
Dim icount:icount=UBound(arrs,2):Redim soonhost(icount):For i=0 To icount:soonhost(i)=template.html(13):soonhost(i)=Replace(soonhost(i),"{$id}",arrs(0,i)):soonhost(i)=Replace(soonhost(i),"{$title}",arrs(1,i)):soonhost(i)=Replace(soonhost(i),"{$readme}",arrs(2,i)&""):soonhost(i)=Replace(soonhost(i),"{$preimg}",arrs(3,i)&""):Next:yilin=join(soonhost,"")
Else:yilin=""
End If:HtmlStr=Replace(HtmlStr,"{$trhtml}",yilin):Response.Write HtmlStr:End Sub:Sub delouttemplate() :Dim sql:sql="delete from wedonet_styleclass where id="&SoonBiz.rid("id"):Connection_outerMdb():outconn.execute sql:outconn.close:Set outconn=Nothing:SoonBiz.ok:End Sub:Sub delpage():SoonBiz.execute("delete from "& sheethead &"_page where id="&SoonBiz.rid("id")):SoonBiz.execute("delete from "& sheethead &"_style where pageid="&SoonBiz.rid("id")):SoonBiz.Loadstyle():SoonBiz.ok:End Sub:Sub Doisuse() :SoonBiz.execute("update "& sheethead &"_styleclass set isuse=0"):SoonBiz.execute("update "& sheethead &"_styleclass set isuse=1 where id="&SoonBiz.rid("id")):SoonBiz.Loadstyle:SoonBiz.loadcachenum (0):makecss:SoonBiz.ok:End Sub
%>