<%@ 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 intCatID Dim strCategoryName Dim intTotalNumNewsEntries Dim intTotalNumNewsPages Dim intLinkPageNum Dim blnSubmitLinks Dim blnSubCategories Dim intEntryShort Dim intEntryOrder Dim strEntryShort Dim strEntryOrder Dim intRecordPositionPageNum Dim saryCatPermissions 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 intCatID = Clng(Request.QueryString("CatID")) intEntryShort = Clng(Request.QueryString("SRT")) intEntryOrder = Clng(Request.QueryString("ORD")) If Request.QueryString("PN") = "" Then intRecordPositionPageNum = 1 Else intRecordPositionPageNum = CInt(Request.QueryString("PN")) End If strSQL = "SELECT " & strDbTable & "EntryCategory.Cat_name, " & strDbTable & "EntryCategory.Cat_permissions, " & strDbTable & "EntryCategory.Submit_entry, " & strDbTable & "EntryCategory.Type_ID FROM " & strDbTable & "EntryCategory " & _ "WHERE " & strDbTable & "EntryCategory.Cat_ID = " & intCatID & ";" rsCommon.Open strSQL, adoCon If rsCommon.EOF Then adoCon.Close Set rsCommon = Nothing Set adoCon = Nothing Response.Redirect("default.asp") Else strCategoryName = rsCommon("Cat_name") blnSubmitLinks = CBool(rsCommon("Submit_entry")) saryCatPermissions = rsCommon("Cat_permissions") & "" intTypeID = rsCommon("Type_ID") saryCatPermissions = Split(Trim(saryCatPermissions), ",") End If rsCommon.Close Call DirectoryDetials(intTypeID) If (CheckPermissions(saryCatPermissions) = False) OR (blnGuest AND blnMustBeLoggedIn) Then adoCon.Close Set rsCommon = Nothing Set adoCon = Nothing If strCustomRedirect <> "" AND IsNull(strCustomRedirect) = False Then Response.Redirect(strCustomRedirect) Else Response.Redirect("forum/insufficient_permission.asp?Redirect=" & RedirectOmitPath("Redirect", True)) End If End If %> <% = strWebSiteName %> - <% = strTypeName %> <% Dim intDisplayRow Dim rsCountLinks Dim intTotalLinks intDisplayRow = 1 intTotalLinks = 0 blnSubCategories = False Set rsCountLinks = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT " & strDbTable & "EntrySubCategory.* FROM " & strDbTable & "EntrySubCategory " & _ "WHERE " & strDbTable & "EntrySubCategory.Cat_ID = " & intCatID & ";" rsCommon.Open strSQL, adoCon If rsCommon.EOF Then blnSubCategories = False Else blnSubCategories = True Response.Write(vbCrLf & "") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
" & strWebsiteName & " : " & strTypeName & " : " & strCategoryName & "
") Response.Write(vbCrLf & "
") Call FormatTopTable2("100%") Response.Write(vbCrLf & "") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Call FormatBottomTable("100%") Call FormatTopTable("100%") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Call FormatBottomTable("100%") End If Else Response.Write(vbCrLf & "
") Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " " & strTypeName & "
" & strCategoryName & "

") Response.Write(vbCrLf & " ") DO UNTIL rsCommon.EOF If strDatabaseType = "SQLServer" Then strSQL = "SELECT Count(" & strDbTable & "Entry.Entry_ID) AS Total_Links FROM " & strDbTable & "Entry " & _ "WHERE " & strDbTable & "Entry.Sub_ID = " & rsCommon("Sub_ID") & " AND " & strDbTable & "Entry.Active = 1;" Else strSQL = "SELECT Count(" & strDbTable & "Entry.Entry_ID) AS Total_Links FROM " & strDbTable & "Entry " & _ "WHERE " & strDbTable & "Entry.Sub_ID = " & rsCommon("Sub_ID") & " AND " & strDbTable & "Entry.Active = True;" End If rsCountLinks.Open strSQL, adoCon intTotalLinks = rsCountLinks("Total_Links") rsCountLinks.Close Response.Write(vbCrLf & " ") rsCommon.Movenext If intDisplayRow = 2 AND NOT rsCommon.EOF Then Response.Write vbCrLf & (" ") Response.Write vbCrLf & (" ") intDisplayRow = 0 End If intDisplayRow = intDisplayRow + 1 Loop If rsCommon.EOF and intDisplayRow = 2 Then Response.Write(" ") Response.Write(vbCrLf & "
" & rsCommon("Sub_name") & " (" & intTotalLinks & ")") If blnAdmin Then Response.Write(" (" & strTxtEdit & ")") Response.Write("
" & rsCommon("Sub_description") & "


") Call FormatBottomTable("100%") Call FormatTopTable2("100%") Response.Write(vbCrLf & "
") Response.Write("" & strTxtBackToHome & " | " & strTxtBackToCategories & " ") If blnAllowSubmitting Then Response.Write(vbCrLf & "| " & strTxtSubmitNewEntry & "") Call FormatBottomTable("100%") End If rsCommon.Close Set rsCountLinks = Nothing Select Case intEntryShort Case 0 strEntryShort = "" & strDbTable & "Entry.Created_date" Case 1 strEntryShort = "" & strDbTable & "Entry.Rating" Case 2 strEntryShort = "" & strDbTable & "Entry.Total_visits" Case 3 strEntryShort = "" & strDbTable & "Entry.Created_date" Case 4 strEntryShort = "" & strDbTable & "Entry.Name" End Select Select Case intEntryOrder Case 0 strEntryOrder = "DESC" Case 1 strEntryOrder = "ASC" End Select Dim rsLinks Set rsLinks = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT " & strDbTable & "Entry.*, " & strDbTable & "Author.Username FROM " & strDbTable & "Entry " & _ "LEFT JOIN " & strDbTable & "Author ON " & strDbTable & "Entry.Author_ID = " & strDbTable & "Author.Author_ID " & _ "WHERE " & strDbTable & "Entry.Cat_ID = " & intCatID & " AND " & strDbTable & "Entry.Sub_ID = 0 AND " & strDbTable & "Entry.Active = " & CBoolConvert(1) & " " & _ "ORDER BY " & strEntryShort & " " & strEntryOrder & ";" rsLinks.CursorType = 3 rsLinks.Open strSQL, adoCon rsLinks.PageSize = intSiteEntriesPerPage If rsLinks.EOF Then If blnSubCategories = False Then Call FormatTopTable2("100%") Response.Write(vbCrLf & "
" & strTxtSorryTthereAreNoEntriesInThisCategory & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " " & strTxtBackToHome & " | " & strTxtBackToCategories & " ") If blnAllowSubmitting Then Response.Write(vbCrLf & "| " & strTxtSubmitNewEntry & "") Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
" & strWebsiteName & " : " & strTypeName & " : " & strCategoryName & "
") Response.Write(vbCrLf & "
") Call FormatTopTable2("100%") Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " " & strTxtSearch & ": ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
") Call FormatBottomTable("100%") rsLinks.AbsolutePage = intRecordPositionPageNum intTotalNumNewsEntries = rsLinks.RecordCount intTotalNumNewsPages = rsLinks.PageCount For intRecordLoopCounter = 1 to intSiteEntriesPerPage If rsLinks.EOF Then Exit For Call FormatEntryFields() 'Get the display of links from the format_entry.asp file Call FormatEntryDisplay(intEntryID, intEntryAuthorID, strEntryName, strEntryAuthor, strEntryDescription, intEntryNoOfRatings, intEntryRating, strEntryCreatedDate, intEntryTotalVisits, intEntryStatus, intTypeID, blnVisitEntry, intEntryTotalReviews) rsLinks.Movenext Next Call FormatTopTable2("100%") Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
") Call FormatBottomTable("100%") Call FormatTopTable2("100%") Response.Write(vbCrLf & " ") If intRecordPositionPageNum > 1 or NOT rsLinks.EOF Then Response.Write vbCrLf & "
" & strTxtPage & "  " If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & "<< " & strTxtPrevious & " " If intRecordPositionPageNum > 1 or NOT rsLinks.EOF Then For intLinkPageNum = 1 to intTotalNumNewsPages If intLinkPageNum = intRecordPositionPageNum Then Response.Write vbCrLf & intLinkPageNum Else Response.Write vbCrLf & " " & intLinkPageNum & " " End If Next End If If NOT rsLinks.EOF then Response.Write vbCrLf & " " & strTxtNext & " >>

" ElseIf intRecordPositionPageNum > 1 AND rsLinks.EOF Then Response.Write("

") End If Response.Write("" & strTxtBackToHome & " | " & strTxtBackToCategories & " ") If blnAllowSubmitting Then Response.Write(vbCrLf & "| " & strTxtSubmitNewEntry & "") If NOT rsLinks.EOF then Response.Write("

") ElseIf intRecordPositionPageNum > 1 AND rsLinks.EOF Then Response.Write("

") End If Call FormatBottomTable("100%") rsLinks.Close Set rsLinks = Nothing End If %> <% If blnAdmin Then %>
Add Sub Category
<% End If %> <% Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %>