
October 4th, 2005, 11:49 PM
|
|
Registered User
|
|
Join Date: Oct 2005
Posts: 1
Time spent in forums: 23 m 43 sec
Reputation Power: 0
|
|
|
Noobe a.b.c.d.....sitemap Please help
I posted earlier for a treeview. However, I've just changed my mind and want to go to an alphabetical order type sitemap similar to this sitemap done in php.
Thanks in advance for your thoughts.
Code:
<%Option Explicit%>
<!--#include file="shop$db.asp"-->
<!--#include file="shopproductfeatures.asp"-->
<!--#include file="shopconvertcurrency.asp"-->
<!--#include file="shopcustomerprices.asp"-->
<!--#include file="shopproductformat.asp"-->
<!--#include file="shopreviewaverage.asp"-->
<!--#include file="shopproductcreatesql.asp"-->
<!--#include file="shopproductformat_template.asp"-->
<!--#include file="shopfileio.asp"--><%
response.buffer = false
function StripHTML( byref asHTML)
Dim loRegExp ' Regular Expression Object
' Create built In Regular Expression object
Set loRegExp = New RegExp
loRegExp.Global = True
' Set the pattern To look For HTML tags
loRegExp.Pattern = "<[^>]*>"
' Return the original String stripped of HTML
StripHTML = loRegExp.Replace(asHTML, "")
' Release object from memory
Set loRegExp = Nothing
End function
ShopPageHeader ' normal page header
%><h1>Sitemap</h1><%
Dim Dbc
dim sql_product
dim rs_product
dim CurrentCategory
dim ProductName
Shopopendatabase dbc
sql_product = "SELECT products.catalogid, products.Cname, " & _
" Categories.Catdescription " & _
" FROM products inner join Categories on Categories.Categoryid = products.ccategory" & _
" Order by Categories.Catdescription, products.Cname ASC"
set rs_product = dbc.Execute( sql_product )
CurrentCategory = ""
do while rs_product.eof = false
if CurrentCategory <> rs_product("Catdescription") then
response.write "<h2>" & rs_product("Catdescription") & "</h2>" & vbcrlf
CurrentCategory = rs_product("Catdescription")
end if
ProductName = UCase(Left(rs_product("Cname"), 1)) & LCase(Mid(rs_product("Cname"), 2))
ProductName = StripHTML( ProductName )
%><a href="/shopexd.asp?id=<%=rs_product("catalogid")%>" style="padding-bottom:3px; "><%=ProductName%></a><br>
<%
response.write vbcrlf
rs_product.movenext
loop
shopclosedatabase dbc
ShopPageTrailer ' normal trailer
%>
|