Dropdown menubox for Links/URL's

MobileHacks

New Member
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

PHP:
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...

PHP:
<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

PHP:
 <option value="http://www.ukbusinesslive.co.uk">UKBusinesslive Store</option>
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.
 
Back
Top