Quote:
Originally Posted by DaRK mAN306
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