Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2013, 12:48 PM
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Notifications in Navbar

Is there any way I can get the normal vB notifications (like new PM's etc) to appear in the Navbar instead of the header?
Reply With Quote
  #2  
Old 04-01-2013, 01:18 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll need to edit the template, did you purchase or download your style somewhere?
I'd ask there.
Reply With Quote
  #3  
Old 04-01-2013, 02:02 PM
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I made the template myself.
Reply With Quote
  #4  
Old 04-01-2013, 03:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you're rendering your template, register the notification variables to your template, like:
Code:
$templater->register('notifications_menubits', $notifications_menubits);
$templater->register('notifications_total', $notifications_total);

Then look at the original navbar template and copy the parts that display notifications_menubits and notifications_total (unless that's the part you were asking about, in which case this doesn't help ).
Reply With Quote
  #5  
Old 04-01-2013, 03:37 PM
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's where I get lost, I don't know anything about rendering. I tried reading this: https://vborg.vbsupport.ru/showthread.php?t=228078 but it loses me very quickly.
Reply With Quote
  #6  
Old 04-01-2013, 03:54 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, when you say you made the template yourself, do you mean that you made a new one called navbar to replace the original? In that case you don't have to worry about the registering, you just need to find the code from the original that mention notifications_menubits and notifications_total, and copy it to your new template.
Reply With Quote
  #7  
Old 04-01-2013, 04:11 PM
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh sorry, my bad, bad wording. I meant I made the style myself. It is still using the original Navbar template.
Reply With Quote
  #8  
Old 04-01-2013, 04:41 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, it's my fault - I see now the original question is how you would move it to the navbar from the header. I kind of came in in the middle and got confused.

Anyway, it's the same advice - find the code in the header that displays notifications_total and notifications_menubits, and copy it to your navbar template. As it turns out, those are already registered to the navbar template, so you don't have to worry about that (probably it's left over from vb3 or something). Here's the code from the header template:

Code:
<vb:if condition="$notifications_total">
<li class="popupmenu notifications" id="notifications">
	<a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}: <span class="notifications-number"><strong>{vb:raw notifications_total}</strong></span></a>
	<ul class="popupbody popuphover">
		{vb:raw notifications_menubits}
	</ul>
</li>
<vb:else />
<li class="popupmenu nonotifications" id="nonotifications">
	<a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}</a>
	<ul class="popupbody popuphover">
		<li>{vb:rawphrase no_new_messages}</li>
		<vb:if condition="$show['pmmainlink']"><li><a href="private.php{vb:raw session.sessionurl_q}">{vb:rawphrase inbox}</a></li></vb:if>
	</ul>
</li>
</vb:if>

but that uses <li> tags because it's inside <ul> tags, so if you don't have the same situation in your navbar template then you'll have to do something about that.
Reply With Quote
  #9  
Old 04-01-2013, 04:48 PM
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you say copy it to my navbit template, which template is that? I don't have a navbit, do you mean navbar?

Almost got it working. Just need to figure out how to change the font size and colour as it's using what was in the header.

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

I believe I have it working now.



The only thing is the font is slightly different from the navbar items. And when there are no notifications the font size is smaller.
Reply With Quote
  #10  
Old 04-01-2013, 06:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

navbit was a typo, I meant navbar. If you look at the CSS classes being used in the tags, you could probably figure out the font issue.
Reply With Quote
Reply


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 01:39 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03940 seconds
  • Memory Usage 2,248KB
  • 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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete