1
maxima
UserMenu Modification troubles
  • 2006/8/22 4:59

  • maxima

  • Not too shy to talk

  • Posts: 152

  • Since: 2006/3/4 4


I created a theme and placed the usermenu horizontally above the body. It works fine except for the Inbox message display. It is not retrieving the info from the database to show that there are messages waiting. This is what I have;
<!---- USER MENU --->
                <
b>User Menu:</b>
    <{if 
$xoops_isadmin}>
        <
class="greeting" href="<{$xoops_url}>/admin.php"><b>Admin</b></a> | 
        <
class="greeting" href="<{$xoops_url}>/user.php">View Account</a> | 
      <{else}>
        <
class="greeting" href="<{$xoops_url}>/user.php">View Account</a> | 
      <{/if}>
    <
class="greeting" href="<{$xoops_url}>/edituser.php">Edit Account</a> | 
    <
class="greeting" href="<{$xoops_url}>/notifications.php">Notifications</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}>
        <
class="greeting" href="<{$xoops_url}>/viewpmsg.php">Inbox</a> | 
      <{/if}>
    <
class="greeting" href="<{$xoops_url}>/user.php?op=logout">Logout</a>
    <!--- 
END USER MENU --->

I also had to replace all the 'block.lang' tags because they wouldn't display.

Can anyone give me some guidance on this? Why won't the original tags call the corresponding text and why won't the messages display? I am guessing it has something to do with paths.

Thanks

2
stefan88
Re: UserMenu Modification troubles
  • 2006/8/22 5:49

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

the messages do not show, because they are not assigned. You will have to do it in your theme. use this code in your theme.html file:

<{php}>
GLOBAL 
$xoopsUser;
$pm_handler =& xoops_gethandler('privmessage');
$uid $xoopsUser->getVar('uid');
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
$criteria->add(new Criteria('to_userid'$uid));
$msgcount $pm_handler->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('new_messages'$msgcount);
<{/
php}>


before the user menu part and replace $block.new_messages with $new_messages.

To make it more clean, you can use smartie plug in with the code above and have a smartie constant.


For language part you can use the smartie constant like this:

<{$smarty.const._LOGIN}>
<{
$smarty.const._REGISTER}>
<{
$smarty.const._SEARCH}>


and so on ... Just check the name of the constant in language file.

MAKE A BACK UP FIRST!

..

3
NeoFenix
Re: UserMenu Modification troubles
  • 2006/8/22 9:39

  • NeoFenix

  • Just popping in

  • Posts: 31

  • Since: 2005/7/8 3


This is working with XOOPS 2.2.x??

4
maxima
Re: UserMenu Modification troubles
  • 2006/8/22 14:05

  • maxima

  • Not too shy to talk

  • Posts: 152

  • Since: 2006/3/4 4


Stefan thanks for that help. It worked well. I didn't understand the smarty stuff so I used the bigger code.

NeoFenix I am not sure if you are asking or stating a fact but I am using 2.14

Login

Who's Online

217 user(s) are online (139 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

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

Latest GitHub Commits