Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-06-2016, 12:22 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default exclude private messages from notifications total

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
Reply With Quote
  #2  
Old 04-06-2016, 12:24 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried to use the difference:

PHP Code:
$notification['total'] - $bbuserinfo['pmunread'
Reply With Quote
Благодарность от:
Dr.CustUmz
  #3  
Old 04-06-2016, 01:16 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have not
but i found a plugin that might do the job i just need help converting one line

Code:
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 [DATE]1459912757[/DATE] at [TIME]1459912757[/TIME] ---------------

i did manage to get the correct if statement

PHP Code:
<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 [DATE]1459913470[/DATE] at [TIME]1459913470[/TIME] ---------------

I GOT IT =P lmao was so easy -_-

plugin:

in notifications_list
Code:
unset($notifications[pmunread]);
the rest was achieved by the original if conditions

templates:

Code:
<if condition="$notifications_total">
  <span>$notifications_total</span>
</if>
shows total notifications OTHER THAN PMS since we unset them

Code:
<if condition="$bbuserinfo[pmunread]">
  <span>($bbuserinfo[pmunread])</span>
</if>
shows amount of pms

that'll do it =)
Reply With Quote
  #4  
Old 04-06-2016, 02:07 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I would use the difference rather than unsetting a variable...that may cause issues...
Reply With Quote
  #5  
Old 04-06-2016, 02:29 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Code:
<if condition="$notification['total'] > 0">
<li><a href="$notification[link]"><span>$notification[total]</span> $notification[phrase]</a></li>
</if>
notification total (no pm)
Code:
<if condition="$notifications_total">
  <span>$notifications_total</span>
</if>
pm total
Code:
$bbuserinfo[pmunread]
--------------- Added [DATE]1459917142[/DATE] at [TIME]1459917142[/TIME] ---------------

btw
Code:
<if condition="$notifications_total - $bbuserinfo['pmunread']">
<span>$notifications_total</span>
</if>
is the way i thought it would work =/ no luck
Reply With Quote
  #6  
Old 04-06-2016, 02:33 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was assuming both variables mentioned were available and that you wanted to take action only if there were non-pm related notifications.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04312 seconds
  • Memory Usage 2,218KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete