View Full Version : exclude private messages from notifications total
Dr.CustUmz
04-06-2016, 12:22 AM
im trying to exclude PMs from the total count of notifications and the list.
<if condition="$notification['total'] > 0">
i know it would be built off this, i just have no idea how to set it up
example
<if condition="$notification['total'] > 0"> (AND IS NOT A $bbuserinfo[pmunread] NOTIFICATION)
show all other notifications
<else />
NO NEW NOTIFICATIONS
</if>
*note !$bbuserinfo[pmunread] was tried, but failed
i found $notifications['pmunread']
but still cant figure out how to not show them in the notifications
MarkFL
04-06-2016, 12:24 AM
Have you tried to use the difference:
$notification['total'] - $bbuserinfo['pmunread']
Dr.CustUmz
04-06-2016, 01:16 AM
i have not
but i found a plugin that might do the job i just need help converting one line
vB_Template::preRegister('header', array('newmessages' => $vbulletin->userinfo['pmunread']));
Im no good when it comes to vb4 code, and I think this needs to be an eval. Im just not sure how exactly to convert it to vb3
this (along with the rest of the code) unsets pmunread from notifications and creates it individually.
--------------- Added 1459912757 at 1459912757 ---------------
i did manage to get the correct if statement
<if condition="$vbulletin->userinfo['pmunread'] != $notifications_total">
that removes pm notifications from the notifications list, but the notification still remains in the total count, and if i can get that code in my previous post converted it should solve it
--------------- Added 1459913470 at 1459913470 ---------------
I GOT IT =P lmao was so easy -_-
plugin:
in notifications_list
unset($notifications[pmunread]);
the rest was achieved by the original if conditions
templates:
<if condition="$notifications_total">
<span>$notifications_total</span>
</if>
shows total notifications OTHER THAN PMS since we unset them
<if condition="$bbuserinfo[pmunread]">
<span>($bbuserinfo[pmunread])</span>
</if>
shows amount of pms
that'll do it =)
MarkFL
04-06-2016, 02:07 AM
I think I would use the difference rather than unsetting a variable...that may cause issues...:)
Dr.CustUmz
04-06-2016, 02:29 AM
im only unseting it in the notifications_list, what potential issues could there be? i tried the difference but couldnt get that to work.
the end goal is: (not implemented in these codes)
NOTIFICATIONS LIST (no pm)
<if condition="$notification['total'] > 0">
<li><a href="$notification[link]"><span>$notification[total]</span> $notification[phrase]</a></li>
</if>
notification total (no pm)
<if condition="$notifications_total">
<span>$notifications_total</span>
</if>
pm total
$bbuserinfo[pmunread]
--------------- Added 1459917142 at 1459917142 ---------------
btw
<if condition="$notifications_total - $bbuserinfo['pmunread']">
<span>$notifications_total</span>
</if>
is the way i thought it would work =/ no luck
MarkFL
04-06-2016, 02:33 AM
I was assuming both variables mentioned were available and that you wanted to take action only if there were non-pm related notifications.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.