Announcement

Collapse
No announcement yet.

How can I change the notifications menu place ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] How can I change the notifications menu place ?

    Greeting everyone,

    I'd like to know how to move the notifications menu (seen in attachment no.1) from the header template into the footer template or any other template without having it deactivated ..

    The thing is that I'm working on installing a bottom bar - aka facebook bar - on my forums, but the problem is that once I place the notifications menu code into the footer template it gets automatically disabled .! In simple words, once you move the notifications menu code out of the header template and/or the navbar template, it refuses to work .!

    First I thought that the problem is in the bottom bar code, but once I moved the code into the header template the notifications menu worked properly .! It also worked when I moved the code into the navbar template .! Once I moved the code into the forumhome template - or any other template besides the header & navbar template - it refused to work again ..

    This is the default notifications menu code found on the default vBulletin 4 Style:
    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>
    Try moving it to any template besides the header/navbar templates and you'll see what I'm talking about, but make sure first that you have notifications, such as, new pm or so .!

    The question now is how to fix this issue and move the notifications menu code into the footer template without having it deactivated ? Is it a bug or is it supposed to work like this ?!

    EDIT: Before you say: "As long as it works fine in the header template, then leave it there", I'd like to inform you that this is not an option because once you place the "bottom" bar in the header then you'll have to look for it under the forums when you scroll up&down .!

    Thanks in advance for any help ..


    ATTACHED PICS:

    ATTACH #1: The notifications menu code is in the header template (default) - works fine !
    ATTACH #1


    ATTACH #2: The notifications menu code is in the footer template (edited) - doesn't work !
    ATTACH #2


    ATTACH #3: The notifications menu code is integrated with the bottom bar in the footer template (default) - doesn't work !
    ATTACH #3


    ATTACH #4: The notifications menu code is integrated with the bottom bar in the header template (edited) - works fine !
    ATTACH #4
    Last edited by DaRK mAN306; Tue 24th Aug '10, 7:22am.

  • #2
    You can't just move it. You are using variables that need to be registered in the template they are being used in. So, you will need to preregister the variables for use in the footer template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment


    • #3
      Originally posted by Lynne View Post
      You can't just move it. You are using variables that need to be registered in the template they are being used in. So, you will need to preregister the variables for use in the footer template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
      Thank you for your respond Lynne .!

      Could you please guide me on this topic ?!
      I mean, how to register the notification variables (notifications_menubits, notifications_total) for use in the footer template .!

      Because I spent the whole night reading cellarius's article and messing with the "functions.php" file, adding plugins (... etc) with no result ..

      I tried adding some lines to the "functions.php" file in order to register the variables, but it looked to me that it's not the right way to do it! So, I tried adding plugins to register the variables, and WHAT A SHOCK! It didn't work for me too ..

      Thanks again and sorry for being such a fool .!

      Comment


      • #4
        If you need help writing a plugin to preregister the variables, then you should ask over on vbulletin.org, the modification site.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools &lt;- awesome site for html/css help

        Comment


        • #5
          Originally posted by Lynne View Post
          If you need help writing a plugin to preregister the variables, then you should ask over on vbulletin.org, the modification site.
          OH! I haven't thought in that .!
          Many thanks for your help Lynne ..
          At least, now I know whats the problem .!
          Many thanks again ..

          Comment


          • #6
            Originally posted by DaRK mAN306 View Post
            OH! I haven't thought in that .!
            Many thanks for your help Lynne ..
            At least, now I know whats the problem .!
            Many thanks again ..
            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


            Former vBulletin Support Staff
            Hacked recently? See my blog post "Recovering a Hacked vBulletin Site".
            Thinking outside the box? Need modification support? Visit www.vBulletin.org and have at it!

            Comment


            • #7
              Greetings again,

              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:
              1. Copied the bottom bar code from the footer template ..
              2. Removed the bottom bar code from the footer template ..
              3. Pasted the bottom bar code in the Header template ..
              4. To make the bottom bar on top of the forums list - because once I place the code in the header it goes beneath the forum list -, I added some CSS code to my bottom bar container as shown below:
                HTML Code:
                position:absolute;
                z-index:100;

              It works even without the position attribute and with the z-index set to 1 .! But, I feel safe like this for a reason or another ..

              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 here on vBulletin.com and thanks in advance for those who might provide something clean as a fix for this issue .!

              Kind Regrads,
              ME
              Last edited by DaRK mAN306; Sun 29th Aug '10, 11:04am.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X