|
|||
|
Hello, my name is Judas Gutenberg and this is my blaag (pronounced as you would the vomit noise "hyroop-bleuach").
linksdecay & ruin got that wrong appropriate tech fun social media stuff Like asecular.com (nobody does!) Like my brownhouse: |
I'd like a calendar... Saturday, December 2 2000
function GetLatestBTGJournalEntryID(byref dtmDate)
dim strSQL, intOut, rst
strSQL="select articleID, ReleaseDate from articles where ReleaseDate=(select max(releaseDate) from articles where SectionID=3)"
set rst=arst(strSQL)
if not rst.eof then
intOut=rst("articleID")
dtmDate=rst("ReleaseDate")
end if
set rst=nothing
GetLatestBTGJournalEntryID=intOut
end function
function ThisCalendar(dtmStart)
dim strOut, rst, intThisMonth, intMonth, dtmCursor, intDay
dim dtmLast, intArticleID, intWeekDay, intWeekDayFirst, arrThis(31), dtmLastDayLastMonth, dtmFirstDayNextMonth, i
if dtmStart="" then
intArticleID=GetLatestBTGJournalEntryID(dtmLast)
dtmLast=cdate(dtmLast)
else
dtmLast=cdate(dtmStart)
end if
intThisMonth=month(dtmLast)
dtmCursor= cdate(intThisMonth & "/01/" & year(dtmLast))
dtmLastDayLastMonth=dateadd("d", -1, dtmCursor)
dtmFirstDayNextMonth=dateadd("m", 1, dtmCursor)
intWeekDayFirst=weekday(dtmCursor)
set rst=aRst("select articleID, ReleaseDate from articles where ReleaseDate>'" & dtmLastDayLastMonth & "' and ReleaseDate<'" & dtmFirstDayNextMonth & "'")
i=1
do until rst.eof
arrThis(day(rst("ReleaseDate")))=rst("articleID")
i=i+1
rst.movenext
loop
set rst=nothing
strOut="<table bgcolor=990099 cellpadding=0 cellspacing=0 border=2>" & vbNewLine
intWeekDay=1
strOut=strOut & "<tr>" & vbNewLine
strOut=strOut & "<td colspan=7>" & vbNewLine
strOut=strOut & Monthname(intThisMonth) & " " & right(year(dtmLast), 2)
strOut=strOut & "</td>" & vbNewLine
strOut=strOut & "</tr>" & vbNewLine
strOut=strOut & "<tr>" & vbNewLine
i=0
do until intWeekDay=intWeekDayFirst or i>33
strOut=strOut & "<td> </td>" & vbNewLine
intWeekDay=intWeekDay+1
i=i+1
loop
intDay=1
i=0
intMonth=intThisMonth
do until intMonth<>intThisMonth or i>32
if weekday(dtmCursor)=1 then
strOut=strOut & "<tr>" & vbNewLine
end if
if arrThis(intDay)<>"" then
strOut=strOut & "<td><a href=today.asp?articleid=" & arrThis(intDay) & ">" & intDay & "</a></td>" & vbNewLine
else
strOut=strOut & "<td>" & intDay & "</td>" & vbNewLine
end if
if weekday(dtmCursor)=7 then
strOut=strOut & "</tr>" & vbNewLine
end if
dtmCursor=dateadd("d", 1, dtmCursor)
intMonth=month(dtmCursor)
intDay=day(dtmCursor)
i=i+1
loop
i=0
do until weekday(dtmCursor)=1 or i>8
strOut=strOut & "<td> </td>" & vbNewLine
dtmCursor=dateadd("d", 1, dtmCursor)
i=i+1
loop
strOut =strOut & "</tr></table>" & vbNewLine
ThisCalendar=strOut
end function
For linking purposes this article's URL is: previous | next |
||