1
Buzzy
How can i put INBOX in other bloc that User Menu ???
  • 2003/10/16 10:19

  • Buzzy

  • Just popping in

  • Posts: 6

  • Since: 2003/9/30


I just want to put the 'InBox' message (you have PM... and the number) in another bloc than 'User Menu'. For example, in a new center bloc ...

Thank's for that !

2
ackbarr
Re: How can i put INBOX in other bloc that User Menu ???

you need to create a "php script" block with something similar to the following:

le="color: #000000"><?php global $xoopsUser; //Path to Private Messages Page $pmUrl = XOOPS_URL . '/viewpmsg.php'; //Retrieve # of unread messages if ($xoopsUser) { $pm_handler =& xoops_gethandler('privmessage'); $criteria = new CriteriaCompo(new Criteria('read_msg', 0)); $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid'))); $msgcount = $pm_handler->getCount($criteria)); } else { $msgcount = 0; } //Display the link if ($msgcount > 0) { echo "<a class="highlight" href="$pmUrl">Inbox (<span style="color:#ff0000; font-weight: bold;">$msgcount</span>)</a>"; } else { echo "<a href="$pmUrl">Inbox</a>"; }

3
Dr3vil
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/8 19:55

  • Dr3vil

  • Friend of XOOPS

  • Posts: 57

  • Since: 2003/5/10


Is it possible to put something like this into a theme.html? I'm trying to modify a theme to include the normal items of the 'User Menu' in a top menu bar and I would like to be able to include a unread messages count.

I would like my menu bar to look something like this with NO messages:

hello admin | your account | notifications | admin | Inbox | logout

I would like my menu bar to look something like this with SOME messages:

hello admin | your account | notifications | admin | Inbox (3) | logout


Thanks in advance,
Dr3vil

4
CBlue
Re: How can i put INBOX in other bloc that User Menu ???

I had this table in one of my themes that I don't use anymore.

<table class="main" width="95%" border="0" align="center">
<tr>
<td align="center" width="100%">
| <a href="<{$xoops_url}>">Home</a> | <a href="<{$xoops_url}>/modules/mydownloads/">Downloads</a> | <a href="<{$xoops_url}>/modules/mylinks/">Links</a> | <a href="<{$xoops_url}>/user.php">User Account</a> | <a href="<{$xoops_url}>/notifications.php">Notifications</a> | <a href="<{$xoops_url}>/viewpmsg.php">Private Messages</a> | <a href="<{$xoops_url}>/modules/contact/">Contact Us</a> | <a href="<{$xoops_url}>/admin.php">Admin</a> | <a href="<{$xoops_url}>/user.php?op=logout">Logout</a> |
</td>
</tr>
</table>

You can edit it to add whatever links you want. Just put it where you want it to be seen in your theme.html file.

I had mine at the very top of my theme above the logo and banner section.

5
CBlue
Re: How can i put INBOX in other bloc that User Menu ???

I had this in the same theme but it showed under the logo and banner.

<div id="nav">
<div class="row"> <span class="left"><img src="<{$xoops_imageurl}>bullet.gif" alt="" />
<{if $xoops_isuser}>Welcome, <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>!</a>
<{else}> <a href="<{$xoops_url}>/register.php">Click here to register!</a> <{/if}></span>
</div>
</div>

6
Dr3vil
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/8 23:34

  • Dr3vil

  • Friend of XOOPS

  • Posts: 57

  • Since: 2003/5/10


Thanks CBlue, I have that part already ('My Account', 'Notification', 'Log out', etc) in my menu.

What I was looking for was some way to display 'Inbox' in the menu when no new messages are there and 'Inbox (3)' if you had 3 waiting private messages.

Thanks,
Dr3vil

7
CBlue
Re: How can i put INBOX in other bloc that User Menu ???

<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>

You can change the color from red to any color. This code will show message numbers if you have messages.

8
Dr3vil
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/8 23:48

  • Dr3vil

  • Friend of XOOPS

  • Posts: 57

  • Since: 2003/5/10


Thanks, I'll try this. Are the variables $block.lang_inbox & $block.new_messages available to the Themes?

Sorry if this seems obvious, I'm still learning xoops.


9
CBlue
Re: How can i put INBOX in other bloc that User Menu ???

It should be! Try out the code above and if it doesn't work, you'll know it soon!

10
Dr3vil
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/9 13:28

  • Dr3vil

  • Friend of XOOPS

  • Posts: 57

  • Since: 2003/5/10


Well, I just tried it and no go. all it displays is () when there is one message in the inbox. Other ideas?

Login

Donat-O-Meter

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

Latest GitHub Commits