2
This is the way I'd do it, but there's probably others.
In /modules/system/blocks/system_blocks.php
edit function b_system_main_show()
before
$block['lang_home'] = _MB_SYSTEM_HOME;
add
global $xoopsUser,$xoopsModule,$xoopsConfig;
$block = array();
if (!$xoopsUser) {
$block['lang_username'] = _USERNAME;
$block['unamevalue'] = "";
if (isset($_COOKIE[$xoopsConfig['usercookie']])) {
$block['unamevalue'] = $_COOKIE[$xoopsConfig['usercookie']];
}
$block['lang_password'] = _PASSWORD;
$block['lang_login'] = _LOGIN;
$block['lang_lostpass'] = _MB_SYSTEM_LPASS;
$block['lang_registernow'] = _MB_SYSTEM_RNOW;
if ($xoopsConfig['use_ssl'] == 1 && $xoopsConfig['sslloginlink'] != '') {
$block['sslloginlink'] = "javascript:openWithSelfMain('".$xoopsConfig['sslloginlink']."', 'ssllogin', 300, 200);">"._MB_SYSTEM_SECURE."";
}
} else {
$pm_handler =& xoops_gethandler('privmessage');
$block['lang_youraccount'] = _MB_SYSTEM_VACNT;
$block['lang_editaccount'] = _MB_SYSTEM_EACNT;
$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
$block['uid'] = $xoopsUser->getVar('uid');
$block['lang_logout'] = _MB_SYSTEM_LOUT;
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
$block['new_messages'] = $pm_handler->getCount($criteria);
$block['lang_inbox'] = _MB_SYSTEM_INBOX;
$block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;
}
note the $xoopsConfig part.
Then in your /modules/system/templates/blocks/system_block_mainmenu.html file add:
<{if !$xoops_uname}>
<tr>
<td>
<form style="margin-top: 0px;" action="<{$xoops_url}>/user.php" method="post">
<{$block.lang_username}><br />
<input type="text" name="uname" size="12" value="<{$block.unamevalue}>" maxlength="25" /><br />
<{$block.lang_password}><br />
<input type="password" name="pass" size="12" maxlength="32" /><br />
<input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>" />
<input type="hidden" name="op" value="login" />
<input type="submit" value="<{$block.lang_login}>" /><br />
<{$block.sslloginlink}>
form>
<a href="<{$xoops_url}>/user.php#lost"><{$block.lang_lostpass}>a>
<br /><br />
<a href="<{$xoops_url}>/register.php"><{$block.lang_registernow}>a>
td>
tr>
<{else}>
<tr>
<td id="usermenu">
<a class="menuTop" href="<{$xoops_url}>/user.php"><{$block.lang_youraccount}>a>
<a href="<{$xoops_url}>/edituser.php"><{$block.lang_editaccount}>a>
<a href="<{$xoops_url}>/notifications.php"><{$block.lang_notifications}>a>
<a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}>a>
<{if $block.new_messages > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}>span>)a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}>a>
<{/if}>
<{if $xoops_isadmin}>
<a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}>a>
<{/if}>
td>
tr>
<tr>
<td>
<br />
td>
tr>
<{/if}>
after the first line
<table cellspacing="0">
Don't forget to then update your system module to pick up the changes.
Should do the trick.