Thanks a lot for the tutorial, which I enjoyed quite a lot: not too much basic explanation, but just enough to give a newbie a fair chance to know what to look for and where. I like that.
Anyway, it all seems to work fine, except for one thing: I get a message:
Notice: Undefined index: count in /home/httpd/html/test/menu.php on line 41
I fiddled around and solved it by adding
$parent_menu[$obj->parent_id]['count'] = 0;
at the start of the else { } segment where 'count' first appears. I don't know if this is the right way to do it -- my php knowledge is fairly shaky -- but I just thought I'd let you know, and if you have another solution, I'd be happy to hear about it.