Results 1 to 16 of 16

Thread: VBA Links Navbar Drop-Down Menu (Auto-install)

  1. #1
    Join Date
    Nov 2007
    Posts
    87

    Default VBA Links Navbar Drop-Down Menu (Auto-install, well, sort of...)

    VBA Links Navbar Drop-Down Menu 1.4 Beta
    (with Auto-Install)

    There are two versions of VBA Links Navbar Drop-Down Menu. The 1st version is 1.4 (which is the Manual Version). The 2nd version is 1.6 (which is the Auto-install).

    Manual Version (without Auto-install)

    Description: I wanted to make a VBA Links drop-down menu on all my pages, but didn't want to make a lot of template edits. This Product makes it easier to install a VBA Links drop-down menu on all navbar templates in every style.

    Instructions:

    1) Install the product file.
    2) Add the following code where you want the drop-down to appear in the template:

    PHP Code:
    <!-- VBA Links Drop Down Menu -->
    <
    td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php$session[sessionurl_q]">$vbphrase[zak_vbalinks]</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>
    <!-- 
    End of VBA Links Drop Down Menu --> 
    That's it. Then you will have a drop-down menu with the following links:

    Links Directory
    Link to Us
    Add Links
    What's New
    Top Visited Links
    Top Rated Links
    Top Replied To
    Search


    Please Give Me Suggestions for Links on the Navbar Drop-Down and I can add them!


    (Got the original links from this thread: http://www.vbadvanced.com/forum/showthread.php?t=9811 )
    Last edited by drynax; 07-06-2008 at 01:12 AM.

  2. #2
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    VBA Links Navbar Drop-Down Menu 1.6 Beta
    (with Auto-Install)


    There are two versions of VBA Links Navbar Drop-Down Menu. The 1st version is 1.4 (The Manual Version, which is up above). The 2nd version is 1.6 (which is the Auto-install, which is down below).

    Auto-Install Version

    Description: I wanted to make a VBA Links drop-down menu on all my pages, but didn't want to make a lot of template edits. This Product makes it easier to install a VBA Links drop-down menu on all navbar templates in every style.

    Instructions:

    1) Install the product file.

    That's it. Then you will have a drop-down menu with the following links:

    Links Directory
    Link to Us
    Add Links
    What's New
    Top Visited Links
    Top Rated Links
    Top Replied To
    Search

    2) In some cases, the navbar templates have been changed and it won't work. In this case, add the following code where you want the drop-down to appear in the template:

    PHP Code:
    <!-- VBA Links Drop Down Menu -->
    <
    td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php$session[sessionurl_q]">$vbphrase[zak_vbalinks]</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>
    <!-- 
    End of VBA Links Drop Down Menu --> 


    Please Give Me Suggestions for Links on the Navbar Drop-Down and I can add them!


    (Got the original links from this thread: http://www.vbadvanced.com/forum/showthread.php?t=9811 )
    Last edited by drynax; 07-06-2008 at 01:19 AM.

  3. #3
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Is there a way to make this fully automatic?

    Can the following code be made into a hook?

    PHP Code:
    <!-- VBA Links Drop Down Menu -->
    <
    td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php$session[sessionurl_q]">$vbphrase[zak_vbalinks]</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>
    <!-- 
    End of VBA Links Drop Down Menu --> 

    On this thread, Brian talks about "Adding link in vb Navbar via plugin/hook system":

    http://www.vbadvanced.com/forum/showthread.php?t=28542

    And uses the Code:

    PHP Code:
    $template_hook['navbar_buttons_right'] .= '<td class="vbmenu_control"><a href="/links/index.php' $vbulletin->session->vars['sessionurl_q'] . '">Links</a></td>'
    Can I take the code from this mod and change it into a hook like it is above, then put it in an xml file?

  4. #4
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Yes, you should be able to use the same code for yours.

    And thanks for sharing, I'm sure others will find this useful.

  5. #5

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    You could easily use the $template_hook[navbar_buttons_left] or the $template_hook[navbar_buttons_right] hook in the navbar template.

    Instead of editing the navbar template, create your own custom template (call it whatever), I'll use 'custom_links_navbar' as the template name. Put all your template edits in your custom template.

    Add a plugin to the global_setup_complete Hook Location and use the code below - leave execution order at 5.

    PHP Code:
    eval('$template_hook[\'navbar_buttons_right\'] .= "' .fetch_template('custom_links_navbar') . '";'); 
    Don't forget to activate it and don't forget to revert your navbar template or you'll have two menus.

    This will load your custom template at the hook location for you and won't need any template edits. The only draw back is you are stuck with the left or right side of the navbar.

    This will not load your template into the cache though. To do so (may be a better way but this works) - add another plugin in the 'cache_templates' hook location. The code below will add it to the template cache array.
    PHP Code:
    $globaltemplates array_merge($globaltemplates, array('custom_links_navbar')); 
    An easy way to tell if you have uncached templates is to turn on debug mode. The uncached templates will be shown in RED.


    BTW - You could also use the navbar hook to insert your code directly into the navbar without the need to create a template. I used the template insert as an example of what you could do. Sometimes it's a pain to search for a specific phrase.
    Last edited by PhilMcKrackon; 07-05-2008 at 10:19 PM.

  6. #6
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Thanks Phil / Brian,

    I'll have to experiment with this the next couple days. Thanks for the detailed explanation, Phil, it makes things a lot clearer.

  7. #7
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Okay. I got the hook working. There are two versions now, depending on which one someone wants to use (auto or manual). A special thanks to Brian and Phil for helping me figure that out. It was easier than expected, however, I have another question...

    Currently, my plugin code is as follows:

    PHP Code:
    $template_hook['navbar_buttons_right'] .= '<td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php' $vbulletin->session->vars['sessionurl_q'] . '">Links</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>'
    Now, here's my problem. I want "Links" to be ""$vbphrase[zak_vbalinks]". If I use a $vbphrase, then I can use multiple languages and just change the language table. Yet, whenever I replace "Links" with "$vbphrase[zak_vbalinks]", I get errors within the hook.

    How would I write the PHP, so I can put $vbphrase within the hook?

  8. #8
    Join Date
    Mar 2004
    Location
    A galaxy far, far away...
    Posts
    6,609

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    ... and if anybody tries the automatic version and the changes do not appear in your custom styles navbar, then check your navbar template to see if the new hook locations are present. If they are not, then either use the 'template history' option to see what has changed in the navbar template and update your custom style accordingly or use the manual method that Tazzarkin has also provided.

  9. #9

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Here is the best explanation I have found concerning adding phrases using the add_phrase_type function in adminfunctions_language.php.

    I created a php file and I ran it via the browser that includes that function with all the phrases I wanted to create.

    http://www.vbulletin.com/forum/showthread.php?t=176699

    I'm no genius at this but I would guess that you could create a plugin that did the same, run it once then remove it.

  10. #10
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Thanks for the answer Phil. The information you sent me is useful and I'm learning from it, however, my question was actually a more simple one. I guess I need to be more specific in my question:

    Right now I want to know how I can take my code that does work (code I'm currently using):

    PHP Code:
    $template_hook['navbar_buttons_right'] .= '<td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php' $vbulletin->session->vars['sessionurl_q'] . '">Links</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>'
    And change it into the following (code that does not work):
    PHP Code:
    $template_hook['navbar_buttons_right'] .= '<td id="zakvbalinksmenu" class="vbmenu_control"><a href="$vboptions[homeurl]/links/index.php' $vbulletin->session->vars['sessionurl_q'] . '">$vbphrase[zak_vbalinks]</a> <script type="text/javascript">vbmenu_register("zakvbalinksmenu"); </script></td>'
    All I tried to do was change Link into $vbphrase[zak_vbalinks]. However, when I use $vbprase, it gets an error. When I use Link, it works.

    How would I re-write the PHP, so I can put $vbphrase within the hook?

    I've been searching vbulletin's websites for over an hour and can't find anything about this stuff.
    Last edited by drynax; 07-08-2008 at 03:21 PM.

  11. #11
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Try this

    ' . $vbphrase[zak_vbalinks] . '
    Real useful and Cool vBulletin addons

  12. #12
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    It worked!! Thanks!! Updated the file, so now we can use the language table with it.

    -------------
    Quote Originally Posted by Lionel View Post
    Try this

    Last edited by drynax; 07-06-2008 at 01:13 AM.

  13. #13
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    you need to also do the same thing for
    $vboptions[homeurl]
    Real useful and Cool vBulletin addons

  14. #14
    Join Date
    Nov 2007
    Posts
    87

    Default Re: VBA Links Navbar Drop-Down Menu (Auto-install)

    Ouch. Glad you mentioned that. Okay, I changed that too. This stuff should be so common sense, but I missed it. Thanks again!

    ---------------
    Quote Originally Posted by Lionel View Post
    you need to also do the same thing for
    $vboptions[homeurl]
    Last edited by drynax; 07-06-2008 at 01:25 AM.

  15. #15
    Join Date
    Aug 2008
    Location
    Charlotte, North Carolina
    Posts
    13

    Default

    Thanks very much for the auto hack, works great YOU ROCK!
    Godspeed Technologies, LLC

  16. #16
    Join Date
    Nov 2007
    Posts
    87

    Default

    LOL. Thanks for the double praise in both threads.
    ----------
    Quote Originally Posted by 24HourForum.com View Post
    Thanks very much for the auto hack, works great YOU ROCK!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Will Pay for a vBA CMPS/Links Drop-down Menu
    By drynax in forum Chit Chat
    Replies: 1
    Last Post: 07-02-2008, 02:36 PM
  2. navbar links drop down issue
    By aj8690 in forum Troubleshooting & Problems
    Replies: 4
    Last Post: 02-05-2008, 08:18 AM
  3. Get rid of an option in the drop down menu while browsing links?
    By GamingVidz.com in forum "How Do I..." Questions
    Replies: 1
    Last Post: 12-18-2005, 02:51 PM
  4. Path in navbar menu from links page
    By libertate in forum Troubleshooting & Problems
    Replies: 2
    Last Post: 12-01-2005, 05:39 PM
  5. drop down menu
    By pepper in forum Add-On Modules & Modifications
    Replies: 0
    Last Post: 11-29-2004, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •