Print Page | Close Window

Mod: List your events on other pages

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25215
Printed Date: 30 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mod: List your events on other pages
Posted By: Apps4Me
Subject: Mod: List your events on other pages
Date Posted: 27 January 2008 at 3:21am

Ok, I like the event/calendar feature of the forum, but wanted users to have an easier way to find and promote their events, rather than scrolling through posts or pages of a calendar.

The mod creates a way for you to have a list of your events in a div on any other page of your site.  Check out my main page http://www.swvhc.com - www.swvhc.com , you'll see a frame (css) on the right side that has a list of events, actively generated from the database, filtered to start with current date (no old events) and run one year.  Hyperlinks take you to the appriate forum.

As a side note, if you look at my forum events/calendar submissions you'll see it's been modified as well, different buttons to add event, removed the end date, etc...
 
Anyways, The mod started with the rss file for calendar, but is a lot trimmer.
Show below: the html used to include the set of links & dates, and the file calendarbox.asp which generates the list.
 
html:
 <div 
  <!-- #include file="forum/calendarbox.asp" -->
 </div>
You can view the source from my homepage to see all the css used to format
(btw, the site is 100% css, can't believe I'm free of tables :) )
 
Here is the file calendarbox.asp

<!-- #include file="database/database_connection.asp" -->
<!-- #include file="language_files/language_file_inc.asp" -->
<!-- #include file="functions/functions_common.asp" -->
<!-- #include file="includes/setup_options_inc.asp" -->
<!-- #include file="includes/global_variables_inc.asp" -->

<%
'Open database connection and load configuration
Call openDatabase(strCon)
Call getForumConfigurationData()

'Declare variables
Dim sarryRssTopics 'Holds the RSS Feed recordset
Dim intCurrentRecord 'Holds the current record in the array

Dim lngTopicID  'Holds the topic ID
Dim lngMessageID 'Holds the message ID
Dim strSubject  'Holds the subject
Dim dtmEventMonth 'Holds the event month
Dim dtmEventDay  'Holds the event day
Dim dtmEventYear 'Holds the event year

Dim dtmDbStartDate 'Holds the database search start date
Dim dtmDbEndDate 'Holds the database search end date

dtmDbStartDate = internationalDateTime(Now())
dtmDbEndDate = internationalDateTime(DateAdd("yyyy", 1, Now()))


'SQL Server doesn't like ISO dates with '-' in them, so remove the '-' part
If strDatabaseType = "SQLServer" Then
 dtmDbStartDate = Replace(dtmDbStartDate, "-", "", 1, -1, 1)
 dtmDbEndDate = Replace(dtmDbEndDate, "-", "", 1, -1, 1)
End If

'Place the date in SQL safe # or '
If strDatabaseType = "Access" Then
 dtmDbStartDate = "#" & dtmDbStartDate & "#"
 dtmDbEndDate = "#" & dtmDbEndDate & "#"
Else
 dtmDbStartDate = "'" & dtmDbStartDate & "'"
 dtmDbEndDate = "'" & dtmDbEndDate & "'"
End If

strSQL = "SELECT " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Thread.Message, " & strDbTable & "Topic.Event_date, " & strDbTable & "Topic.Event_date_end " & _
"FROM " & strDbTable & "Forum, " & strDbTable & "Topic, " & strDbTable & "Author, " & strDbTable & "Thread " & _
"WHERE " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " & _
 "AND " & strDbTable & "Topic.Start_Thread_ID = " & strDbTable & "Thread.Thread_ID " & _
 "AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " & _
 "AND " & strDbTable & "Topic.Event_date BETWEEN " & dtmDbStartDate & " AND " & dtmDbEndDate & _
 "ORDER BY " & strDbTable & "Topic.Event_date " & "ASC;"

 

'Query the database
rsCommon.Open strSQL, adoCon

'Read in db results
If NOT rsCommon.EOF Then
 'Place the db results into an array
 sarryRssTopics = rsCommon.GetRows()
End If

'Close and clear
rsCommon.Close
Call closeDatabase()

'Loop through recordset, read data, and display all events in the next year

Do While intCurrentRecord <= Ubound(sarryRssTopics, 2)
 lngTopicID = CLng(sarryRssTopics(1, intCurrentRecord))
 lngMessageID = CLng(sarryRssTopics(3, intCurrentRecord))
 strSubject = sarryRssTopics(2, intCurrentRecord) 
 dtmEventMonth = MonthName(Month((sarryRssTopics(8, intCurrentRecord))),False)
 dtmEventDay = Day((sarryRssTopics(8, intCurrentRecord)))
 dtmEventYear = Year((sarryRssTopics(8, intCurrentRecord)))
 
 Response.Write("<div class=""calendarlink"">")
  Response.Write("<a href=""" & strForumPath & "forum_posts.asp?TID=" & lngTopicID & "&amp;PID=" & lngMessageID & """>" & strSubject &"</a>")
 Response.Write("</div>")
 
 Response.Write("<div class=""calendardate"">")
  Response.Write(dtmEventMonth & " " & dtmEventDay & ", " & dtmEventYear)
 Response.Write("</div>")

   intCurrentRecord = intCurrentRecord + 1
Loop
%>




Replies:
Posted By: billd3
Date Posted: 07 March 2008 at 3:57am
WOW. I need to hire you to split ours into two columns like that. Oh, I could do it, I've laid out entire sites with nothing but CSS, no tables, but time is a factor......... I don't have any!

That's a very attractive site, and really fits the theme or purpose.  You've got to be pleased with it.
I'd like to move the forum to the right, put a column on the left with the calendar like you did, below a simple menu in the upper left.


-------------
BillD
http://theamcpages.com
http://theamcforum.com


Posted By: MadDog
Date Posted: 07 March 2008 at 4:56pm
If you use CODE tags the code wont be wrapped and make it easier for people to copy and paste.

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: billd3
Date Posted: 09 March 2008 at 10:47pm
Who is the CSS expert on two column setups?
Please see:
http://forums.webwiz.net/forum_posts.asp?TID=25419&PID=131888#131888 - http://forums.webwiz.net/forum_posts.asp?TID=25419&PID=131888#131888
where I've tried to use this really cool addition to the forums, but it only looks good in IE, IE6 and 7 look GREAT, but not firefox or opera.
Years ago I used similar code, and it worked in all browsers, what have I broke??


-------------
BillD
http://theamcpages.com
http://theamcforum.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net