Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 12-28-2015, 01:51 AM
bradthor bradthor is offline
 
Join Date: Nov 2015
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how to get a list of notifications

expounding on Markfl's answer given in the following getting the total number of notifications and this thread Adding a notification.how would I get a dynamic array of all the notifications or of each of the notification types in vbulletin so that I can create a dynamic list of notifications?
Also If there is any documentation about the various userinfo ,activity and notification types and the functions that are used to instantiate them that would be really helpful.
Thanks a ton in advance.
Reply With Quote
  #2  
Old 12-28-2015, 01:55 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you check the "user" table, you will see columns such as "vmunreadcount", "friendreqcount", etc. I think you can access those variables in the $vbulletin->userinfo array to then process them to your needs.
Reply With Quote
  #3  
Old 12-28-2015, 02:08 AM
bradthor bradthor is offline
 
Join Date: Nov 2015
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the answer....how would I do this exactly?
Reply With Quote
  #4  
Old 12-28-2015, 02:40 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In my reply in the other thread, I think I gave you all of the notification types intrinsic to vB 4. You would then have to look at your "user" table to see if any of your installed products have added any of their own, such as "DragonByte Tech: Advanced Post Thanks / Like (Pro)" does.

Then once you have determined all of the notification types on your site, you would add them all up to get the total.
Reply With Quote
  #5  
Old 12-28-2015, 12:11 PM
bradthor bradthor is offline
 
Join Date: Nov 2015
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont need the total any more ...the message you sent hlped me figure that out ... I need to make a dynamic list from each of those so I can make a notifications list

--------------- Added [DATE]1451311925[/DATE] at [TIME]1451311925[/TIME] ---------------

I need to find out how to use those functions you mentioned to make a dynamic list
Reply With Quote
  #6  
Old 12-28-2015, 01:24 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, in your PHP code, you could do something like:

PHP Code:
$notifications '';

//Only display for non-zero values.

if ($vbulletin->userinfo['pmunread'])
{
    
$notifications .= 'Unread PMs: ' $vbulletin->userinfo['pmunread'] . PHP_EOL;
}

//Check for other notifications in the same way. 
Then you could wrap the $notifications string in the appropriate HTML before appending it to a template hook or you might have a custom template designed that you would simply register this string so it can by output there.
Reply With Quote
  #7  
Old 12-28-2015, 02:20 PM
bradthor bradthor is offline
 
Join Date: Nov 2015
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Well, in your PHP code, you could do something like:

PHP Code:
$notifications '';

//Only display for non-zero values.

if ($vbulletin->userinfo['pmunread'])
{
    
$notifications .= 'Unread PMs: ' $vbulletin->userinfo['pmunread'] . PHP_EOL;
}

//Check for other notifications in the same way. 
Then you could wrap the $notifications string in the appropriate HTML before appending it to a template hook or you might have a custom template designed that you would simply register this string so it can by output there.
Thanks for the reply BUT i noticed that perhaps I haven't explained what i'm trying to achieve properly.
I understand that
PHP Code:
$vbulletin->userinfo['pmunread'
fetches the number of "pmunread" notifications however lets say that there is 1 "pmunread" notification ,what would be the best way to go about retrieving information about this 1 "pmunread" notification eg:- pmtextid, messageread, fromusername, pmid and the associated (serialized) format for that notification type eg:-('user X has just messaged you Re:pmtext');
and then display that in a foreach loop which accounts for a dynamic list of notifications, just like the facebook notifications dropdown.
I hope this makes more sense.
Thanks again for the reply
Reply With Quote
  #8  
Old 12-28-2015, 02:22 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You will have to query the pm/pmtext table in that case. As far as I know vBulletin doesn't provide a function or array that contains all the information you need.
Reply With Quote
Благодарность от:
MarkFL
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 03:02 PM.


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.04373 seconds
  • Memory Usage 2,236KB
  • 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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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