We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Add prefix to topic title with dropdown
Topic Started: Oct 22 2009, 11:02 AM (2,558 Views)
slayer766-ZNR
Member
[ *  *  *  * ]
Board Template > Below the board:

Code:
 
<script type="text/javascript">
////////////////////////////////////////
//The forums you want this shown up in
//You may add as many forums as you want
//just separate them with a comma
//You may delete all of this comment ^_^
////////////////////////////////////////
var Forum = [340500,340498]

////////////////////////////////////////////////
//Prefixes you want added before the topic title
//You may add as many forums as you want
//just separate them with a comma
//You may also delete all of this comment ^_^
////////////////////////////////////////////////
var DList = ["Invisionfree","ZetaBoards"]

var a = "<form><select onchange='Add_It(this.options[this.selectedIndex].value)'><option value=''>Select";
for(i in DList){
a+="<option value='"+DList[i]+"'>"+DList[i];
}
a+="</select></form>";
for(g in Forum){
if(location.href.match(new RegExp("&f="+Forum[g]+"$"))){
$("td:contains('Topic Title')").next().prepend(a);
}
}

function Add_It(prefix){
document.forms.posting.title.value=prefix+" ";
}
</script>
Offline Profile Quote Post Goto Top
 
.Koda
Member Avatar
Yeah, I went there
[ *  *  *  *  * ]
That's a pretty cool feature. It makes adding things that you end up typing often very easy indeed. Great job slayer!
Offline Profile Quote Post Goto Top
 
gamer3
Member Avatar
Member
[ *  * ]
How do i go about editing the code. Sorry if i'm annoying just trying to understand how to edit this code..

Where it says :-
Code:
 
var Forum = [340500,340498]

What will i need to do here, just keep adding the number codes of the section i want to use it in like this..
Code:
 
var Forum = [340500,340498,45454,34,242,3434,2424]

ect? or..

Plus where do i put the ps3,xbox ect ect?
Offline Profile Quote Post Goto Top
 
Lout-ZNR
Member Avatar
He came, he saw...
[ *  *  * ]
Yes that's right, and for the drop down options change this:-
Code:
 
var DList = ["Invisionfree","ZetaBoards"]


to something like this:-
Code:
 
var DList = ["PS3","Xbox","Wii","PC"]

Offline Profile Quote Post Goto Top
 
viperver1
Member
[ * ]
This is such a nice code. Very useful for my site and I hope there will be more codes like this soon.

Thanks for this.
Offline Profile Quote Post Goto Top
 
Sir Eagle
Member
[ * ]
It doesn't work in my board. I followed all the instructions, but no dropdown menu is popping up in the posting screen.

edit: okay, odd. When I remove my Wibiya toolbar, the menu DOES appear... strange...

edit2:Okay I found a solution.

Instead of putting the toolbar in the Javascript box, put it in the Below Board box as well, UNDER the prefix script.
Edited by Sir Eagle, Mar 5 2011, 10:10 AM.
Offline Profile Quote Post Goto Top
 
Dubs
Member
[ * ]
Great code, works fine. However, all my prefixes are in caps. When I start a topic w/ one of them, they revert into lowercase. i.e. [FAQ] turns into [faq].

Any way this could be fixed?
Offline Profile Quote Post Goto Top
 
DelicateGlow
Member Avatar
Member
[ * ]
Thanks. Is it possible to make it color coded? Like red, for instance?
Offline Profile Quote Post Goto Top
 
Makaze
Member Avatar
Discordian
[ * ]
Dubs
Mar 5 2011, 11:22 AM
Great code, works fine. However, all my prefixes are in caps. When I start a topic w/ one of them, they revert into lowercase. i.e. [FAQ] turns into [faq].

Any way this could be fixed?
You need to go into your board preferences and disable the automatic caps filter on topic names.
Offline Profile Quote Post Goto Top
 
Joshua J
Member Avatar
Member
[ *  *  * ]
cant get it to work
IS THERE ANYWAY TO ADD COLOR TEXT?
Edited by Joshua J, Feb 27 2012, 12:30 PM.
Offline Profile Quote Post Goto Top
 
Dannyy
Member Avatar
Member
[ *  * ]
Holy crap, this is an amazing code. I'd like to second the previous post's suggestion: Is there any way to modify color/size/other BBCode capabilities? This is really useful code for my boards!
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
You could use the BBCode in Topic Titles code, but the downside is the BBCode will appear in the Topic Prefix drop down.
Online Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply