<% '*********************************************************************** '** Copyright (C) 2001 - 2004 Max Yuan All Rights Reserved '** '** By using this program, you are agreeing to the terms of the '** GNU General Public License. '** '** This program is free software; you can redistribute it and/or '** modify it under the terms of the GNU General Public License '** as published by the Free Software Foundation; either version 2 '** of the License, or any later version. '** '** All copyright notices regarding MaxWebPortal must remain intact '** in the scripts and in the outputted HTML. '** The "powered by" text/logo with a link back to '** http://www.maxwebportal.com in the footer of the pages MUST '** remain visible when the pages are viewed on the internet or intranet. '** '** Support can be obtained from support forums at: '** http://www.maxwebportal.com '** '** Email: maxwebportal@hotmail.com '** ICQ: 148111300 '*********************************************************************** %> <% if Request.QueryString("TOPIC_ID") <> "" or Request.QueryString("TOPIC_ID") <> " " then if IsNumeric(Request.QueryString("TOPIC_ID")) = True then strRqTopicID = cLng(Request.QueryString("TOPIC_ID")) else Response.Redirect("fhome_ng.asp") end if end if if Request.QueryString("FORUM_ID") <> "" or Request.QueryString("FORUM_ID") <> " " then if IsNumeric(Request.QueryString("FORUM_ID")) = True then strRqForumID = cLng(Request.QueryString("FORUM_ID")) else Response.Redirect("fhome_ng.asp") end if end if if strRqTopicID <> "" then set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString if (strAuthType = "nt") then set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString call NTauthenticate() if (ChkAccountReg() = "1") then call NTUser() end if end if '## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "TOPICS.CAT_ID, " & strTablePrefix & "TOPICS.FORUM_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_REPLIES " strSql = strSql & " FROM " & strTablePrefix & "TOPICS, " & strTablePrefix & "FORUM " strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & strRqTopicID strSql = strSql & " AND " & strTablePrefix & "TOPICS.FORUM_ID = " & strTablePrefix & "FORUM.FORUM_ID" set rsTopicInfo = my_Conn.Execute (StrSql) if (rsTopicInfo.EOF and rsTopicInfo.BOF) then Response.Redirect "fhome_ng.asp" else ReTopicId = RsTopicInfo("TOPIC_ID") ReForumId = RsTopicInfo("FORUM_ID") ReCatId = RsTopicInfo("CAT_ID") ReForumTitle = ChkString(RsTopicInfo("F_SUBJECT"),"urlpath") ReTopicTitle = ChkString(RsTopicInfo("T_SUBJECT"),"urlpath") RsTReplies = rsTopicInfo("T_REPLIES") RsTopicInfo.Close set RsTopicInfo = nothing if request.querystring("view") = "lasttopic" and not RsTReplies = 0 then strSql = "SELECT " & strTablePrefix & "REPLY.REPLY_ID " strSql = strSql & " FROM " & strTablePrefix & "REPLY " 'if not trim(Session(strCookieURL & "last_here_date")) = "" then 'strSql = strSql & " WHERE " & strTablePrefix & "REPLY.TOPIC_ID = " & strRqTopicID & " AND " & strTablePrefix & "REPLY.R_DATE > '" & Session(strCookieURL & "last_here_date") & "' ORDER BY R_DATE ASC" 'else strSql = strSql & " WHERE " & strTablePrefix & "REPLY.TOPIC_ID = " & strRqTopicID & " ORDER BY R_DATE DESC" 'end if set rsReplyInfo = my_Conn.Execute (StrSql) if (rsReplyInfo.EOF and rsReplyInfo.BOF) then Response.Redirect "topic_ng.asp?TOPIC_ID=" & ReTopicId & "&FORUM_ID=" & ReForumId & "&CAT_ID=" & ReCatId & "&Forum_Title=" & ReForumTitle & "&Topic_Title=" & ReTopicTitle else replyIde = RsReplyInfo("REPLY_ID") totalReplies = RsTReplies pageNum = 0 do while not totalReplies =< 0 totalReplies = totalReplies - strPageSize pageNum = pageNum + 1 loop RsReplyInfo.Close set RsReplyInfo = nothing Response.Redirect "topic_ng.asp?TOPIC_ID=" & ReTopicId & "&FORUM_ID=" & ReForumId & "&CAT_ID=" & ReCatId & "&Forum_Title=" & ReForumTitle & "&Topic_Title=" & ReTopicTitle & "&whichpage=" & pageNum & "&tmp=1#pid" & replyIde end if else Response.Redirect "topic_ng.asp?TOPIC_ID=" & ReTopicId & "&FORUM_ID=" & ReForumId & "&CAT_ID=" & ReCatId & "&Forum_Title=" & ReForumTitle & "&Topic_Title=" & ReTopicTitle end if end if 'download this portal at maxwebportal.com elseif strRqForumID <> "" then set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString if (strAuthType = "nt") then set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString call NTauthenticate() if (ChkAccountReg() = "1") then call NTUser() end if end if '## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "FORUM.F_SUBJECT " strSql = strSql & " FROM " & strTablePrefix & "FORUM " strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & strRqForumID set rsForumInfo = my_Conn.Execute (StrSql) if (rsForumInfo.EOF and rsForumInfo.BOF) then Response.Redirect "fhome_ng.asp" else Response.Redirect "forum_ng.asp?FORUM_ID=" & rsForumInfo("FORUM_ID") & "&CAT_ID=" & rsForumInfo("CAT_ID") & "&Forum_Title=" & ChkString(rsForumInfo("F_SUBJECT"),"urlpath") end if else Response.Redirect "fhome_ng.asp" Response.End end if %>