Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications

Reply
 
Thread Tools
Dropdown Menu box for Links/Urls Details »»
Dropdown Menu box for Links/Urls
Version: 1.00, by UKBusinessLive UKBusinessLive is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.8.0 RC 2 Rating:
Released: 12-30-2008 Last Update: 01-03-2009 Installs: 27
Template Edits
Re-useable Code Translations  
No support by the author.

As a result of this post https://vborg.vbsupport.ru/showthrea...82#post1697782

I've come up with a small modification that will allow admins to include a small dropdown box in the forum discription. With this mod you will be able to add a few or hundreds of urls and links without filling up your forum.




This is really easy, all you need to do is to copy the following code to notepad on your PC and save it as subnav.js

Code:
function go_nav() {
	
  if (document.getElementById && document.createTextNode) {	
	
	var user_link = document.getElementById("my_links").value;	
    
	window.location = user_link;
	
	return false;
	
  }
  
}
or you can just download the zip file

then you need to upload the subnav.js file to your forums root directory.

The next stage is the code where you edit your urls etc...

Code:
<div id="drop_box_nav">
<form action="#" onsubmit="return go_nav();">
<select name="my_links" id="my_links">
  <option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
  <option value="http://www.ukbusinesslive.co.uk/topsite">Topsite</option>
  <option value="http://www.google.com">Google</option>
  <option value="http://www.ukbusinesslive.co.uk/links/">UKBL Links</option>
</select>
&nbsp;&nbsp;
<input type="submit" name="sub_nav" id="sub_nav" value="Go to URL" />
</form>
</div>
<script type="text/javascript" src="subnav.js"></script>
Within that code you need to edit your urls and description in the option values

Code:
 <option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
I've only done 4 in the above but you can add as little or as many as you need by simply adding more option values as in the code above.

Once you've saved your edit, you can upload it to a forum, what i did was to create a new forum called "Quick Links" and then paste all of that code into the Forum Description.

Thats all there is to it, Feel free to experiment with this and remember to post a link here if you want to show off your new dropbox.

Enjoy



*****************************UPDATE*************** *******************
4th Jan 2009

Please find below an .xml file, This is the Menubox done within a Module for vBa

It's the actual module with the default url still in place. (You need to edit these - Unless you want a link to my site )
Anyone with vBa3 can upload it via the vBa control panel.
Lower versions of vBa may need to edit the .xml file.
REMEMBER you still need to upload the subnav.js file to your forum root

Many Thanks to Mal for this Code

Enjoy
*****************************UPDATE*************** *******************

12 January 2009

To Open in new Browser Window

To get the link to open in a new browser window, what you do is add the target="_blank" attribute to your link tag, like this in your Menu Links area

<option value="http://www.ukbusinesslive.co.uk" target="_blank">UKBusinesslive Store</option>

If you do that to the ones that you want to open in a new window, then you don't navigate away from your site



Download Now

File Type: zip subnav.zip (270 Bytes, 163 views)
File Type: xml quicklinks-VBA Module.xml (1.0 KB, 109 views)

Screenshots

File Type: png page22.png (47.8 KB, 0 views)
File Type: png page23.png (65.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 04-19-2009, 12:20 AM
down.low down.low is offline
 
Join Date: Mar 2009
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UKBL,.- another thing you can do is put them between an <li> tag on one of your blacktabs.
Reply With Quote
  #33  
Old 04-19-2009, 01:24 AM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
To Open in new Browser Window

To get the link to open in a new browser window, what you do is add the target="_blank" attribute to your link tag, like this in your Menu Links area

<option value="http://www.ukbusinesslive.co.uk" target="_blank">UKBusinesslive Store</option>

If you do that to the ones that you want to open in a new window, then you don't navigate away from your site
I love this mod - but the above is not working for me. Even when I cut and paste exactly as you have it there, it does not open a new window. Can someone take a look at that and see if there is a tweak to make this work? I really need it to open a new browser window versus navigating away from my site.

Thanks in advance!
Reply With Quote
  #34  
Old 04-19-2009, 03:48 PM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Btw, in relation to the target="_blank" coding tweak not working for me (to have links open up in a new browser window), I am running vb 3.8.2 if it matters.

I'd also like to know if it's possible to have any of the links in the dropdown list show up as bolded or with colored text?
Reply With Quote
  #35  
Old 04-20-2009, 09:46 AM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone with a suggestion out there?
Reply With Quote
  #36  
Old 04-20-2009, 02:34 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Noosphere View Post
Btw, in relation to the target="_blank" coding tweak not working for me (to have links open up in a new browser window), I am running vb 3.8.2 if it matters.

I'd also like to know if it's possible to have any of the links in the dropdown list show up as bolded or with colored text?
You can do that via the css (have not DL'd the mod but I assume it has a css file) OR by adding in <font> tags to specify color/bold/italic etc etc. I'll check on you later today after work as I'm enjoying lunch
Reply With Quote
  #37  
Old 04-22-2009, 02:59 AM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not familiar with the whole CSS thing...I haven't been able to get tags to work for color or bold fonts...doesn't seem like it should be hard, but so far no luck.

I'm really more interested in the code to have the link open up a new browser window when clicked. Anyone got suggestions on that?

Thanks in advance!
Reply With Quote
  #38  
Old 04-25-2009, 10:53 AM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still looking for help with the code text to get the drop-down link to open a new browser window guys? I've inserted the target="_blank" text exactly as shown, and it doesn't work.

Anyone have suggestions?
Reply With Quote
  #39  
Old 04-26-2009, 08:51 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

This is how it looks without the target blank

Code:
<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
and this is where you add the target blank, to get the link to open into a new page, highligted in blue

Code:
<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>
you need to make sure that its the same layout as above and that you have all the " in the right place. Theres no real reason for it not to work as its basic HTML

Let me know how you got on, or perhaps post your code here and we'll take a look

Reply With Quote
  #40  
Old 05-02-2009, 03:10 PM
Noosphere Noosphere is offline
 
Join Date: May 2008
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UKBusinessLive View Post
Hi,

This is how it looks without the target blank

Code:
<option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
and this is where you add the target blank, to get the link to open into a new page, highligted in blue

Code:
<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>
you need to make sure that its the same layout as above and that you have all the " in the right place. Theres no real reason for it not to work as its basic HTML

Let me know how you got on, or perhaps post your code here and we'll take a look

Unless I'm blind, that's how I have a couple of the links formatted. Here's the initial snippet of code showing one of the links setup as you've instructed (but it doesn't perform any differently than the other links when clicked by opening a new window):

Code:
<div id="drop_box_nav"><form action="#" onsubmit="return go_nav();"><select name="my_links" id="my_links" align="center">
<option value="http://www.dabearz.com/forums/" target="_blank" >Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>
Appreciate the help!
Reply With Quote
  #41  
Old 05-02-2009, 04:12 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

heres your code

Code:
<option value="http://www.dabearz.com/forums/" target="_blank">Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>
You'll see that there are some errors in your code, if you look at what you need to have shown below, i will highlight in red the errors in your code which you'll need to delete for your menu to open in a new window

So this is what it should look like

<option value="http://www.ukbusinesslive.co.uk" target="_blank" >UKBusinesslive Store</option>

and this is where you've gone wrong, highlighted in red

<div id="drop_box_nav"><form action="#" onsubmit="return go_nav();"><select name="my_links" id="my_links" align="center">
<option value="http://www.dabearz.com/forums/" target="_blank" >Bears/DaBears</option>
<option value="http://www.chicagobears.com/">Bears/Team Site</option>
<option value="http://forums.bengalszone.com/">Bengals/BengalsZone</option>

You seem to have a forward slash "/" at the end of your urls, Delete that and the target="_blank" should work
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:45 PM.


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.06128 seconds
  • Memory Usage 2,349KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete