<% set dbaseconn = server.createobject("ADODB.Connection") set dbasers = server.createobject("ADODB.Recordset") dbaseconn.open("Driver={SQL Server};Server=oe-server;Database=hekse-kedlen;Uid=hekse-kedlen;Pwd=IloveM1a;") dim sURL: sURL = request.QueryString() dim iPosBaseStart: iPosBaseStart = instr(14,sURL,"/") dim iPosBaseEnd: iPosBaseEnd = instr(iPosBaseStart+1,sURL,"/") + 1 dim sBase: sBase = split(sURL, request.servervariables("HTTP_HOST") & "/")(1) set objfso = server.createobject("scripting.filesystemobject") 'dim bIsPageRequest: bIsPageRequest = (objfso.fileexists(server.mappath(split(sbase, "/")(0) & "/" & split(sbase, "/")(1) & ".asp"))) dim bIsPageRequest: bIsPageRequest = false dim showshop: showshop = false dbasers.open "select id from pages where isfrontpage=1", dbaseconn thispageid = dbasers("id") dbasers.close function nicelink(text) linkpath = lcase(trim(text)) linkpath = replace(linkpath, " ", "_") linkpath = replace(linkpath, "", "aa") linkpath = replace(linkpath, "", "ae") linkpath = replace(linkpath, "", "oe") nicelink = linkpath end function function unnicelink(text) text = lcase(text) text = replace(text, "_", " ") text = replace(text, "aa", "") text = replace(text, "ae", "") text = replace(text, "oe", "") unnicelink = text end function 'response.write sbase 'response.end sbase = lcase(sbase) sbase = replace(sbase, "aa", "") sbase = replace(sbase, "ae", "") sbase = replace(sbase, "oe", "") sbase = replace(sbase, "_", " ") do while right(sbase, 1) = "/" sbase = left(sbase, len(sbase)-1) loop session("sbase") = sbase breadcrumb = sbase if instr(sbase, "/") then sbase = split(sbase, "/") thispageid = 0 for i = 0 to ubound(sbase) if sbase(0) = "shop" or sbase(0) = "butikken" then bIsPageRequest = true showshop = true exit for end if dbasers.open "select id from pages where menuhead=" & thispageid & " and name='" & sbase(i) & "'", dbaseconn if not dbasers.EOF then thispageid = dbasers("id") if i = ubound(sbase) then bIsPageRequest = true end if dbasers.close next else if sbase = "shop" or sbase = "butikken" then bIsPageRequest = true showshop = true else dbasers.open "select id from pages where menuhead=0 and name='" & sbase & "'", dbaseconn if not dbasers.EOF then thispageid = dbasers("id") bIsPageRequest = true end if dbasers.close end if end if function getallchildren(menuid, level, prevlink) set dbrs = server.createobject("ADODB.Recordset") dbrs.open "select id, name, dataurl, data from pages where deleted=0 and menuhead=" & menuid & " order by orderid", dbaseconn r = 0 tablevel = "" for i = 1 to level tablevel = tablevel & " " next if hasparent(thispageid, menuid) or (thispageid = menuid) then rval = vbcrlf & tablevel & "