|Posted: 08/29/2003, 12:27 AM
CC 2.0.5, PHP, MySQL
My yet unsolved problem is that I have to build a site which has dynamic
('Kategorie 1', 'Kategorie 2', ' Kategorie 3', 'Kategorie 4' and 'Kategorie
5') and static items ('Home', 'Events', 'Admin') in its navigation menu. For
the static items the only solution is to use the 'menu form' what on the
other hand does not work if I want to dynamically generate the other parts
from the database.
By this time I was able to write a little code in the BeforeShow-event of
the menu form which generates the dynamic menu items:
$max_kat = dlookup("categories", "max(category_id)", "category_id");
$mn_kat_name = dlookup("categories", "category_desc", "category_id =" . $i);
$fldmn_kat = "<a href = 'kat.php?category_id=" . $i . "&'>" . $mn_kat_name .
Using the var_dump-order all items are shown at the top of the site, same
happens if I echo the variable instead. But in the 'mn_kat'-field (label) of
the menu there is only the last record set ('Kategorie 5', not 'Kategorie 1'
to '. 4') displayed.
Now I am looking for a solution to display the echo-result into the
mn_kat-label field as it is shown on the top of the site.
Or I need a function that dynamically generates as many label fields as in
the result of $max_kat which can by filled one by one.
Any ideas? I have been working on this since yesterday morning, I guess, I
cannot see the forest for the trees anymore .
Thanks in advance!