<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Response.Buffer = False %> <% curpath = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") curpath = Left(curpath, InstrRev(curpath, "/")) %> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="" MM_authFailedURL="admin_default.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% Dim rsConfig Dim rsConfig_numRows Set rsConfig = Server.CreateObject("ADODB.Recordset") rsConfig.ActiveConnection = MM_blog_STRING rsConfig.Source = "SELECT * FROM tblBlogRSS" rsConfig.CursorType = 0 rsConfig.CursorLocation = 2 rsConfig.LockType = 1 rsConfig.Open() rsConfig_numRows = 0 %> RSS
<% ' Timer code Dim StopWatch(19) sub StartTimer(x) StopWatch(x) = timer end sub function StopTimer(x) EndTime = Timer 'Watch for the midnight wraparound... if EndTime < StopWatch(x) then EndTime = EndTime + (86400) end if StopTimer = EndTime - StopWatch(x) end function StartTimer 1 %>

RSS

<% Dim artRec Dim artRec_numRows Set artRec = Server.CreateObject("ADODB.Recordset") artRec.ActiveConnection = MM_blog_STRING artRec.Source = "SELECT * FROM tblBlog ORDER BY BlogDate DESC" artRec.CursorType = 0 artRec.CursorLocation = 2 artRec.LockType = 1 artRec.Open() artRec_numRows = 0 %> <% sFilename = "rss.xml" %> <% Dim oFSO Dim fFile ' create an instance of the FileSystemObject Set oFSO = Server.CreateObject ("Scripting.FileSystemObject") ' create file Set fFile = oFSO.CreateTextFile (Server.MapPath(sFilename)) %> <% Dim oRs__currentDate oRs__currentDate = "Month(Date())" If (Month(Date()) <> "") Then oRs__currentDate = Month(Date()) End If %> <% Dim rsBlogConfig Dim rsBlogConfig_numRows Set rsBlogConfig = Server.CreateObject("ADODB.Recordset") rsBlogConfig.ActiveConnection = MM_blog_STRING rsBlogConfig.Source = "SELECT * FROM tblBlogRSS" rsBlogConfig.CursorType = 0 rsBlogConfig.CursorLocation = 2 rsBlogConfig.LockType = 1 rsBlogConfig.Open() rsBlogConfig_numRows = 0 %> <% FUNCTION CropSentence(strText, intLength, strTrial) Dim wsCount Dim intTempSize Dim intTotalLen Dim strTemp wsCount = 0 intTempSize = 0 intTotalLen = 0 intLength = intLength - Len(strTrial) strTemp = "" IF Len(strText) > intLength THEN arrTemp = Split(strText, " ") FOR EACH x IN arrTemp IF Len(strTemp) <= intLength THEN strTemp = strTemp & x & " " END IF NEXT CropSentence = Left(strTemp, Len(strTemp) - 1) & strTrial ELSE CropSentence = strText END IF END FUNCTION %> <% Function return_RFC822_Date(myDate, offset) Dim myDay, myDays, myMonth, myYear Dim myHours, myMonths, mySeconds myDate = CDate(myDate) myDay = WeekdayName(Weekday(myDate),true) myDays = Day(myDate) myMonth = MonthName(Month(myDate), true) myYear = Year(myDate) myHours = zeroPad(Hour(myDate), 2) myMinutes = zeroPad(Minute(myDate), 2) mySeconds = zeroPad(Second(myDate), 2) return_RFC822_Date = myDay&", "& _ myDays&" "& _ myMonth&" "& _ myYear&" "& _ myHours&":"& _ myMinutes&":"& _ mySeconds&" "& _ offset End Function Function zeroPad(m, t) zeroPad = String(t-Len(m),"0")&m End Function %> <% sSiteTitle = (rsBlogConfig.Fields.Item("blogTitle").Value) sSiteDescr = (rsBlogConfig.Fields.Item("blogDesc").Value) sSiteURL = curpath if right(sSiteURL, 1) <> "/" then sSiteURL = sSiteURL & "/" end if sSiteDetails = "" sImageURL = (rsBlogConfig.Fields.Item("blogImage").Value) sFurtherReading = "" sAuthorNames = (rsBlogConfig.Fields.Item("blogAuthor").Value) sAuthorEmails = (rsBlogConfig.Fields.Item("blogEmail").Value) %> <% fFile.WriteLine ("") fFile.WriteLine ("") fFile.WriteLine ("") fFile.WriteLine (" ") fFile.WriteLine(" " & sSiteTitle & "") fFile.WriteLine(" " & sSiteURL & "") fFile.WriteLine(" " & sSiteDescr & "") fFile.WriteLine(" en-US") fFile.WriteLine(" " & return_RFC822_Date(Now(), "GMT") & "") %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 10 Repeat1__index = 0 artRec_numRows = artRec_numRows + Repeat1__numRows %> <% While ((Repeat1__numRows <> 0) AND (NOT artRec.EOF)) %> <% fFile.WriteLine (" ") fFile.WriteLine (" " & artRec("BlogHeadline") & "") fFile.WriteLine (" " & sSiteURL & "template_permalink.asp?id=" & artRec.Fields.Item("BlogID").Value & "") fFile.WriteLine (" ") fFile.WriteLine (" " & return_RFC822_Date(artRec.Fields.Item("BlogDate").Value, "GMT") & "") fFile.WriteLine (" ") %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 artRec.MoveNext() Wend %> <% ' Write out the End Channel Data tag and End RSS tag. fFile.WriteLine (" ") fFile.WriteLine ("") fFile.Close Set fFile = Nothing Set oFSO = Nothing %> <% rsBlogConfig.Close() Set rsBlogConfig = Nothing %> <% artRec.Close() Set artRec = Nothing %>

RSS published in <%=abs(round(StopTimer(1), 2))%> seconds.

Back to the main admin page.

<% rsConfig.Close() Set rsConfig = Nothing %>