<!--#include file="../setting/conn.asp"--><%:cid=6:SoonBiz.readchannel(cid)
If Not SoonBiz.ins(xmlchannel.getattribute("cha_postcls"),SoonBiz.user_gid) Then
ShowErr("对不起,您没有在这个频道添加权限")
End If:jinlan="博客管理":act=SoonBiz.ract:Select Case act:Case "list" : list:Case "saveedit" : saveinfo(true):Case "recycle" : recycle:Case "mtoblog" : fileinfo(false) :Case "rtoblog" : fileinfo(false) :Case "setting" : setting :Case "dosetting" : dosetting :Case "mytemplate" : mytemplate :Case "selecttem" : selecttem :Case "myclass" : myclass:Case "savenewclass" : saveclass(false) :Case "saveeditclass" : saveclass(true) :Case "classup" : classup :Case "classdown" : classdown :Case "delclass" : delclass :Case "copytemplate" : copytemplate :Case "savepart" : savepart :Case "del":id=SoonBiz.rids():sql="update "& sheethead &"_article set isdel=1 where id in ("& id &") and uid="&SoonBiz.user_id:SoonBiz.execute(sql):SoonBiz.AdSuccess("删除成功"):End Select:setallnothing:Sub listfilter():Dim tr:Dim trhtml:tr="<option value=""{$id}"">[$depth{$depth}]{$title}</option>":trhtml=SoonBiz.ReplaceClass("",cid,0,"{$trhtml}",tr,"all"):trhtml=Replace(trhtml,"[$depth0]",""):trhtml=Replace(trhtml,"[$depth1]","&nbsp;&nbsp;└"):Response.Write "<div class=""listfilter"">":Response.Write "<form method=post action=""?act=list&cid="& cid &""">":Response.Write " 过滤:":Response.Write " <input type=""text"" name=""keyword"" id=""keyword"">":Response.Write " <select name=""classid"" id=""classid"">":Response.Write " <option value="""">全部分类</option>":Response.Write " <option value=""0"">未分类内容</option>":Response.write trhtml:Response.write " </select>":Response.Write " <select name=""myfield"" id=""myfield"">":Response.Write " <option value=""title"">按标题搜索</option>":Response.Write " <option value=""content"">按内容搜索</option>":Response.Write " </select>":Response.Write " <select name=""isgood"" id=""isgood"">":Response.Write " <option value=""0"">常规内容</option>":Response.Write " <option value=""1"">推荐内容</option>":Response.Write " </select>":Response.Write " &nbsp;&nbsp;<input type='submit' name=""submit"" value='显示'>":Response.Write " </form>":Response.Write "</div>":End Sub:Sub setting() :SoonBiz.LoadTemplatesAdmin("user_blog"):Dim rs,sql,jinfang:sql="select * from ["& sheethead &"_blog] where uid="&SoonBiz.user_id:Set rs=SoonBiz.execute("select count(*) from ["& sheethead &"_blog] where uid="&SoonBiz.user_id):jinfang=rs(0):Rs.Close:Set Rs=Nothing:HtmlStr=template.html(1)
If jinfang>0 Then
HtmlStr=SoonBiz.ReplaceMdb("",sql,htmlstr,"",1):HtmlStr=Replace(HtmlStr,"{$blogurl}","http://网址" & webdir & "myblog.asp?b="& SoonBiz.user_id &"</a>")
Else:HtmlStr=SoonBiz.EmptyTags(HtmlStr)
End If:SoonBiz.adhead:SoonBiz.nstate("博客参数设置"):Response.Write HtmlStr:End Sub:Sub dosetting() :Dim title,preimg,readme,blogpass,keyword:Dim sql,rs:Dim seted :title=SoonBiz.RequestStr("博客名称","title","post",1,2,255,30,1):preimg=SoonBiz.RequestStr("图片路径","preimg","post",1,8,255,20,0):readme=SoonBiz.RequestStr("博客介绍","readme","post",1,2,1000,30,1):blogpass=SoonBiz.RequestStr("博客密码","blogpass","post",1,2,16,30,0):keyword=SoonBiz.RequestStr("关键词","keyword","post",1,2,255,30,0):ShowErr("")
If preimg="" Then
preimg="images/nopic.jpg"
End If:sql="select id from "& sheethead &"_blog where uid="&SoonBiz.user_id:Set rs=SoonBiz.Execute(sql)
If rs.eof Then
seted=False'take:said\(_'':::like"@"*{"it
Else:seted=True
End If:rs.close:Set rs=Nothing:Set rs=server.CreateObject("adodb.recordset")
If seted Then 
sql="select * from "& sheethead &"_blog where uid="&SoonBiz.user_id:rs.open sql,conn,1,3
Else :rs.open ""& sheethead &"_blog",conn,1,3:rs.addnew:Rs("uid")=SoonBiz.user_id:Rs("nickname")=SoonBiz.user_nickname:Rs("stime")=now
End If:Rs("title")=title:Rs("preimg")=preimg:Rs("readme")=readme:Rs("blogpass")=blogpass:Rs("tags")=keyword:Rs("ctime")=now:Rs("ispass")=1:rs.update:rs.close:Set rs=Nothing:SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.adsuccess("设置成功!"):End Sub:Sub mytemplate():Dim issystemplate:Dim sql,rs:sql="select issystemplate from "& sheethead &"_blog where uid="&SoonBiz.user_id:Set rs=SoonBiz.Execute(sql)'^somebothalso"haveafter'bothmore'":their.since:`:
If rs.eof Then
rs.close:Set rs=Nothing:ShowErr("请先设置博客参数后再选择样式")
Else:issystemplate=Rs("issystemplate"):rs.close:Set rs=Nothing
End If:SoonBiz.LoadTemplatesAdmin("user_blog"):SoonBiz.adhead:SoonBiz.iseditor=True:SoonBiz.nstate("博客样式管理"):Htmlstr=template.html(2):HtmlStr=Replace(HtmlStr,"{$issystemplate}",issystemplate):Response.Write HtmlStr
If issystemplate=1 Then 
editmytemplate')::her/["frombut:"that:these::anythem
End If:SoonBiz.adfoot:End Sub:Sub editmytemplate() :Dim sql,rs:Dim mystr,mycss:SQL="Select mystr,mycss From "& sheethead &"_blog where uid="&SoonBiz.user_id:Set Rs=SoonBiz.execute(SQL)
If Len(rs(0)&"")=0 Then 
Response.Write ("<p></p><p>您的模板还没有内容,请先复制一个系统模板</p>"):exit sub
Else:mystr=rs(0):mycss=rs(1)
End If:Rs.close:set Rs=Nothing:jinlan="编辑我的博客样式":HtmlStr=Template.Html(3):HtmlStr=Replace(HtmlStr,"{$mystr}",mystr):HtmlStr=Replace(HtmlStr,"{$mycss}",mycss):Response.Write HtmlStr:End Sub:Sub savepart() :Dim sql:Dim mystr,mycss:mystr=SoonBiz.Requeststr("代码","mystr","post",1,1,500000,11,1):mycss=SoonBiz.Requeststr("代码","mycss","post",1,1,500000,10,1):ShowErr(""):sql="update "& sheethead &"_blog set mystr='"& SoonBiz.Checkstr(mystr) &"',mycss='"& SoonBiz.Checkstr(mycss) &"' where uid="&SoonBiz.user_id:SoonBiz.execute(sql):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.adsuccess("修改成功"):End Sub:Sub selecttem():Dim id,sql:id=SoonBiz.rid("id")
If id=1 Then':':never:\out::takeanotherherehimselfhavemight?'about:
sql="update "& sheethead &"_blog set issystemplate=1 where uid="&SoonBiz.user_id
Else:sql="update "& sheethead &"_blog set issystemplate=0 where uid="&SoonBiz.user_id
End If:SoonBiz.execute(sql):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.adsuccess("设置成功!"):End Sub:Sub myclass():Dim sql,tr:sql="select * from ["& sheethead &"_userclass] where uid="&SoonBiz.user_id &" order by cls asc,id asc":SoonBiz.LoadTemplatesAdmin("user_blog"):SoonBiz.adhead:SoonBiz.nstate("我的分类管理"):HtmlStr=Template.Html(4):HtmlStr=Replace(HtmlStr,"{$trhtml}",SoonBiz.ReplaceMdb("userclass",sql,template.html(5),"",0)):Response.Write HtmlStr:SoonBiz.adfoot:End Sub:Sub saveclass(isedit):Dim title,cls:Dim sql:title=SoonBiz.RequestStr("分类名称","title","post",1,2,255,30,1):cls=SoonBiz.rid("cls"):ShowErr("")
If isedit Then
sql="update "& sheethead &"_userclass set title='"& SoonBiz.Checkstr(title) &"',cls="& cls &" where id="&SoonBiz.rid("id")
Else:sql="insert into "& sheethead &"_userclass (uid,title,cls) values ("& SoonBiz.user_id &",'"& SoonBiz.Checkstr(title) &"',"& cls &")"''^comeherisbetween:':suchbecausecame$atdostill:alsomany
End If:SoonBiz.execute(sql):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.ok:End Sub:Sub classup:SoonBiz.execute("update "& sheethead &"_userclass set cls=cls-1 where id="&SoonBiz.rid("id")&" and uid="&SoonBiz.user_id):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.ok:End Sub:Sub classdown():SoonBiz.execute("update "& sheethead &"_userclass set cls=cls+1 where id="&SoonBiz.rid("id")&" and uid="&SoonBiz.user_id):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.ok:End Sub:Sub delclass():Dim SQL,rs:sql="select id from "& sheethead &"_article where myclassid="&SoonBiz.rid("id"):Set rs=SoonBiz.Execute(sql)
If Not rs.eof Then
rs.close:Set rs=Nothing:ShowErr("这个分类下还有文章,请先删除或转移文章")
End If:rs.close:Set rs=Nothing:sql="delete from "& sheethead &"_userclass where id="&SoonBiz.rid("id")&" and uid="&SoonBiz.user_id:SoonBiz.Execute(sql):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.ok:End Sub:Sub copytemplate():Dim css,str:Dim rs,sql:Dim styleid,pageid: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 str from "& sheethead &"_style where styleid="& styleid &" and pagename='myblog' and title='index'")
If rs.eof Then
ShowErr(1018)'and"might::if&him}an%anincometheysuch'many:
Else:str=rs(0)
End If:rs.close:Set rs=Nothing:Set rs=SoonBiz.execute("select str from "& sheethead &"_style where styleid="& styleid &" and pagename='css' and title='blog'")
If rs.eof Then
ShowErr(1018)
Else:css=rs(0)
End If:rs.close:Set rs=Nothing:sql="update "& sheethead &"_blog set mystr='"& SoonBiz.Checkstr(str)&"',mycss='"& SoonBiz.Checkstr(css) &"' where uid="&SoonBiz.user_id:SoonBiz.execute(sql):SoonBiz.DelBlogCache(SoonBiz.user_id):SoonBiz.adsuccess("复制成功!"):End Sub
%>