The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
Can somebody help me with this?
Thanks. --------------- Added [DATE]1311135185[/DATE] at [TIME]1311135185[/TIME] --------------- Is it possible to take $notifications_total and subtract $vbphrase[unread_x_nav_compiled] (I think thats the variable for PM total)?? |
#3
|
|||
|
|||
Still want to do this.
Lynn?! |
#4
|
|||
|
|||
I think you can do what you want if you edit the header template and replace {vb:raw notifications_total} with
Code:
{vb:math {vb:raw notifications_total} - {vb:raw bbuserinfo.pmunread}} Edit: ...except that's for vb4, as pointed out in the next post... |
#5
|
|||
|
|||
For vb3?
|
#6
|
|||
|
|||
Oh...oops. Maybe $notifications_total - $bbuserinfo[pmunread] ?
Sorry, I'll have to look again, at the right code this time. |
#7
|
|||
|
|||
Thanks! LMK if you come up with anything
|
Благодарность от: | ||
Honourable |
#8
|
|||
|
|||
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:
Code:
$notifications_not_pm = $notifications_total - $vbulletin->userinfo['pmunread']; 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: Code:
$notifications_total -= $vbulletin->userinfo['pmunread']; if ($notifications_total == 0) $show['notifications'] = false; and of course then you don't need to change the navbar template. |
#9
|
|||
|
|||
Thanks. Unfortunately it doesn't seem to be working, it's outputting nothing. Possibly wrong hook location?
|
#10
|
|||
|
|||
Well, I did try both of those before posting and they seemed to work. Which one did you try?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|