Event Calendar Mod problem - Posted (894 Views)
Starting Member
n10sive
Posts: 1
1
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

<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
Nice one! Good thinking, and nicely spotted!<
Posted
Senior Member
StephenD
Posts: 1044
1044
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. <
 
You Must enter a message