%@ LANGUAGE = "VBScript" %>
<% Option Explicit %>
<% Response.Buffer = True %>
<% Response.Expires = -1 %>
<% Response.CacheControl = "Public" %>
<%
'****************************************************************************************
'** Copyright Notice
'**
'** iPortalX.com
'**
'** Copyright 2001-2003 Drew Gauderman All Rights Reserved.
'**
'** This program is a paid software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may NOT use parts of this program in your own private work, and you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** All links to iPortalX.com and powered by logo's (if any) must remain unchanged and in place
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** Support is for those that have purchased it. Post support questions at: -
'** http://www.iportalx.com/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -
'** support@iportalx.com
'**
'****************************************************************************************
Dim rsCount
Dim intThreadID
Dim intNewsID
Dim strNewsImage
If bannedIP() Then
'If the user is using a banned IP then set the banned IP variable to true and active member variable to false
blnActiveMember = False
End If
intNewsID = Clng(Request.QueryString("NewsID"))
If intNewsID = 0 Then
Set rsNews = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("default.asp")
End If
Dim rsNews
Dim intForumReadRights
Dim intForumPostRights
Dim intForumReplyRights
Dim blnHideForum
Dim intNewsForumID
Dim intNewsTopicID
Dim strNewsItem
Dim strNewsSubject
Dim intNewsAuthorID
Dim strNewsAuthorUsername
Dim dtmCreatedDate
Dim intNewsTotalViews
Dim intNewsType
Dim intCommentsCount
Dim dtmTempDate
Set rsNews = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT " & strDBTableTopics & ".Subject, " & strDBTableTopics & ".Start_date, " & strDBTableTopics & ".News_image, " & strDBTableTopics & ".No_of_views, " & strDbTable & "Thread.*, " & strDBTableTopics & ".Forum_ID, " & strDbTable & "Author.Username "
strSQL = strSQL & "FROM " & strDBTableTopics & " INNER JOIN (" & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) ON " & strDBTableTopics & ".Topic_ID = " & strDbTable & "Thread.Topic_ID "
strSQL = strSQL & "WHERE " & strDBTableTopics & ".Topic_ID = " & intNewsID & ";"
rsNews.Open strSQL, adoCon
If NOT rsNews.EOF Then
intNewsForumID = rsNews("Forum_ID")
strSQL = "SELECT " & strDbTable & "Forum.* FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.Forum_ID = " & intNewsForumID & ";"
rsCommon.Open strSQL, adoCon
If NOT rsCommon.EOF Then
'Read in forum details from the database
intForumReadRights = CInt(rsCommon("Read"))
intForumPostRights = CInt(rsCommon("Post"))
intForumReplyRights = CInt(rsCommon("Reply_posts"))
blnHideForum = CBool(rsCommon("Hide"))
Call forumPermisisons(intNewsForumID, intGroupID, intForumReadRights, intForumPostRights, intForumReplyRights, 0, 0, 0, 0, 0, 0, 0)
If blnHideForum = False AND blnRead = False Then
rsCommon.Close
Set rsCommon = Nothing
Set rsNews = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("forum/insufficient_permission.asp?Redirect=" & RedirectOmitPath("Redirect", True))
End If
End If
rsCommon.Close
End If
%>
<% = strWebsiteName %> - <% = strTxtNewsItems %>
<%
Set rsCount = Server.CreateObject("ADODB.Recordset")
If rsNews.EOF Then
%>
<% = strTxtNoNewsItems %> |
| <% = strTxtNoNewsItems %> |
|
<%
intThreadID = 0
Else
intNewsTopicID = Clng(rsNews("Topic_ID"))
strNewsItem = rsNews("Message")
strNewsSubject = rsNews("Subject")
intNewsAuthorID = Clng(rsNews("Author_ID"))
strNewsAuthorUsername = rsNews("Username")
dtmCreatedDate = rsNews("Start_date")
intNewsTotalViews = rsNews("No_of_views")
intNewsType = Clng(rsNews("News"))
intThreadID = Clng(rsNews("Thread_ID"))
strNewsImage = rsNews("News_image")
strSQL = "SELECT Count(" & strDbTable & "Thread.Thread_ID) AS Comments_Count FROM " & strDbTable & "Thread "
strSQL = strSQL & "WHERE " & strDbTable & "Thread.Topic_ID = " & intNewsTopicID & ";"
rsCount.Open strSQL, adoCon
intCommentsCount = Clng(rsCount("Comments_Count") - 1)
rsCount.Close
Call FormatNewsDisplay(intNewsTopicID, strNewsItem, strNewsSubject, intNewsAuthorID, strNewsAuthorUsername, dtmCreatedDate, intNewsTotalViews, intNewsType, intNewsForumID, intCommentsCount, strNewsImage)
End If
rsNews.Close
Set rsCount = Nothing
If intThreadID <> 0 Then
%>
<%
strSQL = "SELECT " & strDbTable & "Thread.*, " & strDbTable & "Author.Username FROM " & strDbTable & "Thread "
strSQL = strSQL & "INNER JOIN " & strDbTable & "Author ON " & strDbTable & "Thread.Author_ID = " & strDbTable & "Author.Author_ID "
strSQL = strSQL & "WHERE " & strDbTable & "Thread.Topic_ID = " & intNewsID & " AND NOT " & strDbTable & "Thread.Thread_ID = " & intThreadID & ";"
rsNews.Open strSQL, adoCon
If rsNews.EOF Then
Call FormatTopTable("100%")
%>
<% = strTxtNoComments %> |
| <% = strTxtNoOneHasMadeAnyComments %> |
<%
Call FormatBottomTable("100%")
Else
DO UNTIL rsNews.EOF
strNewsItem = rsNews("Message")
intNewsAuthorID = Clng(rsNews("Author_ID"))
strNewsAuthorUsername = rsNews("Username")
dtmCreatedDate = rsNews("Message_date")
intNewsType = Clng(rsNews("News"))
Call FormatNewsCommentsDisplay(strNewsItem, intNewsAuthorID, strNewsAuthorUsername, dtmCreatedDate)
rsNews.Movenext
Loop
End If
rsNews.Close
dtmTempDate = FormatDateTime(dtmCreatedDate, 2)
End If
Call FormatTopTable2("100%")
%>
| <% = strTxtBackToHome %> | <% = strTxtPostComments %> |
<% Call FormatBottomTable("100%") %>
<%
Set rsNews = Nothing
adoCon.Close
Set adoCon = Nothing
%>