📄 class_blog.asp
字号:
if rs1.eof then set rs1=nothing:exit sub
rs1.Close
set rs1=nothing
If P_Blog_UPDATEPAUSE > 0 Then
progress 100, P_Blog_UPDATEPAUSE&"秒后自动更新后面的日志,请不要刷新页面..."
with response
.Write "<script language=JavaScript>var secs = "&P_Blog_UPDATEPAUSE&";var wait = secs * 1000;"
.write "for(i = 1; i <= secs; i++){window.setTimeout(""Update("" + i + "")"", i * 1000);}"
.write "function Update(num){if(num != secs){printnr = (wait / 1000) - num;pstr.innerHTML=printnr+""秒后自动更新后面的日志,请不要刷新页面..."";progress.style.width=(num/secs)*100+""%"";progress.innerHTML=""剩余""+printnr+""秒""}}"
.write "setTimeout(""window.location='user_update.asp?action=update_alllog&lastlogid="&lastid&"'"","&int(P_Blog_UPDATEPAUSE*1000)&");</script>"
end with
response.Flush()
response.End()
End If
end sub
public sub update_usite(uid)
dim p
p = 12
progress Int(1 / p * 100), "更新首页..."
Update_index 0
progress Int(2 / p * 100), "更新站点信息文件..."
Update_info uid
progress Int(3 / p * 100), "生成新日志列表文件..."
Update_newblog (uid)
progress Int(4 / p * 100), "更新最新留言..."
Update_newmessage uid
progress Int(5 / p * 100), "生成首页日志分类文件..."
Update_Subject (uid)
progress Int(6/ p * 100), "更新功能页..."
CreateFunctionPage
progress Int(7 / p * 100), "更新留言板..."
Update_message 0
progress Int(8 / p * 100), "更新最新回复..."
Update_comment uid
progress Int(9 / p * 100), "更新公告..."
Update_placard uid
progress Int(10 / p * 100), "更新友情连接..."
Update_links uid
progress Int(11 / p * 100), "更新BlogName..."
Update_blogname
progress Int(12 / p * 100), "整站重新发布完成!"
end sub
public sub update_alllog_admin(uid)
dim rs1,i,p
uid = CLng(uid)
oblog.CreateUserDir uid, 0
userid = uid
Set rs1 = Server.CreateObject("Adodb.RecordSet")
rs1.open "select logid from oBlog_log where userid=" & uid & " and isdraft=0", conn, 1, 1
While Not rs1.EOF
p = rs1.recordcount + 1
progress Int(i / p * 100), "更新ID为" & rs1(0) & "的日志..."
Update_log rs1(0), 0
Update_calendar rs1(0)
i = i + 1
rs1.movenext
Wend
rs1.Close
set rs1=nothing
update_usite(uid)
end sub
Public Sub Update_alllog(uid,lastlogid)
Dim p
uid = CLng(uid)
oblog.CreateUserDir uid, 0
userid = uid
update_partlog uid,lastlogid
update_usite(uid)
End Sub
Public Sub Update_blogname()
savefile user_path, "\inc\show_blogname.htm", oblog.filt_html(BlogName)
End Sub
Public Sub savefile(dirstr, fname, str)
'On Error Resume Next
Dim dirstr1, divid
dirstr1 = Server.Mappath(blogdir&dirstr)
'Response.Write "目录2:" & dirstr1 & "<br>"
'以下转为js格式
If (Left(fname, 5) = "\inc\" Or Left(fname, 10) = "\calendar\") And (f_ext = "htm" Or f_ext = "html") Then
If Left(fname, 10) = "\calendar\" Then
divid = "calendar"
Else
divid = Replace(Replace(Replace(fname, "\inc\", ""), ".htm", ""), "show_", "")
End If
str = oblog.htm2js_div(str, divid)
End If
'以下兼容asp格式,转换路径
if f_ext="asp" then
if logfilepath=0 then
str=replace(str,"<!-- #include file="""&user_truepath,"<!-- #include file=""")
else
if instr(fname,"index.asp") or instr(fname,"message.asp") or instr(fname,"cmd.asp") then
str=replace(str,"<!-- #include file="""&user_truepath,"<!-- #include file=""")
else
str=replace(str,"<!-- #include file="""&user_truepath,"<!-- #include file=""../../")
end if
end if
if logfilepath=0 then
str=replace(str,"<!-- #include file="""&blogdir,"<!-- #include file=""../../")
else
if instr(fname,"index.asp") or instr(fname,"message.asp") or instr(fname,"cmd.asp") then
str=replace(str,"<!-- #include file="""&blogdir,"<!-- #include file=""../../")
else
str=replace(str,"<!-- #include file="""&blogdir,"<!-- #include file=""../../../../")
end if
end if
end if
If str = "" Or IsNull(str) Then str = " "
If objFSO.FolderExists(dirstr1) = False Then objFSO.CreateFolder (dirstr1)
Call oblog.BuildFile(dirstr1 & Trim(fname), str)
'If Err Then
'err.Clear
'Response.Write "<br />生成文件发生错误,若您是第一次使用,请选择:>>更新>>重新发布全站。"
'Response.End
'End If
End Sub
Public Function newcalendar(folderspec)
'Response.Write(folderspec)
On Error Resume Next
Dim f, f1, fc, nName
If objFSO.FolderExists(Server.Mappath(folderspec)) Then
Set f = objFSO.GetFolder(Server.Mappath(folderspec))
Set fc = f.Files
nName = 0
For Each f1 In fc
If nName < CLng(Replace(f1.Name, ".htm", "")) Then nName = CLng(Replace(f1.Name, ".htm", ""))
Next
newcalendar = nName
Else
newcalendar = "0"
End If
End Function
'str改为了代入的js包含文件
Public Function repl_label(show, str, title, author, keyword, desc, calendar)
On Error Resume Next
show = Replace(show, "#ad_usercomment#", "<div id=""ad_usercomment""></div>")
show = Replace(show, "$show_placard$", "<div id=""placard""><!-- #include file="""&user_truepath&"inc/show_placard.htm"" --></div>")
show = Replace(show, "$show_calendar$", "<div id=""calendar""><!-- #include file="""&user_truepath&"calendar/" & calendar & ".htm"" --></div>")
show = Replace(show, "$show_xml$", "<div id=""xml""><a href="""&user_truepath&"rss2.xml"" target=""_blank""><img src='" & blogdir & "images/xml.gif' width='36' height='14' border='0' /></a></div>")
show = Replace(show, "$show_subject$", "<div id=""subject""><!-- #include file="""&user_truepath&"inc/show_subject.htm"" --></div>")
show = Replace(show, "$show_subject_l$", "<div id=""subject_l""><!-- #include file="""&user_truepath&"inc/show_subject.htm"" --></div>")
show = Replace(show, "$show_newblog$", "<div id=""newblog""><!-- #include file="""&user_truepath&"inc/show_newblog.htm"" --></div>")
show = Replace(show, "$show_comment$", "<div id=""comment""><!-- #include file="""&user_truepath&"inc/show_comment.htm"" --></div>")
show = Replace(show, "$show_blogname$", "<div id=""blogname""><!-- #include file="""&user_truepath&"inc/show_blogname.htm"" --></div>")
show = Replace(show, "$show_newmessage$", "<div id=""newmessage""><!-- #include file="""&user_truepath&"inc/show_newmessage.htm"" --></div>")
show = Replace(show, "$show_links$", "<div id=""links""><!-- #include file="""&user_truepath&"inc/show_links.htm"" --></div><div id=""ad_userlinks""></div>")
show = Replace(show, "$show_info$", "<div id=""info""><!-- #include file="""&user_truepath&"inc/show_info.htm"" --></div>")
show = Replace(show, "$show_search$", "<div id=""search""><!-- #include file="""&user_truepath&"inc/show_search.htm"" --></div>")
show = Replace(show, "$show_login$", "<div id=""ob_login""></div>")
show = "<link href=""" & blogdir & "OblogStyle/OblogUserDefault31.css"" rel=""stylesheet"" type=""text/css"" />" & vbCrLf & "<script src=""" & blogdir & "inc/main.js"" type=""text/javascript""></script>" & vbCrLf & "</head>" & vbCrLf & "<body>" & vbCrLf & "<div id=""ad_usertop""></div>" & show
show = show & "<div id=""ad_userbot""></div>"
show = show & "<div id=""powered""><a href=""http://www.oblog.cn"" target=""_blank""><img src="""&blogdir&"images/oblog_powered.gif"" border=""0"" alt=""Powered by Oblog."" /></a></div>" & vbCrLf & "</body>" & vbCrLf & "</html>"
show = "<title>" & Replace(Replace(Replace(title, "<", "<"), ">", ">"), " ", " ") & "</title>" & vbCrLf & show
show = "<meta name=""description"" content=""" & oblog.filt_html(desc) & """ />" & vbCrLf & show
show = "<meta name=""keyword"" content=""" & oblog.filt_html(keyword) & """ />" & vbCrLf & show
show = "<meta name=""author"" content=""" & oblog.filt_html(author) & """ />" & vbCrLf & show
show = "<meta name=""generator"" content=""oblog"" />" & vbCrLf & show
show = "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"" />" & vbCrLf & show
show = "<meta http-equiv=""Content-Language"" content=""zh-CN"" />" & vbCrLf & show
show = "<html>" & vbCrLf & "<head>" & vbCrLf & show
'html文件,将包含文件改为js包含
If f_ext = "htm" Or f_ext = "html" Then
show = filt_include(show)
show = show & "<script src=""" & user_truepath&"inc/show_subject.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_placard.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"calendar/" & calendar & ".htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_search.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_newblog.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_comment.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_newmessage.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_info.htm""></script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_links.htm""></script>" & vbCrlf
'show = show & "<script src=""" & user_truepath&"inc/show_xml.htm""><script>" & vbCrlf
show = show & "<script src=""" & user_truepath&"inc/show_blogname.htm""></script>" & vbCrlf
End If
'以下为shtml,asp,html共用js包含
If InStr(show, "<div id=""oblog_edit"">") Then
show = show & "<script src=""" & blogdir & "commentedit.asp""></script>" & vbCrlf
show = show & "<script src=""" & blogdir & "count.asp?action=code31""></script>" & vbCrlf
End If
If InStr(show, "<div id=""blogzhai"">") Then
show = show & "<script src=""" & blogdir & "inc/inc_zhai.js""></script>" & vbCrlf
End If
show = show & str
show = show & "<script src=""" & blogdir & "count.asp?action=site&id=" & user_id & """></script>" & vbCrlf
show = show & "<script src=""" & blogdir & "login.asp?action=showindexlogin""></script>" & vbCrlf
show=repl_ad(show,0)
repl_label=filtskinpath(show)
End Function
'替换广告代码
public function repl_ad(str,t)
dim show
show=str
if t=0 then '静态页面
if f_ext="shtml" or f_ext="asp" then
show = Replace(show, "<div id=""ad_usertop""></div>", "<!-- #include file="""&blogdir&"ad/ad_usertop.htm"" -->")
show = Replace(show, "<div id=""ad_userbot""></div>", "<!-- #include file="""&blogdir&"ad/ad_userbot.htm"" -->")
show = Replace(show, "<div id=""ad_userlinks""></div>", "<!-- #include file="""&blogdir&"ad/ad_userlinks.htm"" -->")
show = Replace(show, "<div id=""ad_usercomment""></div>", "<!-- #include file="""&blogdir&"ad/ad_usercomment.htm"" -->")
elseif f_ext="html" or f_ext="htm" then
show = Replace(show, "<div id=""ad_usertop""></div>", "<script src=""" & blogdir & "ad/ad_usertopjs.htm""></script>")
show = Replace(show, "<div id=""ad_userbot""></div>", "<script src=""" & blogdir & "ad/ad_userbotjs.htm""></script>")
show = Replace(show, "<div id=""ad_userlinks""></div>", "<script src=""" & blogdir & "ad/ad_userlinksjs.htm""></script>")
show
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -