PDA

View Full Version : vbpopup pulldown menus


wtrk
11-05-2007, 08:40 PM
i need a little help. could somebody provide me with an example of how to make a custom pulldown menu for the navbar? ive looked through the navbar code and i cant tell where a popup starts and where it ends. so if you could just show me the begining a sample of how to add list items and the end, it would be a huge help. thanks!

Analogpoint
11-05-2007, 08:59 PM
Here's the navbar link in a table cell

<td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools" accesskey="3">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>

And it's corresponding menu div near the bottom of the navbar template

<div class="vbmenu_popup" id="usercptools_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">$vbphrase[quick_links]</td></tr>
<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,me nubar=no,toolbar=no,scrollbars=yes,resizable=yes,w idth=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>
$template_hook[navbar_quick_links_menu_pos1]

<tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_control_panel]</a></td></tr>
<if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
<!--<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>-->
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>
$template_hook[navbar_quick_links_menu_pos2]

<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
<if condition="$show['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
$template_hook[navbar_quick_links_menu_pos3]

</table>
</div>

wtrk
11-05-2007, 09:11 PM
THANKS.

so in order to create a custom menu, besides the contents of the menu table, what do i need to change? like im sure i change "id="usercptools"" to what the new menu is called? then do i also change this: "vbmenu_register("usercptools");" to the name for the new menu?

tell me why this doesnt work:


<!-- MENU: NAVBAR TABLE -->

<table cellpadding="4" cellspacing="1" border="0">

<tr>
<td id="about" class="vbmenu_control">ABOUT<script type="text/javascript"> vbmenu_register("about"); </script></td>
</tr>
</table>
<!-- /MENU: NAVBAR TABLE -->

<!-- MENU: ABOUT-->
<div class="vbmenu_popup" id="about" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">ABOUT</td></tr>
<tr><td class="vbmenu_option">1</td></tr>
<tr><td class="vbmenu_option">2</td></tr>
<tr><td class="vbmenu_option">3</td></tr>

</table>
</div>
<!-- /MENU: ABOUT -->

Freesteyelz
11-06-2007, 02:58 AM
Replace the above with:


<!-- MENU: NAVBAR TABLE -->
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td id="about" class="vbmenu_control"><a href="$show[nojs_link]#about" accesskey="3">ABOUT</a><script type="text/javascript"> vbmenu_register("about"); </script></td>
</tr>
</table>
<!-- /MENU: NAVBAR TABLE -->
<!-- MENU: ABOUT-->
<div class="vbmenu_popup" id="about_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">ABOUT</td></tr>
<tr><td class="vbmenu_option">1</td></tr>
<tr><td class="vbmenu_option">2</td></tr>
<tr><td class="vbmenu_option">3</td></tr>

</table>
</div>
<!-- /MENU: ABOUT -->



What I've highlighted in red is what you were missing. :)