Event Calendar Mod problem - Postet den (893 Views)
Starting Member
n10sive
Innlegg: 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

<
   
 Sidestørrelse 
Postet den
Retired Support Moderator
MarcelG
Innlegg: 2625
2625
Nice one! Good thinking, and nicely spotted!<
Postet den
Senior Member
StephenD
Innlegg: 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. <
 
Du må legge inn en melding