%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = true %>
<%
on error resume next
session("a_aid") = request.QueryString("a_aid")
session("a_bid") = request.QueryString("a_bid")
'session("group_ID") = 0
'on error resume next
dim rsproducts, strsql, ID, objImage, iheight, iwidth, iratio, rsTitle, iCount, fPrice, iForm
dim rscategory, rsSettings, storefont, rsoptions, aroptions, counter, arprice, strRequired, arOnOff
dim ardiscounts, rsDiscount, discount_ID, arusers, a, p, Page, strUrl
Dim iPageSize 'How big our pages are
Dim iPageCount 'The number of pages we get back
Dim iPageCurrent 'The page we want to show
Dim iRecordsShown 'Loop controller for displaying just iPageSize records
Dim I 'Standard looping var
dim rsRetailPrice, fRetailPrice
set rssettings = server.CreateObject("ADODB.Recordset")
rssettings.CursorLocation = adUseClient
strsql = "stor_Settings_select"
set rssettings = conn.execute(strsql)
ID = string_apostroph_safe(Request.querystring("Category_ID"))
if instr(1,ID, "_") > 1 then
dim arParameters
arParameters = split(ID, "_")
ID = cint(arParameters(0))
Page = arParameters(1)
end if
' Get parameters
iPageSize = rssettings("MaxProds")
' Retrieve page to show or default to 1
If Page = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Page)
End If
session("Category_ID") = ID
strsql = "stor_get_products " & ID & "," & session("Group_ID") & "," & iPageSize & "," & iPageCurrent
set rsProducts = server.CreateObject("ADODB.Recordset")
rsProducts.CursorLocation = adUseCLient
set rsProducts = conn.execute(strsql)
iCount = rsProducts("theCount")
iPageCount = iCount \ iPagesize + 1
if iPageCount * iPageSize >= iCount + iPageSize then iPageCount = iPageCount - 1
set rsProducts = rsProducts.NextRecordset
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
set rscategory = server.CreateObject("ADODB.Recordset")
rscategory.CursorLocation = adUseClient
strsql = "stor_Category_select_ID " & ID
set rscategory = conn.execute(strsql)
storefont = rssettings("StoreFontFace")
set rsTitle = server.CreateObject("ADODB.RECORDSET")
rsTitle.CursorLocation = adUseClient
strsql = "stor_Meta_Tag_select " & ID
set rsTitle = conn.execute(strsql)
if Err <> 0 then
conn.close
set conn = nothing
response.Redirect("/")
end if
%>
<%
dim Meta_Title, Meta_Robots, Meta_Keywords
if not rsTitle.EOF then
Meta_Title = rsTitle("Meta_Title")
Meta_Robots = rsTitle("Meta_Robots")
Meta_Keywords = rsTitle("Meta_Keywords")
end if
%>
<%if not rsTitle.EOF then response.Write(rstitle("Title"))%>
<%if ID = 3 then%>Books<%end if%>
<%if ID = 5 then%>E-Books<%end if%>
<%if ID = 9 then%>Flash Cards, Posters and Mouse Pads<%end if%>
<%if ID = 10 then%>Candlestick Training Videos<%end if%>
<%if ID = 12 then%>Other Recommended Products<%end if%>
<%if ID = 13 then%>Become a Member<%end if%>
<%if ID = 17 then%>Website Specials<%end if%>
<%if ID = 18 then%>Videos-Quick Download Option<%end if%>
<%if ID = 28 then%>Commodity & Futures Training<%end if%>
<%if ID = 31 then%>Options Training with Stephen Bigalow<%end if%>
|
<%
If iPageCount = 0 Then
Response.Write "
No Products were found that matched your search query. Please try again."
Else
%>
<%
'rsproducts.AbsolutePage = iPageCurrent
if len(rscategory("sm_image")) > 4 then
Response.Write("")
else
if len(rscategory("lg_image")) > 4 then
Response.Write("")
end if
end if
if (len(rscategory("sm_image")) < 4 and len(rscategory("lg_image")) < 4) or (rscategory("sm_Image") = "" and rscategory("Lg_image") = "") then
Response.Write("" & rsCategory("Name") & "")
end if
if (rsCategory("long_desc") > "") then
response.Write("" & rsCategory("long_desc") & " ")
end if
Response.Write("
")
%>
<%if ipagecount > 1 then%>
Page <%= iPageCurrent %> of <%= iPageCount %>
<%end if%>
<%
irecordsShown = 0
iForm = 0
do while not rsproducts.EOF
strRequired = ""
%>
<%
strUrl = rsProducts("Product_ID") & "_" & rsCategory("Category_ID")
strUrl = GenerateURL_OneParam("http://www.candlestickforum.com/store/more_info.asp", "parameters", strUrl)
strUrl = replace(strUrl, "%5F", "_")
if rsproducts("sm_image") > "" then
'get image size
set objImage = server.CreateObject("IMGSIZE.CHECK")
objIMage.FileName = Request.ServerVariables("APPL_PHYSICAL_PATH") & "store/images/" & rsProducts("sm_image")
iheight = objImage.Height
iwidth = objImage.Width
if iwidth > 0 and iwidth > 175 then
iratio = 175/iwidth
iwidth = 175
else
iratio = 1
end if
%>
" height="<%=cint(iheight*iratio)%>" width="<%=iwidth%>" alt="<%=rsproducts("Name")%>">
<%
else
if rsproducts("lg_image") > "" then
'get image size
set objImage = server.CreateObject("IMGSIZE.CHECK")
objIMage.FileName = Request.ServerVariables("APPL_PHYSICAL_PATH") & "store/images/" & rsProducts("lg_image")
iheight = objImage.Height
iwidth = objImage.Width
if iwidth > 0 and iwidth > 80 then
iratio = 80/iwidth
iwidth = 80
else
iratio = 1
end if
%>
" height="<%=cint(iheight*iratio)%>" width="<%=iwidth%>" alt="<%=rsproducts("Name")%>">
<%
end if
end if
%>
|
<%=rsproducts("Name")%><%if rsproducts("highlight") then Response.Write(" NEW!!!")%><%if rsproducts("Sale") then Response.Write(" ON SALE!!!")%>
<%
if len(rsproducts("short_desc")) < 5 then
strtemp = left(rsProducts("long_desc"),100)
strtemp = strtemp
Response.Write(strtemp)
response.Write("...")
else
Response.Write(rsproducts("short_desc"))
end if
%>
[More Info]
|
<%
iRecordsShown = iRecordsShown + 1
iForm = iForm + 1
rsproducts.MoveNext
loop
%>
<%
if iPageCurrent > 1 then
strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & iPageCurrent - 1)
strUrl = replace(strUrl, "%5F", "_")
%>
[<< Prev]
<%
end if
' Show Page Numbers
if ipagecount > 1 then
for I = 1 to iPageCount
if I = iPageCurrent then
%>
<%= I %>
<%
else
strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & I)
strUrl = replace(strUrl, "%5F", "_")
%>
<%= I %>
<%
end if
Next 'I
if iPageCurrent < iPageCount then
strurl = GenerateURL_OneParam("http://www.candlestickforum.com/store/products.asp", "Category_ID", ID & "_" & iPageCurrent + 1)
strUrl = replace(strUrl, "%5F", "_")
%>
[Next >>]
<%
end if
%>
Page <%= iPageCurrent %> of <%= iPageCount %>
<%end if%>
<%end if %>
<%
if request.QueryString("a_aid") > "" then
%>
<%
end if
%>
|
<%
conn.close
set conn = nothing
%>