+ og -
Jeg har lavet et menu system som kan fungere lidt ala stifinder men + og - alt efter om menuen er slået ud eller aj, men jeg kan kun få den til at virke på den sidst menu som er slået ud, hvordan få man det til at virke på alle dem der er slået ud?<!-- #include file=\"../includes/top.asp\" -->
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<%
menu(0)
function menu(tilhoreid)
sql=\"select * from adminmenu where tilhoreid=\"&tilhoreid&\" order by hiraki asc\"
set rs_functionsmenu=db_base.execute(sql)
while not rs_functionsmenu.eof
taeller=taeller+1
if rs_functionsmenu(\"tilhoreid\")<>\"\" then
tilhoreid=rs_functionsmenu(\"tilhoreid\")
sql=\"select count(id) as antaltilblank from adminmenu where tilhoreid=\"&rs_functionsmenu(\"tilhoreid\")
set rs_tjeck_om_blank=db_base.execute(sql)
sql=\"select count(id) as antal from adminmenu where tilhoreid=\"&rs_functionsmenu(\"id\")
set rs_test_for_sub=db_base.execute(sql)
if rs_test_for_sub(\"antal\")<>0 then
img=\"plus_menu\"
else
img=\"uden_menu\"
end if
while not tilhoreid=0
sql=\"select * from adminmenu where id=\"&tilhoreid&\" order by hiraki \"
set rs_tjek_tilhoreid=db_base.execute(sql)
tilhoreid=rs_tjek_tilhoreid(\"tilhoreid\")
neveau=neveau+1
wend
end if
%>
<tr>
<td valign=\"bottom\"><%= rs_functionsmenu(\"id\")&\"-\"&dbget(\"menuid\")%>
<%
for i=1 to int(neveau) step 1%>
<img src=\"../grafik/stiblet_linie.gif\" alt=\"\" border=\"0\">
<%next
if img=\"plus_menu\" then
if cint(rs_functionsmenu(\"id\"))=cint(dbget(\"menuid\")) then %>
<a href=\"adminmenu.asp?menuid=<%= rs_functionsmenu(\"tilhoreid\") %>\" class=\"admin\">
<img src=\"../grafik/minus_mellem.gif\" alt=\"\" border=\"0\"></a>
<% else%>
<a href=\"adminmenu.asp?menuid=<%= rs_functionsmenu(\"id\") %>\" class=\"admin\">
<img src=\"../grafik/<%= img %>.gif\" alt=\"\" border=\"0\"></a>
<% end if
else %>
<img src=\"../grafik/<%= img %>.gif\" alt=\"\" border=\"0\">
<% end if %>
<img src=\"../grafik/mappe.gif\" alt=\"\" border=\"0\"><%= rs_functionsmenu(\"name\") %> <img src=\"../grafik/blank.gif\" alt=\"\" border=\"0\"> <%= info(1) %>
</td>
</tr>
<% neveau=0
if dbget(\"menuid\") <>\"\" then
stopby=dbget(\"menuid\")
while not stopby=0
sql=\"select tilhoreid, id from adminmenu where id=\"&stopby&\"\"
set rs_tjek_tilhoreid=db_base.execute(sql)
stopby=rs_tjek_tilhoreid(\"tilhoreid\")
submenu=rs_tjek_tilhoreid(\"id\")&\",\"&submenu
wend
MyArray = Split(submenu, \",\", -1)
for i=0 to Ubound(MyArray)-1 step 1
if trim(rs_functionsmenu(\"id\"))= trim(MyArray(i)) then
menu(trim(MyArray(i)))
end if
next
end if
submenu=\"\"
rs_functionsmenu.movenext
wend
end function
%>
</table>
<!-- #include file=\"../includes/bund.asp\" -->
