8
This seems to be the question I have, but the code itslef totally confuses me. I currently have this on my main menu for anonymous users:
Home
Submit Question
FAQ
I'd like to add a bar that says "Archives", and link it to
http://www.google.com or something.
Here's what my code looks like from that file:
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;
}
Where would I insert my link to show under FAQ?