Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Event Calendar Mod problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

n10sive
Starting Member

1 Posts

Posted - 01 October 2005 :  16:58:26  Show Profile  Reply with Quote
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:

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


Replace this with the following 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


<

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 04 October 2005 :  16:25:54  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Nice one! Good thinking, and nicely spotted!<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 19 October 2005 :  21:18:49  Show Profile  Send StephenD a Yahoo! Message  Reply with Quote
Couple of changes required to get this working on the non-recurring version:

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:
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.
<
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07