<%@LANGUAGE="VBScript" ENABLESESSIONSTATE=True%> <%Option Explicit%> <%Response.Buffer = True%> <%Response.Expires = -1%> <% Dim Conn, RS, SQL, lngCategoryID, I Dim sOrderBy, sQString, aryOrderBy Dim PageSize, PageNum, fEmptyRecordset, fSupportsBookmarks Dim MaxCount, NumRecs, NumFields, strPageName, RecCount, iMaxRecords Dim sTemp %> <% 'ADO Constants Const adOpenForwardOnly = 0 Const adOpenStatic = 3 Const adLockReadOnly = 1 iMaxRecords=500 'Max Number to Return Set Conn = Server.CreateObject ("ADODB.Connection") Conn.Open sConnect lngCategoryID = Request.QueryString("CategoryID") If lngCategoryID = "" Then lngCategoryID = 0 %> Classified Equestrian Link Index <% Dim iTimeout iTimeout = Server.ScriptTimeOut Server.ScriptTimeOut = iTimeout + 40 %>
Classified Equestrian - Horses for Sale, Ponies for Sale, Free Equestrian advertising, Horses for Sale in the UK

  <%If lngCategoryID <> 0 Then%> Add Listing |  <%End If%> What's New  | What's HotWhat's Cool | Admin
Search  Search:       <%If lngCategoryID <> 0 Then%>
Search only in Current Category                   <%End If%>
<% '########## Show Category Thread Header for Navigation if a Specific Category is Being Displayed ########## %>
<% If lngCategoryID <> 0 Then 'A Specific Category is Being Displayed Response.Write GetCategoryThreadNav(Request.QueryString("CategoryID"),"") Else Response.Write GetTotalResources & " Resources in " & GetTotalCategories & " Categories" End If %> <% If Application("ActiveUsers") = 1 Then Response.Write Application("ActiveUsers") & " active user" Else Response.Write Application("ActiveUsers") & " active users" End If %>
<% '########## Show Categories or (any Sub Categories if a specific Category is being displayed) ########## SQL = "SELECT * FROM tblCategories WHERE CategoryTopID= " & lngCategoryID & " ORDER BY CategoryName" Set RS = Conn.Execute (SQL) I=0 If Not RS.EOF then %>
<% Do Until RS.EOF If I Mod 2 = 0 Then Response.Write "" Response.Write "" & vbCRLF If (Not I Mod 2 = 0) Or RS.EOF Then Response.Write "" RS.MoveNext I=I+1 Loop %>
" & vbCRLF %> "><%=RS("CategoryName")%> <% 'Display total resource count for category and all sub categories Response.Write "(" & GetCategoryResourceCount(RS("CategoryID")) + GetSubCategoryResoureCount (RS("CategoryID"), 0) & ")" & vbCRLF 'Display New if any new resourcse in category or any sub categories If GetCategoryNew(RS("CategoryID")) Then Response.Write " " & vbCRLF End If 'Display the first few sub categories or resources in category Response.Write "
" & GetCategoryUnderLinks(RS("CategoryID")) & vbCRLF Response.Write "

<% End If RS.Close Set RS = Nothing '########## Show Resources if a Specific Category is Being Displayed ########## PageSize=Request.Querystring("PageSize") If PageSize = "" then PageSize = 10 PageNum=Request("PageNum") If PageNum = "" then PageNum = 1 sOrderBy = Request("OrderBy") If sOrderBy = "" Then sOrderBy = "ResourceName" Function BuildOrderByArray Dim aryTmp aryTmp= Split("Name,ResourceName,Date,ResourceDate,Hits,ResourceHits,Rating,ResourceRating,URL,ResourceURL",",") BuildOrderByArray=aryTmp Erase aryTmp End Function Set RS = Server.CreateObject("ADODB.Recordset") RS.CursorLocation = 3 'adUseServer = 2, adUseClient = 3 RS.MaxRecords = iMaxRecords SQL = "SELECT * FROM tblResources WHERE CategoryID=" & lngCategoryID & " AND ResourceActive=1 " SQL = SQL & "ORDER BY " & Trim(sOrderBy & " " & Request("OrderDir")) RS.Open SQL, Conn, 3, 3 'adOpenStatic, adLockOptimistic If bSQLServer Then RS.CacheSize = PageSize fEmptyRecordset = False If RS.EOF and RS.BOF then fEmptyRecordset = True If Not fEmptyRecordset Then RecCount=RS.RecordCount RS.Movefirst RS.PageSize=PageSize fSupportsBookmarks = RS.Supports(8192) MaxCount=CInt(RS.PageCount) NumRecs=0 NumFields=RS.fields.count -1 If IsNumeric(PageNum) then If Cint(PageNum) <= 0 then PageNum=1 End If If Cint(PageNum) > MaxCount then PageNum=MaxCount End If End If RS.AbsolutePage=PageNum End If aryOrderBy=BuildOrderByArray sQString="?CategoryID=" & lngCategoryID If lngCategoryID <> 0 Then%>
" METHOD="POST">
 Resources  Ordered By:     <%If sOrderBy <> "" Then%> <%End if%>
<%End If%> <% Do While Not RS.EOF And NumRecs < PageSize And Not fEmptyRecordset %>
" target="_blank"> <%=RS("ResourceName")%>  <% If (RS("ResourceDate")) > (Now-cnstNewDays) Then%> <% End If If (RS("ResourceFavorite")) = 1 Then%> <% End If %> <%If RS("ResourceVersion") <> "" Then%>  Version <%=RS("ResourceVersion")%> <%End If%> <%If RS("ResourcePrice") <> "" Then If RS("ResourcePrice") = 0 Then sTemp = "Free" Else sTemp = FormatCurrency(RS("ResourcePrice")) End If Response.Write " Cost: " & sTemp End If%>
Hits Today: <%=GetHitsToday(RS("ResourceID"))%>   Total: <%=RS("ResourceHits")%> Last Updated: <%=FormatDateTime(RS("ResourceDate"),2)%> <%sTemp=GetResourceRatingCount(RS("ResourceID"))%> &ResourceName=<%=Server.URLEncode(RS("ResourceName"))%>','Default_NameSub','location=no,directories=no,status=no,menubar=no,channelmode=no,personalbar=0,fullscreen=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=400,top=5,left=5')"> Rate  |  <%If sTemp > 0 Then%> &ResourceName=<%=Server.URLEncode(RS("ResourceName"))%>','Default_NameSub','location=no,directories=no,status=no,menubar=no,channelmode=no,personalbar=0,fullscreen=no,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=500,top=5,left=5')"> Ratings: <%=sTemp%> <%Else%> Ratings: <%=sTemp%> <%End If%>  | <%=GetResourceRating(sTemp, RS("ResourceRating"))%>
URL: " target="_blank"><%=RS("ResourceURL")%>   <% If RS("ResourceEmail") <> "" Then sTemp = "" & RS("ResourceEmail") & "" Else sTemp = "None" End If %> Email: <%=sTemp%>
  <%=RS("ResourceDesc")%> 


<% NumRecs=NumRecs+1 RS.MoveNext Loop If PageSize > 0 and Not fEmptyRecordset and RS.PageCount > 1 Then strPageName=Request.ServerVariables("PATH_INFO") strPageName=strPageName & sQString & "&OrderBy=" & Server.URLEncode(sOrderBy) strPageName=strPageName & "&OrderDir=" & Request("OrderDir") %>

<%If Cint(PageNum) > 1 Then%> ">First Page |  Previous Page <%End If%> <%If Cint(PageNum) < Cint(MaxCount) Then If Cint(PageNum) > 1 Then%>  |  <%End If%> Next Page <%if fSupportsBookmarks Then%>  | Last Page <%End If%> <%End If%>

<% If PageSize > 0 Then Response.Write "
" Response.Write "Page: " Response.Write " " & "of " & MaxCount & "" Response.Write "
" End If %>
<% End If If RecCount > 1 Then%>
<%=RecCount%> resources returned
<% End If If fEmptyRecordset And lngCategoryID <> 0 then%>

 

No resources were found

<% End If Erase aryOrderBy '########## Show Top Resources if No Category is Being Displayed ########## If lngCategoryID = 0 Then %>
<% Set RS = GetTopResources("NEW", 10) Do While Not RS.EOF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF RS.MoveNext Loop %>
Whats New
Resource Added
" Response.Write RS("ResourceName") & "" & FormatDateTime(RS("ResourceDate"),0) & "
<% Set RS = GetTopResources("HOT", 10) Do While Not RS.EOF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF RS.MoveNext Loop %>
Whats Hot
Resource Hits - Total (Today)
" Response.Write RS("ResourceName") & "" & RS("ResourceHits") & "  (" & GetHitsToday(RS("ResourceID")) & ")
<% Set RS = GetTopResourcesHitsInDays(5, 30) 'Shows Top Hits Last 30 Days Do While Not RS.EOF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF RS.MoveNext Loop %>
Whats Hot this Month
Resource Hits - Total (Today)
" Response.Write RS("ResourceName") & "" & RS("HitCount") & "  (" & GetHitsToday(RS("ResourceID")) & ")
<% Set RS = GetTopResourcesHitsInDays(5, 1) 'Shows Top Hits Today I=0 Do While Not RS.EOF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF RS.MoveNext I=I+1 Loop If I < 5 Then Response.Write "" & vbCRLF Response.Write "" Response.Write "" & vbCRLF Response.Write "" & vbCRLF End If %>
Whats Hot Today
Resource Total Hits
" Response.Write RS("ResourceName") & "" & RS("HitCount") & "
" & I & " site(s) clicked today 
<% End If RS.Close Set RS = Nothing Conn.Close Set Conn = Nothing %>
Added in the last <%=cnstNewDays%> days.         Site Favorite.