Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Zetaboards Modifications
  • [SC] Topic prefix upon topic submission
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
[SC] Topic prefix upon topic submission
Tweet Topic Started: Dec 16 2008, 03:04 PM (772 Views)
slayer766 Dec 16 2008, 03:04 PM Post #1
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
Code Name: Topic prefix upon topic submission
Description: This code will add a dropdown menu of prefixes for you to choose from in any given selected forum. Though the prefix will not be added to your title AFTER you submit your post. ;)
Preview: http://s1.zetaboards.com/Slayer_Coding
Register an account(Or log in with username: tester password: testing) and go to the new topic page and you will see it. :)

Where it goes:
Board Template - Below the board:

Quote:
 
<script type="text/javascript">
//Written by slayer766

var prefixes = [];
prefixes['FORUM_ID'] = new Array ("Prefix for forum 436390 #1","Prefix for forum 436390 #2","and so on");
prefixes['FORUM_ID'] = new Array ("Prefix for forum 436391 #1","Prefix for forum 436391 #2","and so on");

if(location.href.match(/&f=(.*)/i)){
var forum = RegExp.$1;
var num = 0;
if($("input[name*='title']")){
var info = "<form name='slayer'><select name='rawr'><option value='none'>Select";
for(c in prefixes){
if(forum == c){
for(j=0;j<prefixes[c].length;j++){
info+="<option value='"+num+"'>"+prefixes[c][j];
num++;
}
}
}
}
info+="</select></form> Topic Prefix";
$("input[name*='title']").after(info);
document.forms['posting'].onsubmit=function(){
var a = document.slayer.rawr.selectedIndex;
var dropdownText = document.slayer.rawr.options[a];
if(dropdownText.value != "none"){
document.forms['posting'].title.value="["+dropdownText.text+"] "+document.forms['posting'].title.value;
}
}
}
</script>


Change what's in BLUE to the forum number you want that specific topic prefix to show in.
Change what's in RED to the topic prefixes you want set in that specific forum. *Note - You can have an unlimited amount of topic prefixes, to add more just separate more with a comma.
Edited by Reid, Jun 15 2009, 08:24 PM.
Offline Profile Goto Top
 
.Roman Jan 11 2009, 12:48 AM Post #2
Member Avatar


Posts:
17
Group:
Member
Member
#1,948
Joined:
Jan 5, 2009
Coding language
None
Greatest code ever
Offline Profile Goto Top
 
Joeinkck Jul 25 2009, 08:02 AM Post #3


Posts:
6
Group:
Member
Member
#3,332
Joined:
Jul 20, 2009
I love this code but cant get my users to use the prefixes. Any way of "forcing" them to select the prefix before their post is accepted?

I only use it in one forum category but I want them to use the prefixes. If I add it to other categories I dont really care if they use it but if I have a prefix loaded in there, I want them too.
Edited by Joeinkck, Jul 25 2009, 08:04 AM.
Offline Profile Goto Top
 
tangbangnho Mar 28 2010, 02:13 PM Post #4
Member Avatar


Posts:
24
Group:
Member
Member
#3,752
Joined:
Mar 27, 2010
thanks a lot , ur code very useful for my website . Nice job !Posted Image
Two shall be as one , always protects , always trusts , always love Posted Image
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Zetaboards Modifications · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 7:51 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy