Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Append/Prepend Links to Submenu
Topic Started: Apr 14 2008, 10:07 AM (1,762 Views)
Arrogant
Member Avatar
Vote Choco and Nicola!
[ *  *  * ]
Appending Links: Add the following script into your footers - most likely in the Below the Board or Above the copyright areas.

Code:
 
<script type="text/javascript"> <!--
$("#submenu").append(function(x, y) {
for(var n in y) x = x.concat(y[n][0].link(y[n][1])); return x.join("&nb" + "sp;");
}([], [
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"]
]));
// --> </script>


----

Prepending Links: Add the following script into your footers - most likely in the Below the Board or Above the copyright areas.

Code:
 
<script type="text/javascript"> <!--
$("#submenu").prepend(function(x, y) {
for(var n in y) x = x.concat(y[n][0].link(y[n][1])); return x.join("&nb" + "sp;");
}([], [
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"]
]));
// --> </script>


---

Editing: The only part you need to edit, is the following:

Code:
 
[
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"]
]


Notice that the first two lines HAVE A COMMA AFTER THEM, and the last one DOES NOT HAVE A COMMA AFTER IT. When adding a line / link / to the script, you need to make sure it has a comma after the last ], unless it's the last line. If i wanted to add a youtube link to my submenu, along with those already in the script, this is how i'd edit it:

Code:
 
[
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"], <- add a comma
]


Code:
 
[
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"],
["YouTube", "http://www.youtube.com"] <- don't add a comma
]



Finished:

Code:
 
<script type="text/javascript"> <!--
$("#submenu").append(function(x, y) {
for(var n in y) x = x.concat(y[n][0].link(y[n][1])); return x.join("&nb" + "sp;");
}([], [
["Google", "http://www.google.com"],
["Yahoo", "http://www.yahoo.com"],
["Microsoft", "http://www.microsoft.com"],
["YouTube", "http://www.youtube.com"]
]));
// --> </script>
Offline Profile Quote Post Goto Top
 
davadude
Member Avatar
GuildWars addict :P
[ *  *  * ]
preview?
Offline Profile Quote Post Goto Top
 
Arrogant
Member Avatar
Vote Choco and Nicola!
[ *  *  * ]
1. Read my name.
2. "Code previews are not necessary, but they're strongly recommended."
3. *cough* http://aquate.us/u/lolno.png *cough*
Edited by Arrogant, Apr 14 2008, 11:50 AM.
Offline Profile Quote Post Goto Top
 
.DeleTeD.
Member Avatar
Member
[ *  *  * ]
Arrogant
Apr 14 2008, 11:45 AM
1. Read my name.
2. "Code previews are not necessary, but they're strongly recommended."
3. *cough* http://aquate.us/u/lolno.png *cough*
lol thanks for preview anyways
Offline Profile Quote Post Goto Top
 
J-Syxx
Member
[ * ]
Can I please have a modification for this code so I can put the new links before Search, Members, etc., as opposed to afterwards?
Offline Profile Quote Post Goto Top
 
Brian
Member Avatar
Still a fan of the Fightin' Irish

That would simply be the Prepend option mentioned above if I understand what you're asking for.

Brian
Offline Profile Quote Post Goto Top
 
mathyu
Member Avatar
previously Matt L.
[ * ]
Is it possible to remove links that are already existing in the submenu, such as the Calendar and FAQ links?
Offline Profile Quote Post Goto Top
 
Arrogant
Member Avatar
Vote Choco and Nicola!
[ *  *  * ]
http://support.zetaboards.com/topic/143647/ *

* brought to you by the lovely Nicola. :$
Offline Profile Quote Post Goto Top
 
Kiragatash
Member Avatar
AnimeWatcher
[ *  * ]
How can I get that if I press a link I added open in a new window?
Offline Profile Quote Post Goto Top
 
TeachX3
Member Avatar
Member
[ *  * ]

Thank you for this code! :D

Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply