Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Mod: List your events on other pages
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mod: List your events on other pages

 Post Reply Post Reply
Author
Apps4Me View Drop Down
Newbie
Newbie


Joined: 12 December 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Apps4Me Quote  Post ReplyReply Direct Link To This Post Topic: Mod: List your events on other pages
    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 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
%>

Back to Top
billd3 View Drop Down
Senior Member
Senior Member


Joined: 19 February 2003
Location: United States
Status: Offline
Points: 530
Post Options Post Options   Thanks (0) Thanks(0)   Quote billd3 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
billd3 View Drop Down
Senior Member
Senior Member


Joined: 19 February 2003
Location: United States
Status: Offline
Points: 530
Post Options Post Options   Thanks (0) Thanks(0)   Quote billd3 Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 10:47pm
Who is the CSS expert on two column setups?
Please see:
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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.