Messages Board
|
Forums
And Topics |
<%If Session(C_USER_NICKNAME) <> Empty Then %>
User Name :<%=server.HTMLEncode(Session(C_USER_NICKNAME)) %> |
Sign
Off |
<%Else%>
Sign
In |
<%End If%>
<% If (strForumID<>"" And strForumID<>"0") And Session(C_USER_TYPE) Then%>
Add new topic |
<%End If%>
<% Dim strPage,strPagenumber
strPagenumber = Request("iPageNO")
strPage = ""
If strPagenumber <> "" Then
Select Case CInt(strPagenumber)
Case I_MESSAGES_PAGE
strPage = "Messages.asp"
Case I_POST_ANSWERS_PAGE
strPage ="Reply.asp"
Case I_TELL_A_FRIEND_PAGE
strPage ="TellAFriend.asp"
Case I_POST_QUESTIONS_PAGE
strPage = "PostQuestions.asp"
Case I_ADD_TOPICS_PAGE
strPage = "AddTopics.asp"
Case I_LOGIN_PAGE
strPage = "Login.asp"
Case I_REGISTRATION_PAGE
strPage = "Registration.asp"
Case I_FORUMSGRID_PAGE
strPage = "ForumsGrid.asp"
Case I_FORUM_PAGE
strPage = "Forums.asp"
Case I_PROFESSIONSGRID_PAGE
strPage = "ProfessionGrid.asp"
Case I_PROFESSIONS_PAGE
strPage = "Profession.asp"
Case I_TOPICS_PAGE
strPage = "Topics.asp"
Case I_TOPICSGRID_PAGE
strPage = "TopicsGrid.asp"
Case I_QUESTIONSGRID_PAGE
strPage = "QuestionsGrid.asp"
case I_FORGOT_PASSWORD
strPage = "forgotforumpass.asp"
Case else
strPage = "Discussions.asp"
End Select
Else
strPage = "Discussions.asp"
End If
If strPage <> "Discussions.asp" Then
Server.Execute strPage
End If
%> |
<%
Dim dbOps,strSelectSQL, rsForums, intForumID, rsTopics, conn,forumpost
Set conn = Server.CreateObject("ADODB.Connection")
Set rsForums = Server.CreateObject("ADODB.Recordset")
Set rsTopics = Server.CreateObject("ADODB.Recordset")
strSelectSQL = "SELECT * FROM ForumTable ORDER BY Forum_Name"
conn.Open C_CONNECTION_STRING
Set rsForums = conn.Execute(strSelectSQL)
if( Session(C_USER_TYPE)) then
While Not rsForums.Eof
forumpost="Discussions.asp?iForumID=" & rsForums("Forum_ID")
%>
-
<%=rsForums("Forum_Name")%>
<%
if( CInt(rsforums("forum_ID"))= CInt(strForumID)) then
strSQL="SELECT * FROM TopicsTable WHERE Forum_ID = " & rsForums("Forum_ID")
Set rsTopics = conn.Execute(strSQL)
Do While Not rsTopics.Eof
strQueryString = Request.ServerVariables("SCRIPT_NAME") & "?iPageNo=1&iTopicID=" & rsTopics("Topics_ID") & "&iForumID=" & strForumID & "&sLName=" & strLayerName
%>
<%
rsTopics.MoveNext
Loop
End If %>
<% rsForums.movenext
wend
else
Dim strLayerName, strToPassSHOW, strToPassHIDE
Dim strQueryString
Dim isQueryPresent
If Request("sLName")<>"" Then
isQueryPresent=Request("sLName")
End If
If Not rsForums.Eof Then
Do While Not rsForums.Eof
intForumID=rsForums("Forum_ID")
strLayerName = "Layer" & intForumID
strToPassSHOW = strLayerName & "Show"
strToPassHIDE = strLayerName & "Hide"
%>
- <%=rsForums("Forum_Name")%>
<%=rsForums("Forum_Name")%>
<%
strSQL="SELECT * FROM TopicsTable WHERE Forum_ID = " & intForumID
Set rsTopics = conn.Execute(strSQL)
%>
<% If Not rsTopics.Eof Then
%>
<%
Do While Not rsTopics.Eof
strQueryString = Request.ServerVariables("SCRIPT_NAME") & "?iPageNo=1&iTopicID=" & rsTopics("Topics_ID") & "&iForumID=" & intForumID & "&sLName=" & strLayerName
%>
<%
rsTopics.MoveNext
Loop
End If
%>
<%
rsTopics.Close
Set rsTopics = Nothing
rsForums.MoveNext
Loop
End If
rsForums.Close
Set rsForums = Nothing
conn.Close
Set conn = Nothing
End If
%>
|
|
|