Recursive Php function for items menu list

There is maybe some situation where it is necessary to build a menu three getting data from a mysql database. This Php recursive function (will be used on next w3images 1.0.6 version), get values and output subsections that belongs to any passed parent section.
It work called inside a foreach construct that pass to the function the start section from where subsections list begin.
Any help would be appreciated if someone can improve it maybe with more complex mysql queries instead of a Php function recursion.
By the way, it work well at moment and it is the best way i find out while thinking how to get/build a menu three in Php grabbing data about sections and subsections from a mysql database table (the table we are speaking and from where we get data is the wp_w3images_sections table of the w3images gallery images plugin for WordPress).
The function need to be improved and will not be added exactly as is on the w3images-functions.php file.
It list correctly sections and subsections:

unfortunately wordpress return many output problems if i put the function code directly on this post ... the <code> tag seem to be not work correctly in this contest: i will see how to solve this issue shortly, sorry!

look for w3_SectionsSubNames() function to the following linked w3it.org forum post, where the code is properly outputted: this until this issue about php code isn’t resolved here.

SEE CODE about function w3_SectionsSubNames(
-> Recursive Php function for items menu list

Bookmark and Share
This entry was posted in Php functions. Bookmark the permalink.

2 Responses to Recursive Php function for items menu list

  1. axew3 says:

    The function has been updated and improved: as needed now list correctly for each section the relative list of belongs subsections.
    The new 1.0.6 version will be released within this Sunday, at max Monday.
    The new w3images menu list as you can see it is now here at axew3.com, is still not implemented on the available w3images images plugin for wordpress 1.0.5 version. You can install the w3images 1.0.5 and after, simply overwriting plugins files, update to latest 1.0.6. It is easy and immediate as any other (+ or -) easy and useful WordPress plugin.
    I hope to find out the time to improve also the w3images how to page.
    Any help request or question in reply on one of the many started threads here in the blog. Upload of the w3images plugin to the subversion plugins directory at WordPress.com will be done also as soon and will be used to give the w3images gallery images plugin for WordPress available for download and improvements, to anyone as released as GPL3. Enjoy (and maybe help if you can!)

  2. axew3 says:

    The code of the improved function that will be added to the w3images images gallery plugin for wordpress version 1.0.6 has been already published at w3it.org,
    to the following uri:
    http://www.w3it.org/forums/showthread.php?890-Recursive-Php-function-for-items-menu-list&p=9822#post9822

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>