The links that are inside the standard PHP-Nuke module block are constructed dynamically, using information that is available about the modules in the database.
For example, to present only active modules in the links, the block (located in blocks/block-Modules.php) checks the "active" field of the $prefix_modules table (which is table nuke_modules, if
$prefix is left to the standard "nuke" in config.php, see Section 3.7):
$sql = "SELECT title, custom_title FROM ".$prefix."_modules
WHERE active='1' AND inmenu='0' ORDER BY title ASC";
As we can easily read in the SELECT query above, only modules with the "active" bit set to 1 are selected. But we also see that the order in which they are selected is the standard ascending
lexicographic order of the modules' title (ORDER BY title ASC). If we wish a different ordering, we are left with only a few possibilities:
Change the order from ascending (ASC) to descending (DESC):
$sql = "SELECT title, custom_title FROM ".$prefix."_modules
WHERE active='1' AND inmenu='0' ORDER BY title DESC";
Change the field on which the ORDER BY clause is applied, e.g. use custom_title instead of title:
$sql = "SELECT title, custom_title FROM ".$prefix."_modules
WHERE active='1' AND inmenu='0' ORDER BY custom_title ASC";
Add an extra field to the $prefix_modules table, populate it with custom values (e.g. "1" for the module we want to be the first in the list, , "2" for the second, "3" for the third etc. if we
decided to use a numeric field ) for each module, and sort in ascending order of this new field:
$sql = "SELECT title, custom_title FROM ".$prefix."_modules
WHERE active='1' AND inmenu='0' ORDER BY new_field ASC";
But if we wish a custom grouping of the modules links, we will have to write our own modules block. You can use the following code as a starting point for your own creations. This script will
display certain links only when an admin or user is logged in. Just name it block-menuSample.php and put in the blocks folder, deactivate the block-Modules.php and activate this one (see Different links - some for registered users only and How would I add a clickable link in a Modules Block?):