<p>
<%
Function testmenu(cID)
if dMode <> true then on error resume next
Dim fparentIDs, themenuButtonID, menuButtonID, currentMenuButtonID, firstMenuValue
if cID > 0 then fparentIDs = getParentIDs(cID)
s = ""
if isNumberValid(session("eCart_membershipID")) AND session("eCart_membershipID") > 0 then
SQLQuery = "SELECT tblCategory.categoryID, tblCategory.categoryName, tblCategory.menuAppearance, tblCategory.pageContents FROM tblCategory INNER JOIN tblMembershipDiscounts ON tblCategory.categoryID = tblMembershipDiscounts.categoryID WHERE (((tblCategory.parentID)=0) AND ((tblCategory.menuAppearance)=1) AND ((tblMembershipDiscounts.membershipID)=" & prepLong(session("eCart_membershipID")) & ") AND ((tblMembershipDiscounts.hidden)=" & prepBoolean("false") & ")) ORDER BY tblCategory.categoryName;"
else
SQLQuery = "SELECT tblMenuButtons.menuButtonID, tblCategory.categoryName, tblCategory.categoryID, tblCategory.hidden FROM ((tblMenuButtons LEFT JOIN tblMenuButtons_Categories ON tblMenuButtons.menuButtonID = tblMenuButtons_Categories.menuButtonID) LEFT JOIN tblCategory ON tblMenuButtons_Categories.categoryID = tblCategory.categoryID) WHERE tblMenuButtons.menuButtonID = tblMenuButtons_Categories.menuButtonID AND tblCategory.hidden=" & prepBoolean("false") & " ORDER BY tblCategory.categoryName, tblMenuButtons.menuButtonID;"
end if
Set ds = objConn.Execute(SQLQuery)
Set ds2 = nothing
if not ds.BOF AND not ds.EOF then
g_k = 0
response.write"<ul>"
do until ds.eof
'g_k = g_k + 1
'if g_k > 2 then g_k = 1
s = s & "<li>"
s = s & "<a href=""categories.asp?cID=" & ds("categoryID") & """>" & ds("categoryName") & ds("menuButtonID") &"</a>"
s = s & "</li>"
if fparentIDs <> "" then
if CLng(nthField(fparentIDs, ",", 1)) = ds("categoryID") then s = s & listSubCats(ds("categoryID"), cID, fparentIDs, 1)
end if
ds.moveNext
loop
s = s & "</ul> "
end if
ds.close
set ds = nothing
testmenu = s
end Function
loadMenuButtonsTop ()
'dim categoryName
Sub loadMenuButtonsTop()
dim objConn, ds4, themenuButtonID, themenuButtonName, themenuButtonLink, theloadInNewWindow, themenuButtonLocation, menu1categories
if dMode <> true then on error resume next
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open dbConnectionStr
'set ds = CreateObject("ADODB.Connection")
'ds.open
SQLQuery = "SELECT menuButtonID, menuButtonName, menuButtonLink, loadInNewWindow, menuButtonLocation FROM tblmenuButtons ;"
Set ds4 = objConn.Execute(SQLQuery)
if not ds4.eof AND not ds4.bof then
j=0
%>
<div class="menuTop">
<ul>
<% do until ds4.eof
theMenuButtonID = ds4("menuButtonID")
themenuButtonName = ds4("menuButtonName")
themenuButtonLink = ds4("menuButtonLink")
theloadInNewWindow = ds4("loadInNewWindow")
'menuButtonLocation = ds4("menuButtonLocation")
j = j + 1 %>
<li><a href="<%= themenuButtonLink %>" <%if theloadInNewWindow = true then send "target=""_blank""" %>><%= themenuButtonName %></a>
<%
currentCategory = request.queryString("cID")
if not isNumberValid(currentCategory) then currentCategory = 0
'if menuButtonID = 1 then
send testmenu(currentCategory)
' end if
%>
</li>
<% if j = 8 then exit do
ds4.moveNext
loop %>
</ul>
</div>
<%'End Navigation Head Top Above Head Banner %>
<% end if
ds4.close
set ds4 = nothing
end sub
%> </p>
Bookmarks