View Single Post
  #2  
Old 08-28-2010, 06:20 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DaRK mAN306 View Post
Greeting everyone,

I'd like to know how to preregister the notifications menu variables(notifications_menubits & notifications_total) in the footer template..

I've read cellarius's article ([vB4] Rendering templates and registering variables - a short guide) but I was so stupid to understand the way to preregister the variables as I have no experience or what so ever in programming.!

So, can anyone point me on how to do that and could you please provide the code and where to place it if possible ?!

Thanks in advance ..

** You might want to read my thread on vBulletin.com found on this link: How can I change the notifications menu place ?
I had a rather nice PM tonig... err this morning so here you go!
The Night Owl (Me ) Says: Early birds catch the worms rise and shine some of you .

1) Create a new plugin:

AdminCP > Plugins & Products > Add New Plugin

Product = vBulletin
Hook Location = parse_templates
Title = Notifications moved from header to footer template
Execution Order = 5
Plugin PHP Code = *See Below*
Plugin is Active = Yes

Code:
vB_Template::preRegister('footer', array('notifications_menubits' => $notifications_menubits));
2) Now Edit the Header template and remove (Copy it before you delete):

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>
						<li><a href="private.php{vb:raw session.sessionurl_q}">{vb:rawphrase inbox}</a></li>
					</ul>
				</li>
				</vb:if>
And last but not least... Use that same code and add it to your bar where desired, if I remember correctly I've seen that bar/script before so most likely your pasting the code for it inside the footer template? *The plugin is based on that so if your bars code is not in the footer replace that name in the plugin with whatever template you are using, you seem to know by the screenshots so paste that code where desired and badda-bing

*I'm posting this for others in your thread(s) as well and credit goes to Lynne, I learned from her and many of the other greats we have around here . *Actually after sending you that PM I found this: http://www.vbulletin.com/forum/showt...avbar-template and I bet your search was one day off but it's the same concept so reference that for thinking outside the box and moving other things around a bit .

- Mike
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01400 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete