Event Calendar Mod problem

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/59708?pagenum=1
05 November 2025, 16:53

Topic


n10sive
Event Calendar Mod problem
01 October 2005, 16:58


If you use private forums and notice that the calendar control highlights the dates of your events for guests, you can apply this mod to cal_functions.asp to correct the problem.
Find the two places in cal_functions.asp (line 85 and 235 aprox) that looke like:
Code:

If not rs.EOF then strDates = rs.GetString(,,,",") else blnNoDates = TRUE 

Replace this with the following code:

Code:

if not(rs.EOF or rs.BOF) then
rs.MoveFirst
do until rs.EOF
if chkForumAccess(rs("FORUM_ID"),MemberID,FALSE) then
if len(strDates) > 0 then strDates = strDates & ","
strDates = strDates & rs("EVENT_DATE")
end if
rs.MoveNext
loop
else
blnNoDates = TRUE
end if

<

 

Replies ...


MarcelG
04 October 2005, 16:25


Nice one! Good thinking, and nicely spotted!<
StephenD
19 October 2005, 21:18


Couple of changes required to get this working on the non-recurring version:

Code:
if not(rs.EOF or rs.BOF) then
rs.MoveFirst
do until rs.EOF
if chkForumAccess(rs("FORUM_ID"),MemberID,FALSE) then
if len(strDates) > 0 then strDates = strDates & ","
strDates = strDates & rs("T_EVENT_DATE")
end if
rs.MoveNext
loop
else
blnNoDates = TRUE
end if

Also, need to add FORUM_ID to the SELECT and GROUP BY clauses in the query just before this code block:
Code:
strSql = "SELECT T_EVENT_DATE, FORUM_ID FROM " & strTablePrefix & "TOPICS " & _
"WHERE (T_ISEVENT=1) " & _
"AND (T_EVENT_DATE >= '" & datetostr(DateSerial(Year(dateToDraw),Month(dateToDraw),1)) & "') " & _
"AND (T_EVENT_DATE < '" & datetostr(DateSerial(Year(dateToDraw),Month(dateToDraw)+1,1)) & "') " & _
"GROUP BY T_EVENT_DATE, FORUM_ID " & _
"ORDER BY T_EVENT_DATE Asc"

set rs = Server.CreateObject("ADODB.Recordset")
rs.open StrSql, My_conn

Works great.. this had always bugged me. <
© 2000-2021 Snitz™ Communications