<% 'This code is copyright (c) Internet Business Solutions SL, all rights reserved. 'The contents of this file are protect under law as the intellectual property 'of Internet Business Solutions SL. Any use, reproduction, disclosure or copying 'of any kind without the express and written permission of Internet Business 'Solutions SL is forbidden. 'Author: Vince Reid, vince@virtualred.net if menupoplimit="" then menupoplimit=9 Set rs = Server.CreateObject("ADODB.RecordSet") Set cnn=Server.CreateObject("ADODB.Connection") on error resume next err.number = 0 cnn.open sDSN alreadygotadmin = getadminsettings() if Session("clientLoginLevel")<>"" then minloglevel=Session("clientLoginLevel") else minloglevel=0 rs.Open "SELECT sectionID,"&getlangid("sectionName",256)&",topSection,rootSection,sectionurl FROM sections WHERE sectionDisabled<="&minloglevel&" ORDER BY sectionOrder",cnn,0,1 if NOT rs.EOF then mAlldata = rs.getrows rs.Close cnn.Close set rs = nothing set cnn = nothing Sub mwritemenulevel(id,itlevel) Dim mIndex if itlevel<=menupoplimit then FOR mIndex=0 TO ubound(mAlldata,2) if mAlldata(2,mIndex)=id then mTID = mAlldata(2,mIndex) if mTID = 0 then mTID = "" if trim(mAlldata(4,mIndex)&"")<>"" then if mAlldata(3,mIndex)=0 then response.write "mymenu.addSubMenu(""products"&mTID&""", ""products"&mAlldata(0,mIndex)&""", """&menuprestr&replace(mAlldata(1,mIndex)&"","""","\""")&menupoststr&""", """&mAlldata(4,mIndex)&""");"&vbCrLf else response.write "mymenu.addSubMenu(""products"&mTID&""", """", """&menuprestr&Replace(mAlldata(1,mIndex)&"","""","\""")&menupoststr&""", """&mAlldata(4,mIndex)&""");"&vbCrLf end if else if mAlldata(3,mIndex)=0 then response.write "mymenu.addSubMenu(""products"&mTID&""", ""products"&mAlldata(0,mIndex)&""", """&menuprestr&replace(mAlldata(1,mIndex)&"","""","\""")&menupoststr&""", ""categories.asp?cat="&mAlldata(0,mIndex)&""");"&vbCrLf else response.write "mymenu.addSubMenu(""products"&mTID&""", """", """&menuprestr&Replace(mAlldata(1,mIndex)&"","""","\""")&menupoststr&""", ""products.asp?cat="&mAlldata(0,mIndex)&""");"&vbCrLf end if end if end if NEXT FOR mIndex=0 TO ubound(mAlldata,2) if mAlldata(2,mIndex)=id AND mAlldata(3,mIndex)=0 then call mwritemenulevel(mAlldata(0,mIndex),itlevel+1) NEXT end if end Sub if err.number <> 0 then response.write "mymenu.addSubMenu(""products"", """", ""Please check your database connection"", ""http://www.ecommercetemplates.com/help/ecommplus/faq.asp"");"&vbCrLf elseif IsArray(mAlldata) then call mwritemenulevel(0,1) end if on error goto 0 %>