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:

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 
"highlight" href="$pmUrl">Inbox (color:#ff0000; font-weight: bold;">$msgcount)";
} else {
  echo 
"$pmUrl">Inbox";
}

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.






| Home | Downloads | Links | User Account | Notifications | Private Messages | Contact Us | Admin | Logout |


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.


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 ???

<{$block.lang_inbox}> (<{$block.new_messages}>)

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

Who's Online

426 user(s) are online (317 user(s) are browsing Support Forums)


Members: 0


Guests: 426


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