vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   2 notification areas, but only 1 functioning (https://vborg.vbsupport.ru/showthread.php?t=261315)

Hornstar 04-01-2011 10:23 PM

2 notification areas, but only 1 functioning
 
Hi all, I need a little help in getting this to work.

I have 2 notification menus on my site.

1 in header
1 in navbar

May seem odd to have 2, but that is just how things are ^^

The problem tho, is that the dropdown for the header one is not working. Only the navbar one works.

This is the code in the header:
Code:

                        <if condition="$show['notifications']">
                            <div><span id="notifications1"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a>
                            <strong>$notifications_total</strong></span></div>
                            <script type="text/javascript"> vBmenu.register("notifications"); </script>
                        <else /><if condition="$show['pmstats']">
                            <div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
                        </if></if>

And this is the code in the navbar:

Code:

<if condition="$show['notifications']">
            <div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
            <if condition="$show['popups']">
                <script type="text/javascript"> vBmenu.register("notifications"); </script>
            <else />
                <script type="text/javascript" src="clientscript/vbulletin_notifications_nopopups.js?v=$vboptions[simpleversion]"></script>
                <script type="text/javascript"> vBulletin.register_control("vB_Notifications_NoPopups", "notifications");  </script>
            </if>



... down further




<if condition="$show['member'] AND    $notifications_total">
<!-- notifications menu -->
<div class="vbmenu_popup" id="notifications_menu" style="display:none">
    <table cellpadding="4" cellspacing="1" border="0">
    <tr><td class="thead" colspan="2">$vbphrase[your_notifications]</td></tr>
    $notifications_menubits
    </table>
</div>
<!-- / notifications menu -->
</if>

I am sure it is a simple fix, but I am just a little stumped.

Note: I changed id="notifications" in the header one to id="notifications1" otherwise it would not have had a drop down arrow. So now I have the arrow, but it won't actually drop down.


Thanks for any help.
Matt

Lynne 04-02-2011 03:03 AM

As you found, you can't use the same id in two places on a page. However, the id may be something that is needed for the javascript, so you may to change other parts of the area that use that id in the id for the area. (there is an article about dropdowns that explains this - look it up in the articles area)

Hornstar 04-02-2011 09:22 PM

Thanks, yeah I had to create an extra notification menu, and than change all the ID tags and javascript references to reflect the new ID tag created in the new notification menu.


All times are GMT. The time now is 02:27 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.01103 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete