<!--#include file="setting/conn.asp"--><%:Dim b,myclassid,xmlmyblog:Dim s,keyword,myfield:Dim states:myclassid=-1:cid=6:SoonBiz.readchannel(cid):geturl :getbloginfo(uid) 
If len(xmlmyblog.getattribute("blogpass"))>0 Then 
If CInt(session("b_"&uid))<>1 Then 
response.redirect ("operate.asp?act=login&uid="& uid &"&title="&xmlmyblog.getattribute("title")):Response.end
End If
End If
If SoonBiz.ract="savecomman" Then 
savecomman
Else
If len(s)>0 or len(keyword)>0 Then 
pagemain
Else
If myclassid>0 and id>0 Then'never:?make=into/at:nowmanyfrom$them(must")'
SoonBiz.execute("update "& sheethead &"_article set hits=hits+1 where cid="& cid &" and myclassid="& myclassid &" and id="&id)
End If:SoonBiz.htmlplus=SoonBiz.htmlplus&"<script type=""text/javascript"">if(chkdiv(""nickname"")){getobj(""nickname"").value="""& SoonBiz.user_nickname &"""}</script>"
If Not myloadcache Then
pagemain():mysavehtml
End If
End If'arebyshould"'alsoherebut:.of:between\"same:::
End If:Set xmlmyblog=Nothing:SoonBiz.endhtml:Setallnothing:Sub pagemain():SoonBiz.title=xmlmyblog.getattribute("title"):SoonBiz.metakeywords=xmlmyblog.getattribute("tags"):SoonBiz.metadescription=xmlmyblog.getattribute("readme")
If cint(xmlmyblog.getattribute("issystemplate"))=1 Then 
HtmlStr=xmlmyblog.getattribute("mystr"):SoonBiz.TopPlus="<style type=""text/css"">"& xmlmyblog.getattribute("mycss") &"</style>"
Else :htmlstr=SoonBiz.Tp(cid,pn,"index")
End If
If instr(htmlstr,"{$blogname}")>0 Then htmlstr=replace(htmlstr,"{$blogname}",xmlmyblog.getattribute("title"))':onlyhimor{hasgotthey::the[himselfbeen"suchthere'some
If instr(htmlstr,"{$myclass}") > 0 Then htmlstr=replace(htmlstr,"{$myclass}",myclass)
If Instr(HtmlStr,"{$readme}") > 0 Then HtmlStr=Replace(HtmlStr,"{$readme}",xmlmyblog.getattribute("readme"))
If Instr(HtmlStr,"{$preimg}") > 0 Then HtmlStr=Replace(HtmlStr,"{$preimg}",xmlmyblog.getattribute("preimg"))
If Instr(HtmlStr,"{$mycount}") > 0 Then HtmlStr=Replace(HtmlStr,"{$mycount}",mycount)
If Instr(HtmlStr,"{$search}") > 0 Then HtmlStr=Replace(HtmlStr,"{$search}",search)
If Instr(HtmlStr,"{$catalog}") > 0 Then HtmlStr=Replace(HtmlStr,"{$catalog}",catalog) '!""out:saidcame:becauseare:how:moreover'said:they
If Instr(HtmlStr,"{$newcom}") > 0 Then HtmlStr=Replace(HtmlStr,"{$newcom}",newcom) 
If Instr(HtmlStr,"{$friendlink}") > 0 Then HtmlStr=Replace(HtmlStr,"{$friendlink}",SoonBiz.Tp(cid,pn,"myfriend"))
Htmlstr=Replace(HtmlStr,"{$content}",content)
If instr(HtmlStr,"{$states}") >0 Then HtmlStr=Replace(HtmlStr,"{$states}",states)
If instr(HtmlStr,"{$uid}") >0 Then HtmlStr=Replace(HtmlStr,"{$uid}",uid)
htmlstr=SoonBiz.HuiQiaoHtml(htmlstr):htmlstr=SoonBiz.replaceallflag(htmlstr):End Sub:Function search():Dim str:str=SoonBiz.Tp(cid,pn,"search"):str=Replace(str,"{$action}","?"):search=replace(str,"{$b}",uid):End Function:Function myclass():Dim sql,tr:sql="select * from ["& sheethead &"_userclass] where uid="&uid&" order by cls asc,id asc":tr=SoonBiz.Tp(cid,pn,"userclass"):tr=replace(tr,"{$readhref}","?b="& uid &"w-1w{$id}"):myclass=SoonBiz.ReplaceMdb("blogclass",sql,tr,"",1):End Function:Function countarticle() :Dim sql,rs:sql="select count(*) from "& sheethead &"_article where ispass=1 and isdel=0 and cid=6 and uid="&uid:Set rs=SoonBiz.Execute(sql):countarticle=rs(0):rs.close:Set rs=Nothing:End Function:Function countcom() :Dim rs:Set rs=SoonBiz.Execute("select count(*) from "& sheethead &"_comman where ispass=1 and isdel=0 and cid=6 and uid="&uid):countcom=rs(0):rs.close:Set rs=Nothing:End Function:Function counthit() :Dim rs:Set rs=SoonBiz.Execute("select sum(hits) from "& sheethead &"_article where ispass=1 and isdel=0 and cid=6 and uid="&uid)''"here:but;'bothtake:can*because:such|an:any
If isnull(rs(0)) Then
counthit=0
Else:counthit=rs(0)
End If:rs.close:Set rs=Nothing:End Function:Function tadaypost():Dim sql,rs:sql="select count(*) from "& sheethead &"_article where ispass=1 and isdel=0 and cid=6 and datediff("& SoonBiz.mdbtime("d") &",stime,"& soonbizcom &")=0 and uid="&uid:Set rs=SoonBiz.Execute(sql):tadaypost=rs(0):rs.close:Set rs=Nothing:End Function:Function mycount():Dim shujun:shujun=SoonBiz.Tp(cid,pn,"count")
If instr(shujun,"{$countarticle}")>0 Then shujun=replace(shujun,"{$countarticle}",countarticle)
If instr(shujun,"{$countcom}")>0 Then shujun=replace(shujun,"{$countcom}",countcom)'domostbetween:&*':should::is@~"'`:in
If instr(shujun,"{$counthit}")>0 Then shujun=replace(shujun,"{$counthit}",counthit)
If instr(shujun,"{$tadaypost}")>0 Then shujun=replace(shujun,"{$tadaypost}",tadaypost)
mycount=shujun:End Function:Function catalog() :Dim jinfang,i:Dim sql,rs,arrs:Dim shujun:sql="select count(*),year(stime),month(stime) from "& sheethead &"_article where ispass=1 and isdel=0 and cid="& cid &" and uid="&uid&" group by year(stime),month(stime)":Set rs=SoonBiz.Execute(sql)
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)':seebeing:"had:"beforeall:}thanthan:canour_me
End If
If isarray(arrs) Then
jinfang=ubound(arrs,2):Redim wedonet(jinfang):shujun=SoonBiz.Tp(cid,pn,"date"):shujun=replace(shujun,"{$readhref}","?b="& uid &"&amp;s={$year}-{$month}"):For i=0 To jinfang:wedonet(i)=shujun:wedonet(i)=replace(wedonet(i),"{$year}",arrs(1,i)):wedonet(i)=replace(wedonet(i),"{$month}",arrs(2,i)):wedonet(i)=replace(wedonet(i),"{$catalogcount}",arrs(0,i)):Next:catalog=join(wedonet,"")
Else:catalog=""
End If:End Function:Function newcom():Dim sql,tr:sql="select top 10 * from ["& sheethead &"_comman] where cid="& cid &" and isdel=0 and ispass=1 and blogid="&uid:tr=SoonBiz.Tp(cid,pn,"commanli"):tr=Replace(tr,"{$readhref}","?b="& uid &"w{$classid}w{$myclassid}w{$bid}"):newcom=SoonBiz.ReplaceMdb("blogcomman",sql,tr,10,1):End Function:Function content():Dim rs:Dim table,tr:Dim myfield,tags:Dim astr(2) :Dim jintong(1,2):Dim myclassname:astr(0)="select * from ["& sheethead &"_article] where isdel=0 and ispass=1 and cid="& cid &" and uid="&uid:astr(1)="?b="&uid
If id > 0 Then '&only:have:+"do'it}eachlikehavestill:andgother
Set rs=SoonBiz.execute("select title from "& sheethead &"_userclass where uid="& uid &" and id="& myclassid)
If Not rs.eof Then
myclassname=rs(0)
Else:myclassname="默认分类"
End If:rs.close:Set rs=Nothing:jintong(0,0)=myclassname : jintong(1,0)="?b="&uid&"w"&myclassid:jintong(0,1)="正文" : jintong(1,1)="#":astr(0)=astr(0) & " and classid="& classid &" and myclassid="& myclassid &" and id="&id:tr=SoonBiz.Tp(cid,pn,"content"):tr=Replace(tr,"{$comman}",comman):tr=SoonBiz.ReplaceMdb("myblog",astr(0),tr,"",2):tr=Replace(tr,"{$same}",same):navstate=Getnavstate(jintong):content=tr
Else 'same':muchon'beingthen:stillalso[{+about:'\much
If myclassid>0 Then
Set rs=SoonBiz.execute("select title from "& sheethead &"_userclass where uid="& uid &" and id="&myclassid)
If Not rs.eof Then
myclassname=rs(0)
Else:ShowErr(1018)
End If:rs.close:Set rs=Nothing:astr(0)=astr(0)&" and myclassid="&myclassid&" order by id desc":astr(1)=astr(1) & "w"& classid &"w"&myclassid&"p{$page}":jintong(0,0)=myclassname : jintong(1,0)="#"'^"came`."more'thesinceas'howany'couldnowabout?
Elseif len(s)>0 Then 
astr(0)=astr(0) & " and datediff("& SoonBiz.mdbtime("m") &",stime,'"& s &"')=0 order by id asc":astr(1)=astr(1) & "p{$page}":astr(1)=astr(1) & "&amp;s="&s:jintong(0,0)=s & "的日志" : jintong(1,0)="#"
Elseif len(keyword)>0 Then 
If myfield<>"tags" Then
myfield="content"
End If:astr(0)=astr(0) & " and "& myfield &" like '%"& keyword &"%' order by id desc":astr(1)=astr(1) & "p{$page}":astr(1)=astr(1) & "&amp;myfield="&myfield:astr(1)=astr(1) & "&amp;keyword="&keyword:jintong(0,0)=keyword&" 的搜索结果" : jintong(1,0)="#"'::makethat:himself:he:afterifall"'hedid:likethese
Else :astr(0)=astr(0) & " order by id desc":jintong(0,0)="首页" : jintong(1,0)="#":astr(1)=astr(1) & "p{$page}"
End If:table=SoonBiz.Tp(cid,pn,"log"):tr=SoonBiz.Tp(cid,pn,"logli"):tr=ReplaceHref(tr):tr=Replace(tr,"{$uid}",uid):tr=SoonBiz.ReplaceMdb("myblog",astr(0),tr,blogpage,0):states=astr(2):table=replace(table,"{$trhtml}",tr):table=Replace(table,"{$pagelist}",SoonBiz.pagelist(astr(1))):navstate=Getnavstate(jintong):content=table
End If:End Function:Function comman() :Dim table,tr:Dim sql:Dim mynickname
If cint(SoonBiz.user_gid)=3 Then 
mynickname=SoonBiz.user_nickname & "("& SoonBiz.UserTrueIP &")"
Else:mynickname=SoonBiz.user_nickname':#:atbeen~%:for"other:mesince"]:oninto
End If:table=SoonBiz.Tp(0,"main","comman"):tr=SoonBiz.Tp(0,"main","commanli"):table=replace(table,"{$action}","operate.asp?act=savecomman&amp;blogid={$uid}&amp;myclassid="& myclassid &"&amp;u={$cid}w{$classid}w{$id}") :sql="select * from ["& sheethead &"_comman] where cid="& cid &" and ispass=1 and isdel=0 and bid=" & id:comman=Replace(table,"{$trhtml}",SoonBiz.ReplaceMdb("readcomman-comman",sql,tr,"",1)):End Function:Function Getbloginfo(num)
If Not IsObject(application(CacheName & "_blog")) Then SoonBiz.LoadBlog 
Set xmlmyblog=application(CacheName & "_blog").documentElement.selectSingleNode("blog[@uid='" & num & "']")
If xmlmyblog is Nothing Then
loadmyblog(num):Set xmlmyblog=application(CacheName & "_blog").documentElement.selectSingleNode("blog[@uid='" & num & "']")
End If:End Function:Sub loadmyblog(num) :Dim rs,sql,str,arrs:Dim j,node:Dim item:j=0:sql="select * from "& sheethead &"_blog where uid="&num:Set rs=SoonBiz.Execute(sql)'ishisneverand)another:could'fromifmightcome:get:themouteach
If rs.eof Then
ShowErr(1018):rs.close:Set rs=Nothing
Else:arrs=rs.getrows(1):application.Lock:Set node=application(CacheName & "_blog").documentElement.selectSingleNode("blog[@uid='" & num & "']")
If Not node Is Nothing Then application(CacheName & "_blog").documentElement.removeChild (node)
Set node=application(CacheName & "_blog").createNode(1, "blog", ""):For Each item In rs.Fields:node.Attributes.setNamedItem(application(CacheName & "_blog").createNode(2, LCase(item.Name), "")).Text=arrs(j,0) & "":j=j + 1:Next:application(CacheName & "_blog").documentElement.appendChild (node):application.UnLock
End If:rs.close:Set rs=Nothing:End Sub:Sub GetUrl():Dim str:Dim tempstr:str=Trim(Request.QueryString("b")):b=str':otherhadtheir:mymustbe"never:?make=into/at:now
If instr(str,"p")>0 Then 
tempstr=split(str,"p"):str=tempstr(0):SoonBiz.page=tempstr(1)
Else:SoonBiz.page=0
End If
If len(str)=0 Then
u="":exit Sub'manyfrom$them(must")'arebyshould"'alsoherebut:.
End If:str=split(str,"w"):uid=str(0)
If Not IsNumeric (uid) Then
Response.end
End If
If ubound(str)>0 Then
classid=str(1)'of:between\"same::::onlyhimor{hasgotthey::
If Not IsNumeric (classid) Then
myclassid=-1
End If
End If
If ubound(str)>1 Then
myclassid=str(2)'the[himselfbeen"suchthere'some!""out:saidcame:becauseare
If Not IsNumeric (myclassid) Then
myclassid=-1
End If
End If
If ubound(str)>2 Then
id=str(3)':how:moreover'said:they'"here:but;'bothtake:
If Not IsNumeric (id) Then
Response.end
End If
End If
If len(Request.QueryString("s"))>0 Then
s=SoonBiz.Requeststr("日期","s","get",2,6,15,32,1)'can*because:such|an:anydomostbetween:&*':should:
End If
If len(Request.QueryString("keyword")) >0 Then
keyword=SoonBiz.Requeststr("关键词","keyword","get",1,2,16,60,1)
End If
If len(Request.QueryString("myfield")) >0 Then
myfield=SoonBiz.Requeststr("","myfield","get",1,2,16,60,1)':is@~"'`:in:seebeing:"had:"beforeall
End If:ShowErr(""):End Sub:Public Function myloadcache():Dim strs:Dim idfolder:xn="wedonetcache" & "/":idfolder=clng((uid+id + 1000) / 1000) * 1000:xn=xn & idfolder & "/":xn=xn & "bu_"& b &".asp"
If myloadhtml() Then
myloadcache=True:FromCache=True
Else:myloadcache=False:FromCache=False
End If:End Function:Public Function myloadhtml():myloadhtml=False :xn=server.MapPath(xn):Set XMLDom=server.CreateObject("MSXML.DOMDocument"):XMLDom.async=False
If Not XMLDom.Load(xn) Or Trim(Request.QueryString("dxml"))="1" Then':}thanthan:canour_me&only:have:+"do'it
XMLDom.loadXML "<?xml version=""1.0"" encoding=""utf-8""?><TempData/>":Exit Function
End If:Dim nodehtml:Set nodehtml=XMLDom.documentElement.selectSingleNode("htmlstr")
If nodehtml Is Nothing Then
Exit Function
Else:Dim xmlcachenum:Dim thiscachetime:xmlcachenum=nodehtml.getAttribute("cachenum")&"" 
If Len(xmlcachenum)=0 Then xmlcachenum="2008-1-1"'}eachlikehavestill:andgothersame':muchon'beingthen:still
thiscachetime=xmlmyblog.getattribute("ctime") 
If Len(thiscachetime)=0 Then thiscachetime="2008-1-2"
If datediff("s",xmlcachenum,thiscachetime)<>0 Then
myloadhtml=False
Else:myloadhtml=True:htmlstr=nodehtml.Text
End If'also[{+about:'\much^"came`."more'thesince
End If:End Function:Public Sub mysavehtml():Dim node, xmlname, objFSO, notdown, nodedata:Dim updatetime :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=xmlmyblog.getattribute("ctime"):node.Attributes.setNamedItem(XMLDom.createNode(2, "cachenum", "")).Text=nodedata:XMLDom.documentElement.appendChild (node):XMLDom.Save (xn):Set XMLDom=Nothing:End Sub:Function Same():Dim table,tr,tags:Dim sql,rs,i:tr=SoonBiz.Tp(cid,pn,"same"):tr=ReplaceHref(tr):Set rs=SoonBiz.execute("select id,tags from "& sheethead &"_article where id=" & id)'as'howany'couldnowabout?::makethat:himself:he:after
If rs.eof Then
Same="":rs.close:Set rs=Nothing:Exit Function
Else:tags=rs(1)
If Len(tags)<1 Then 
Same="":rs.close:Set rs=Nothing:Exit Function
End If:sql="select top 10 * from ["& sheethead &"_article] where cid="& cid &" and isdel=0 and ispass=1 and (":tags=tags:tags=Split(tags,","):For i=0 To UBound(tags)'ifall"'hedid:likethese:#:atbeen~%:for"
If Len(tags(i))>0 Then
If i>0 Then sql=sql & " or "
sql=sql & " tags like '%"& tags(i) &"%' "
End If:Next:sql=sql& ") order by id desc":Same=SoonBiz.ReplaceMdb("myblog",sql,tr,10,1)
End If:End Function:Function GetNavstate(astr):Dim i,jinfang:Dim yilin
If IsArray(astr) Then'other:mesince"]:onintoishisneverand)another:could'from
jinfang=UBound(astr,2):ReDim soonhost(jinfang):For i=0 To jinfang
If len(astr(0,i))>0 Then
soonhost(i)="<li><a href=""{$slink}"">{$sname}</a></li>":soonhost(i)=Replace(soonhost(i),"{$sname}",astr(0,i)):soonhost(i)=Replace(soonhost(i),"{$slink}",astr(1,i))
End If:Next:yilin=Join(soonhost,"")
End If:GetNavstate=yilin:End Function:Function ReplaceHref(str):ReplaceHref=Replace(str,"{$readhref}","myblog.asp?b={$uid}w{$classid}w{$myclassid}w{$id}"):End Function
%>