📄 class_blog.asp
字号:
mdays(10) = 31
mdays(11) = 30
mdays(12) = 31
'今天的年月日
today = Day(oblog.ServerDate(Now()))
tomonth = Month(oblog.ServerDate(Now()))
toyear = Year(oblog.ServerDate(Now()))
'指定的年月日及星期
thismonth = c_month
thisdate = c_day
thisyear = c_year
If IsDate("February 29, " & thisyear) Then mdays(2) = 29
'确定日历1号的星期
startspace = Weekday(thismonth & "-1-" & thisyear) - 1
NextMonth = c_month + 1
NextYear = c_year+1
If NextMonth > 12 Then
NextMonth = 1
NextYear = NextYear + 1
End If
PreMonth = c_month - 1
'PreYear = c_year-1
PreYear = c_year
If PreMonth < 1 Then
PreMonth = 12
PreYear = PreYear - 1
End If
ccode = "<table width='100%' class=""year_"&thisyear&" month_"&thismonth&""">" & vbCrLf
ccode = ccode & "<thead>" & vbCrLf
'ccode = ccode & "<caption>" & mName(thismonth) & thisyear & "</caption><tr>" & vbCrLf
ccode = ccode & "<caption><a href="""& CommondFile & ((c_year-1) & Right("0" & c_month,2)) &""" title=""上一年""><span class=""arrow""><<</span></a> <a href=""" & CommondFile & PreYear& Right("0" & preMonth,2)&""" title=""上一月""><span class=""arrow""><</span></a> "& toyear &"<a href=""" & CommondFile & Year(oblog.ServerDate(Date)) & Right("0" & Month(oblog.ServerDate(Date)),2) & """ title=""返回当月""> - </a>"& c_month&" <a href="""& CommondFile & c_year& Right("0" & NextMonth,2) &""" title=""下一月""><span class=""arrow"">></span></a> <a href=""" & CommondFile & NextYear & Right("0" & c_month,2) &""" title=""下一年""><span class=""arrow"">>></span></a></caption>" & vbCrLf
'ccode = ccode & "<caption><a href=""" & CommondFile & c_year& Right("0" & preMonth,2)&""" title=""上一月""><span class=""arrow""><</span></a> "& toyear &" <a href=""" & CommondFile & Year(oblog.ServerDate(Date)) & Right("0" & Month(oblog.ServerDate(Date)),2) & """ title=""返回当月"">-</a> "& c_month&" <a href="""& CommondFile & c_year& Right("0" & NextMonth,2) &""" title=""下一月""><span class=""arrow"">></span></a></caption>" & vbCrLf
ccode = ccode & "<tr class=""week"">" & vbCrLf
ccode = ccode & "<th class=""sun"">日</th>" & vbCrLf
ccode = ccode & "<th class=""mon"">一</th>" & vbCrLf
ccode = ccode & "<th class=""Tue"">二</th>" & vbCrLf
ccode = ccode & "<th class=""Wen"">三</th>" & vbCrLf
ccode = ccode & "<th class=""Thu"">四</th>" & vbCrLf
ccode = ccode & "<th class=""Fri"">五</th>" & vbCrLf
ccode = ccode & "<th class=""Sat"">六</th>" & vbCrLf
ccode = ccode & "</tr>" & vbCrLf
ccode = ccode & "</thead>" & vbCrLf
ccode = ccode & "<tbody>" & vbCrLf
ccode = ccode & "<tr>" & vbCrLf
For s = 0 To startspace - 1
ccode = ccode & "<td align=""center""></td>" & vbCrLf
Next
count = 1
While count <= mdays(thismonth)
For b = startspace To 6
ccode = ccode & "<td align=""center"""
If count=thisdate+1 Then
ccode = ccode & " class=""today"" title=""今天"""
End if
ccode = ccode & ">"
linkTrue = "False"
For c = 0 To UBound(linkdays, 2)
If linkdays(0, c) <> "" Then
If linkdays(0, c) = thismonth And linkdays(1, c) = count Then
ccode = ccode & "<a href=""" & linkdays(2, c) & """ title=""查看"&thisyear&"年"&thismonth&"月"&count&"日的日志"">"
linkTrue = "True"
End If
End If
Next
If count <= mdays(thismonth) Then ccode = ccode & count
If linkTrue = "True" Then ccode = ccode & "</a>"
ccode = ccode & "</td>" & vbCrLf
count = count + 1
Next
If count > mdays(thismonth) Then
ccode = ccode & "</tr>" & vbCrLf
Else
ccode = ccode & "</tr><tr>" & vbCrLf
End If
startspace = 0
Wend
ccode = ccode & "</tbody>" & vbCrLf
ccode = ccode & "</table>" & vbCrLf
If Int(c_month) < 10 Then c_month = "0" & c_month
'ccode = "<div id=""calendar"">" & ccode & "</div>"
savefile user_path, "\calendar\" & c_year & c_month & ".htm", ccode
End Sub
Public Function filt_pwblog(show, log_title)
update_info (user_id)
update_subject (user_id)
update_newblog (user_id)
update_newmessage (user_id)
update_links (user_id)
update_comment (user_id)
Update_placard (user_id)
Update_friends (user_id)
Update_mygroups (user_id)
'show=Replace(show,"$show_calendar$",oblog.readfile(user_path&"\calendar",log_month&".htm"))
show = Replace(show, "$show_placard$", "<div id=""placard"">"&m_placard&"</div>")
show = Replace(show, "$show_subject$", "<div id=""subject"">"&m_subject&"</div>")
show = Replace(show, "$show_subject_l$", "<div id=""subject_l"">"&m_subject&"</div>")
show = Replace(show, "$show_newblog$", "<div id=""newblog"">"&m_newblog&"</div>")
show = Replace(show, "$show_comment$", "<div id=""comment"">"&m_comment&"</div>")
show = Replace(show, "$show_newmessage$", "<div id=""newmessage"">"&m_newmessage&"</div>")
show = Replace(show, "$show_links$", "<div id=""links"">"&m_links&"</div><div id=""gg_userlinks""></div>")
show = Replace(show, "$show_info$", "<div id=""info"">"&m_info&"</div><div id=""aobomusic""></div>")
show = Replace(show, "$show_blogname$", blogname)
show = Replace(show, "$show_myfriend$", "<div id=""myfriend"">" &m_friends&"</div>")
show = Replace(show, "$show_mygroups$", "<div id=""mygroups"">"&m_mygroups&"</div>")
show = Replace(show, "$show_blogurl$", user_trueurl)
'show = Replace(show, "$show_photo$", "<div id=""ob_miniphoto""></div><script>var so = new SWFObject("""&blogurl&"miniphoto.swf?blogurl="&blogurl&"&userid="&user_id&"&gourl="&user_truepath&"cmd."&f_ext&"?uid="&user_id&"$do=album"", ""miniphoto"", ""100%"", ""180"", ""9"", ""#FFFFFF"");so.addParam(""wmode"", ""transparent"");so.write(""ob_miniphoto"");<script>")
show = Replace(show, "$show_photo$", "<div id=""ob_miniphoto""><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='100%' height='180' align='middle'><param name=""wmode"" value=""transparent"" /><param name='movie' value='"&blogurl&"miniphoto.swf?blogurl="&blogurl&"&userid="&user_id&"&gourl="&user_truepath&"cmd."&f_ext&"?uid="&user_id&"$do=album' /><param name='quality' value='high' /><embed src='"&blogurl&"miniphoto.swf?blogurl="&blogurl&"&userid="&user_id&"&gourl="&user_truepath&"cmd."&f_ext&"?uid="&user_id&"$do=album' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100%' height='180'></embed></object></div>")
show = Replace(show, "#gg_usercomment#", "<div id=""gg_usercomment""></div>")
show=Replace(show,"$show_xml$","<div id=""xml""><span id=""txml""></span><br /><a href="""&user_truepath&"rss2.Xml"" target=""_blank""><img src='" & blogurl & "images/xml.gif' width='36' height='14' border='0' /></a></div>")
show=Replace(show,"$show_search$","<div id=""search""></div>" )
show=Replace(show,"$show_login$","<div id=""ob_login""></div>")
show="<script src=""inc/main.js"" type=""text/javascript""></script>"&VbCrLf&show
show="<link href=""OblogStyle/OblogUserDefault4.css"" rel=""stylesheet"" type=""text/css"" />"&VbCrLf&"</head>"&VbCrLf&"<body><span id=""gg_usertop""></span>"&show
show=show&"<div id=""powered""><a href=""http://www.oblog.cn"" target=""_blank""><img src=""images/oblog_powered.gif"" border=""0"" alt=""Powered by Oblog."" /></a></div>"&VbCrLf&"<span id=""gg_userbot""></span></body>"&VbCrLf&"</html>"
show="<title>"&log_title&"</title>"&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
If InStr(show, "<div id=""oblog_edit"">") Then
show = show & "<script src=""" & blogurl & "count.asp?action=code31""></script>" & vbCrlf
show = show & "<script src=""" & blogurl & "commentedit.asp""></script>" & vbCrlf
End If
If InStr(show, "<div id=""blogzhai"">") Then
show = show & "<script src=""" & blogurl & "inc/inc_zhai.js""></script>" & vbCrlf
End If
show =repl_JS(show)
show = Replace(show,"#CreateFunctionPage#","")
filt_pwblog = show
End Function
'---------------------------
'清除用户模板缓存.by 蓝色 2007年6月25日
Public Sub remove_user_skin_cache()
'分步清除是为了最大的容错.
If Application(Cache_Name & "_user_skin_main") <> "" Then
Application.Lock
Application.Contents.Remove (Cache_Name & "_user_skin_main")
Application.unLock
End If
If Application(Cache_Name & "_user_skin_showlog") <> "" Then
Application.Lock
Application.Contents.Remove (Cache_Name & "_user_skin_showlog")
Application.unLock
End If
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 ORDER BY logid", 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)
uid = CLng(uid)
oblog.CreateUserDir uid, 0
userid = uid
update_partlog uid,lastlogid
update_usite(uid)
End Sub
Public Sub Update_subjectlog(uid,subjectid)
uid = CLng(uid)
userid = uid
Dim p,i,rs1
set rs1=Server.CreateObject("Adodb.RecordSet")
rs1.open "select logid FROM oblog_log WHERE userid="&uid&" and isdraft=0 and isdel=0 and subjectid = "&subjectid & " ORDER BY logid ",conn,1,1
if rs1.eof then
rs1.Close
set rs1=nothing
progress 100, "更新当前专题日志完成!"
exit sub
end if
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)
rs1.movenext
Wend
rs1.close
set rs1=Nothing
update_usite(uid)
End Sub
public sub update_partlog(uid,lid)
dim p,i,rs1,lastid
uid=Int(uid)
lid=CLng(lid)
i=1
userid=uid
set rs1=Server.CreateObject("Adodb.RecordSet")
rs1.open "select TOP " & P_BLOG_UPDATEPAUSE &" logid FROM oblog_log WHERE userid="&uid&" and isdraft=0 and isdel=0 and logid>"&lid & " ORDER BY logid ",conn,1,1
if rs1.eof then
rs1.Close
set rs1=nothing
progress 100, "更新所有日志完成!"
exit sub
end if
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)
lastid=rs1(0)
i=i+1
rs1.movenext
Wend
rs1.close
set rs1=oblog.execute("select top 1 logid from oblog_log where userid=" & uid & " and isdraft=0 and isdel=0 and logid>"&lastid)
if rs1.eof then
set rs1=Nothing
progress 100, "更新所有日志完成!"
exit Sub
End if
rs1.Close
set rs1=Nothing
Dim ttime
ttime = oblog.CacheConfig(28)
If ttime <> "" Then ttime = CLng (ttime) Else ttime = 5
If ttime > 60 Then ttime = 5
If ttime > 0 Then
progress 100, ttime&"秒后自动更新
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -