1
Anat_k
How to merge user menu with main menu together ?
  • 2006/6/23 4:49

  • Anat_k

  • Just popping in

  • Posts: 24

  • Since: 2006/6/21


I want to merge user menu with main menu together. help me pls.

2
scoobster
Re: How to merge user menu with main menu together ?
  • 2006/6/23 8:57

  • scoobster

  • Just popping in

  • Posts: 28

  • Since: 2005/2/5 1


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'] == && $xoopsConfig['sslloginlink'] != '') {
            
$block['sslloginlink'] = "javascript:openWithSelfMain('".$xoopsConfig['sslloginlink']."''ssllogin'300200);">"._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">
      <
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}>
        <
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.

Login

Who's Online

383 user(s) are online (308 user(s) are browsing Support Forums)


Members: 0


Guests: 383


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits