The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How can I change the notifications menu place ?
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 ? |
#2
|
||||
|
||||
Quote:
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)); 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> *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 |
#3
|
||||
|
||||
Thank you very much mike and I mean very very very much for your reply ..
It was exactly what I was looking for .! I followed your directions step-by-step but I couldn't get it to work .. At first, I thought that the problem is in my test forum, but when I tested Lynne's trick on the link you provided me with (Moving Facebook Connect out of the header template and into the navbar template) ... It worked like charm .. I also tried preregistering other variables based on both Lynne's directions and yours and I succeed in it, but every time I come back to preregistering the notifications_menubits variable I fail in it .! I appreciate your help Mr. Miller and I'm 100% sure that your directions are correct .. But as I can see the problem is not with the way to preregister the variable as Lynne have told me on my thread on vBulletin.com, there gotta be something else to do in this particular case .! Thanks again for your help Mr. Miller .. I'll try speaking to Lynne seeking for help with this issue; because I don't want to bother you and to waste your time with me on such things .! Best Regards, ME |
#4
|
||||
|
||||
Quote:
Basically you can use my info or Lynne's as you had success with that and simply change the code to pre-register what you need but remember you need to remove the old code from the header or it won't work in the footer!! - copy the header and footer template into a empty notepad etc before you start so you can quickly paste back in or simply revert the template if it was not previously customized in case you make a mistake . |
#5
|
||||
|
||||
Hi again Mr.Miller,
Yeah, I'm aware of that - I mean that I have to change the template's name in the plugin to correspond with where I place the bar code - .! First, I tested the code on the default vBulletin skin; I added a new plugin that is identical to what you posted before in Post #2, then I went to the header template and had the notification code simply cut (Ctrl+X) and then saved the template, after that I went to the footer template and pasted the notification code after the last line, saved the template and then went to the test forum homepage and pressed (Ctrl+F5) to make a full refresh - aka unconditional refresh -, then I went downstairs to check the footer and guess what? the notification menu was sitting there but it was deactivated - didn't display the number of notifications I had even though I had 2 new pms -!! I tried placing the code in several places in the footer template itself and when it all failed, I tried placing it in the FORUMHOME template after changing the template name in the plugin code and it also didn't work .! I even tried adding the notifications_total variable to the array in the plugin's code but it didn't help .! Again, please don't waste your time on me .! I'll try to solve this in every possible way and once I succeed I'll post the solution here for others to benefit from it .. Thanks again for your - big time - help and wish you all the best .! --------------- Added 29 Aug 2010 at 20:56 --------------- Greetings guys, Thanks to both Mike and Lynne for their sincere help - if this is the right word to describe it - .. At least, now I know how to preregister variables in case I needed to preregister something in the future .. My problem is that it's refusing to work with me every time I try to preregister the notifications_menubits variable and I think that there is something wrong with this variable in particular because when I preregistered the facebook button to work in the navbar as Lynne has explained on this thread, it worked like charm .. This problem is causing me all type of headaches and because of that I had to to fix it "in the old school way" .. It's true that it's a cheap way, but as long as it works I don't care .! I'll be waiting for vBulletin developers to make a useful tool that makes it easy for users to preregister such variables .! What I did was this:
Just to point out, this fix is in BETA stage .. I'll be testing it in the few couple of days to make sure that it works as it is supposed to !! This means that I don't need to know how to fix this issue anymore unless someone wanted to provide us with a reasonable fix .! Thanks again to Mike for his outstanding help, thanks to Lynne for her corresponding on vBulletin.com and thanks in advance for those who might provide something clean as a fix for this issue .! Kind Regrads, ME |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|