| |
<%'###############################################
'function to format the date and time
Function FormatDate(sDate)
dim sTime, sMonth, sDay
sTime = ""&FormatDateTime(sDate,4)&""
sMonth = MonthName(Month(sDate))
sDay = Day(sDate)
FormatDate = sDay&" "&sMonth&" "&sTime
End Function
'this will be displayed without the heading and footer for members forums
dim iForumID, sOrderBy, rsForum, rsMessageBoard
'set the defaults
iForumID = 1
'If Trim(request("ID"))<>"" then iForumID = request("ID")
'get the forum
sSQL = "Select * From tblForum Where Forum_Id = " &iForumID
Set rsForum = Server.CreateObject("ADODB.Recordset")
rsForum.open sSQL, oConn, adOpenStatic, adLockOptimistic
If (rsForum.BOF And rsForum.EOF) then
'email the error description and URL to the admin
dim oMail, sURL
Set oMail = Server.CreateObject("CDONTS.NewMail")
sURL = request("URL")&request.Querystring
oMail.To = "admin@chrismallett.com"
oMail.From = "system@chrismallett.com"
oMail.Subject = "Forum Error"
oMail.Body = "An error has occurred with one of the forums - ""No records found""."&chr(10)&chr(13)&"The URL is: "&sURL
oMail.Send
Set oMail = Nothing%>
 |
| Error: No forums have been found. |
 |
| An email has been sent to the forum administrator indicating that this has occurred. |
<%Else%>
| |
<%'##############################################
'get all the messageboards in this forums and their moderators
sOrderBy = "Messageboard_Title"
sSQL = "Select * From tblMessageboard Where Forum_Id = "&rsForum("Forum_Id")&" Order By "&sOrderBy
Set rsMessageboard = Server.CreateObject("ADODB.Recordset")
rsMessageboard.Open sSQL, oConn, adOpenStatic, adLockOptimistic
If Not (rsMessageboard.EOF And rsMessageboard.BOF) Then %>
 |
| Discussion |
Topics |
Posts |
Last Post |
Moderators |
 |
<%'loop through the records
While Not rsMessageboard.EOF%>
 |
" onMouseOver="window.status=' -- View this messageboard -- ';return true;" onMouseOut="window.status='';" class="link"><%=rsMessageboard("MessageBoard_Title")%>
<%=rsMessageboard("Messageboard_Description")%> |
<%=rsMessageboard("Messageboard_NoTopics")%> |
<%=rsMessageboard("Messageboard_NoPosts")%> |
<%=FormatDate(rsMessageboard("MessageBoard_LastPost"))%> |
<%'get the moderators for each messageboard
Set rsModerators = Server.CreateObject("ADODB.Recordset")
sSQL = "Select User_Name From tblUsers INNER JOIN tblModerator ON tblModerator.User_Id = tblUsers.User_Id "
sSQL = sSQL& " Where tblModerator.MessageBoard_Id = "&rsMessageBoard("MessageBoard_Id")&" Order By User_Name"
rsModerators.Open sSQL, oConn, adOpenStatic, adLockOptimistic
sModerators = " "
While Not rsModerators.EOF
sModerators = rsModerators("User_Name")&","
rsModerators.MoveNext
Wend
rsModerators.Close : Set rsModerators = Nothing
sModerators = Left(sModerators, Len(sModerators)-1)
response.write sModerators%>
|
<%rsMessageboard.MoveNext
Wend%>
<%Else%>
 |
| No discussion boards found on this forum |
 |
<%End If
rsMessageboard.Close : Set rsMessageboard = Nothing%>
|
<%End If
rsForum.Close : Set rsForum = Nothing%>
|
|
 |