Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 07 Jul 2011, 02:56
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Lightbulb How do I display notifications total - New PM # ?

In the notification menu where it says Your Notifications: #, is it possible to display the total notification # minus the PM total? So if you have 6 notifications but 2 are PM's the # would display 4. I ask because I plan on showing the PM total separate.

Thanks.
Reply With Quote
  #2  
Old 19 Jul 2011, 05:50
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Can somebody help me with this?

Thanks.

--------------- Added 20 Jul 2011 at 05:13 ---------------

Is it possible to take $notifications_total and subtract $vbphrase[unread_x_nav_compiled] (I think thats the variable for PM total)??
Reply With Quote
  #3  
Old 20 Oct 2011, 02:51
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Still want to do this.

Lynn?!
Reply With Quote
  #4  
Old 20 Oct 2011, 03:12
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I think you can do what you want if you edit the header template and replace {vb:raw notifications_total} with


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Edit: ...except that's for vb4, as pointed out in the next post...

Last edited by kh99; 20 Oct 2011 at 03:45.
Reply With Quote
  #5  
Old 20 Oct 2011, 03:22
MikesSite MikesSite is offline
 
Join Date: Jan 2009
For vb3?
Reply With Quote
  #6  
Old 20 Oct 2011, 03:44
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Oh...oops. Maybe $notifications_total - $bbuserinfo[pmunread] ?

Sorry, I'll have to look again, at the right code this time.
Reply With Quote
  #7  
Old 20 Oct 2011, 03:54
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Thanks! LMK if you come up with anything
Reply With Quote
  #8  
Old 20 Oct 2011, 04:08
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
OK, I got confused with the vb4 stuff and forgot that you can't do math like that in a template. So you'd have to use a plugin and create a new variable. I think you can use hook location global_setup_complete and code like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


then use $notifications_not_pm (or whatever you want to call it) in the navbar template in place of $notifications_total (the first time it appears, not the one in the 'if' condition).

But that's for if you want the notifications to show up normally but the count to not include pms. If you want the notifications to disappear if there are only pm notifications (so that the count is 0), you should just change $notifications_total and reset $show['notifications'] if necessary, like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


and of course then you don't need to change the navbar template.
Reply With Quote
  #9  
Old 20 Oct 2011, 04:22
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Thanks. Unfortunately it doesn't seem to be working, it's outputting nothing. Possibly wrong hook location?
Reply With Quote
  #10  
Old 20 Oct 2011, 04:24
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Well, I did try both of those before posting and they seemed to work. Which one did you try?
Reply With Quote
  #11  
Old 20 Oct 2011, 04:32
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Ahh I'm sorry, it's my fault. It does work, but only if I use $notifications_not_pm in the navbar template. I need to use it in the header template.
Reply With Quote
  #12  
Old 20 Oct 2011, 04:38
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Oh, then you're right, that hook location won't work. Unfortunately there's no hook between $notifications_total being set and the header template being rendered. So you could edit global.php and insert the code.

Or you could cheat. The template processing doesn't let you put arbitrary php code in there, but you can sneak some stuff into a condition. So before you use the value in the header template you could put this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


The if doesn't do anything, but the condition has a side-effect of setting that variable.

In either case you can disable the plugin.
Reply With Quote
  #13  
Old 21 Oct 2011, 19:27
MikesSite MikesSite is offline
 
Join Date: Jan 2009
Thank you very much for the help kh99!! The 'cheat' works like a charm.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Private Messages Enhancements WCF - New Way To Display Notifications v2 (CSS) LifesGreatestGift vBulletin 4.x Template Modifications 38 25 May 2016 04:56
Private Messages Enhancements TW7S - New Way To Display Notifications (jQuery,CSS,jGrowl) LifesGreatestGift vBulletin 4.x Template Modifications 187 24 Jul 2013 09:29



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:08.

Layout Options | Width: Wide Color: