imint_index; $description = "text:" . $row->description; $url = $row->url; $mouseover = $row->mouseover; //////////////////////////////////////////////// // If the URL is not blank, create a link entry // we could just as easily embed some javascript // using the SCRIPT syntax. //////////////////////////////////////////////// if ($url != '') $url="link:".$url; //////////////////////////////////////////////// // Whether we have a link, or a pointer to a new // sub-menu, we always need to create an entry in // the imint menu //////////////////////////////////////////////// WriteItem($description,$level,"",$url,$mouseover); if ($url==""){ /////////////////////////////////////////////////// // if the url is blank, we will assume that is a // link to a new menu or sub-menu,so we recurse, passing // the function the current index number, which // will become the parent in our SQL statement, // and the next imint layer number ////////////////////////////////////////////////// buildMenus($imint_index,$newlevel); /////////////////////////////////////////////////////// // Once we return from the called function, we continue // on at the same menu level where we left off. /////////////////////////////////////////////////////// } } ////////////////////////////////////////////// // At the end of the loop the function dies ////////////////////////////////////////////// } //////////////////////////////////////////////////////////// // End of functions //////////////////////////////////////////////////////////// // To Start, we can statically create a couple of menu/ // sub menu items //////////////////////////////////////////////////////////// writeItem ("TEXT:Useful Resources","1","","",""); writeItem ("TEXT:PHP","2","","link:http://www.php.net,_new","PHP"); writeItem ("TEXT:mySQL","2","","link:http://www.mysql.com,_new","mySQL DBMS"); writeItem ("TEXT:Apache","2","","link:http://www.apache.org,_new","Apache Web Servers"); //////////////////////////////////////////////////////////////////// // Create a start point for our dynamic menu /////////////////////////////////////////////////////////////////// writeItem ("TEXT:Dynamic Menu","1","","","This is where it starts"); /////////////////////////////////////////////////////////////////// // Start recursion, the first parameter is the value of the parent // field in the database, the second is the imint level /////////////////////////////////////////////////////////////////// buildMenus(0,2); ///////////////////////////////////////////////////////////////////// // Finish off with a final static menu perhaps ///////////////////////////////////////////////////////////////////// writeItem ("TEXT:IMINT","1","","link:http://www.imint.com","Java Applets"); ?>