TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 744
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 289
  • Total: 289

PM notification in user block

Started by Ginladar, October 06, 2008, 05:04:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ginladar

I noticed the PM notification seems to show the total PM's in the users PM box.  Once I have read a PM, I would like it to only show Unread PM's instead of all.  Is that available somewhere?  Or is there a source I could modify to see it that way, and set tit that way for my users.  I like to keep PM's, but would like to know when I get new ones in.  Thanks! 

Using SMF 1.1.6 with TP 0.9.8

Ken.

#1
Hi Ginladar, welcome to TinyPortal.

PM's are a function of SMF so your question should be posted to the SMF forum.
... disregard my incorrect answer.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Ginladar

Yeah, I was talking about the PM notification in the User box in TinyPortal.  Forgive me if I was unclear in that clarification.  I have just installed this package with SMF starting this last Thursday evening, and am already going live with it.  I really like a lot of the things it does.

It is not a big deal, just a little thing I would like to see settable maybe in the TP settings or something.  Or if someone could steer me to where that comes from.  i tried going into the settings for the User Box, but couldn't see any related settings there, though it is definitely possible I might have missed it.

IchBin

I dont think that is really possible. Because the way SMF works, is that once you go to the PM section it automatically marks ALL PM's read. Leaving you with no unread message to show in your user block.

Ginladar

Yes, but right now I have 1 message in my PM box, which I have read.  The user panel still shows 1 PM, which is already read.  If it was showing the unread ones, it should be saying 0 right now.  I believe that is correct.  I will look for the code for the user box to see if I can isolate the issue, possibly.  Thanks!

IchBin

I understand that. But if you have lets say 5 unread messages when you login. If you have it fixed the way you want it, it will show 0 the minute you read one unread message. Which wouldn't be true if you weren't able to read the other messages.

The code is in the TPortalBlocks.template.php file in the default theme.
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
<li><a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a></li>';
if($context['user']['unread_messages']>0)
echo '
<li style="font-weight: bold; "><a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a></li>';
}

Ginladar

That makes sense.  i think what confused me is I am also using the 'Dragon Soul - Reborn' theme from StrmLrd.

Here is the code from the index.template.php file: 


if ($context['allow_pm']){

     echo '<br />'.$bullet.' <a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';

     if($context['user']['unread_messages']>0)

          echo '<br />'.$bullet.' <a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a> <img src="'.$settings['images_url'].'/msg.gif" border="0px" alt="">';



Is there any way to restrict that to only show unread PM's ?  I am going to search through the SMF forums now, because it looks more and more like it is something on their end.  Maybe there is a different variable I can throw in there to represent unread PM's or something.

Sorry for the confusion, still a newbie to TP and SMF, and already implementing pretty advanced things on there in my opinion.

IchBin

The last two lines are the lines that show the unread PM's. But I don't get the reasoning behind this. It will only show you the unread PM's once. If you don't want the number of PM's just delete the first echo line. So that you have this:
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
if($context['user']['unread_messages']>0)
echo '
<li style="font-weight: bold; "><a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a></li>';
}

Ginladar

Yep that did the trick.  Thanks for the tips, and please pardon my thick head on these issues.  Using TP, the top menu had one userbox, while the side menu has another userbox.  Changing that code allowed my Top menu Userbox to only show unread PM's.  That was the most annoying issue I was seeing.

This website is proudly hosted on Crocweb Cloud Website Hosting.