Hope this helps.
<div id="content"> <table id="mod_header">
<tbody><tr><td width="100%"><span class="h18px"><a href="http://mysite">Home</a> > Soapbox</span></td>
<td width="100"><span class="h18right">Soapbox</span></td></tr>
</tbody></table>
<h3 class="h3a">Welcome to Soapbox</h3>
<span class="intro">In this area of the site you will find our
catalogue of editorial columns, as well as the latest article from each
of our authors. Click on a column’s name to see all the articles
associated to that column, or on an article’s name to read directly the
article. Depending on privileges, you can rate each article, select
notification options or leave your comments.</span>
<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>
<{foreach item=sublink from=$module.sublinks}>
<a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- end module menu loop -->
<a href="http://www.google.com">Archives</a>
</td>
</tr>
</table>
<a href="http://www.google.com">Archives</a>
<!-- end module menu loop -->
function b_system_main_show()
{
global $xoopsUser,$xoopsModule;
$block = array();
$block['lang_home'] = _MB_SYSTEM_HOME;
$block['lang_close'] = _CLOSE;
$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
$criteria->add(new Criteria('isactive', 1));
$criteria->add(new Criteria('weight', 0, '>'));
$modules =& $module_handler->getObjects($criteria, true);
$moduleperm_handler =& xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$read_allowed =& $moduleperm_handler->getItemIds('module_read', $groups);
foreach (array_keys($modules) as $i) {
if (in_array($i, $read_allowed)) {
$block['modules'][$i]['name'] = $modules[$i]->getVar('name');
$block['modules'][$i]['directory'] = $modules[$i]->getVar('dirname');
$sublinks =& $modules[$i]->subLink();
if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
foreach($sublinks as $sublink){
$block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']);
}
} else {
$block['modules'][$i]['sublinks'] = array();
}
}
}
return $block;
}