1
patagon
Hello username, you have X new private messages
  • 2003/6/20 16:39

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Hi:

i would like to display in theme.html a welcome text saying: Hello username, you have X private messages. I figured the hello username part and I took the following code from somewhere (its diffucult to search for PM related messages since PM is only two words and XOOPS has a 3 word limit for searching):

<{if $block.new_messages > 0}>
<{$block.lang_inbox}> (<{$block.new_messages}>)
<{else}>
<{$block.lang_inbox}>
<{/if}>

But it doesnt work...anyone knows whats wrong with it? and or how to do it?

If you want to look for a sample of what I want to do the following site does exactly what I want:http://www.secondsquare.com
This is the site of a user here (dlh, I asked him how he did it but I guess he missed my post).

Thanks

2
patagon
Re: Hello username, you have X new private messages
  • 2003/6/20 16:41

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Sorry for the double posting, it seems my browser hanged up during submit and ended up with two posts

3
tl
Re: Hello username, you have X new private messages
  • 2003/6/20 17:34

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


You can find the code in the Colors template. Search "colors" under download will lead you to Colors theme/template

file name under system/blocks:
system_block_user.html

4
patagon
Re: Hello username, you have X new private messages
  • 2003/6/20 18:30

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks for the reply! I found the template and included it in theme.html (instead of in a block). However it doesnt show when I have a new message, it always says you have 0 new messages

Here is the code I copied in theme.html

Hi <{$xoops_uname}>,
<{if $block.new_messages > 0}>
you have
<{$block.new_messages}> new message(s)
<{else}>
you have no new message
<{/if}>



Account info
·

Logout

<{if $xoops_isadmin}>
·

XOOPS admin

<{/if}>

is there any reason why this would work in a block but not in theme.html?

thanks

5
mvandam
Re: Hello username, you have X new private messages
  • 2003/6/20 19:31

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


Quote:

is there any reason why this would work in a block but not in theme.html?


How are you getting '$block.new_messages' into theme.html? You would have to do an assign to $xoopsTpl somewhere so the theme knows about this value, since this is not part of the standard information assigned by the core.

Probably putting in a block is better unless you want to mess with the core.

6
patagon
Re: Hello username, you have X new private messages
  • 2003/6/20 19:44

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks for the reply...no idea how I was getting that into theme.html, as usual I was just trying to do something and overlooking something really obvious (but not for me

I will try it in a block instead now that I know it works there

7
fritz_corner
Re: Hello username, you have X new private messages

I just don't get why you should say "Why do you want to do that? Do this instead".

Right now I've disabled my user menu block and instead I've put some links in the page header. Everything works except that pm notification stuff, of course. I would REALLY like how to make the link turn into another color or show the number of unread messages. Blocks are nice but sometimes it gets too "blocky". Please post if you have any idéas. Just remember that I'm a newbie and don't know jack s**t about php coding.

8
banesto
Re: Hello username, you have X new private messages
  • 2005/8/23 16:32

  • banesto

  • Just popping in

  • Posts: 61

  • Since: 2005/1/24


see this thread:

thread
where's my red bull!

9
ChronicTom
Re: Hello username, you have X new private messages
  • 2011/3/27 14:41

  • ChronicTom

  • Just popping in

  • Posts: 2

  • Since: 2011/3/27


Was there ever a solution to this?


10
oswaldo
Re: Hello username, you have X new private messages
  • 2011/3/27 21:44

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


You can use the wblocks module from esxoops.com download here

Login

Who's Online

118 user(s) are online (66 user(s) are browsing Support Forums)


Members: 0


Guests: 118


more...

Donat-O-Meter

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

Latest GitHub Commits