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
Add New BB Code Tags v.1.5
Topic Started: Jan 29 2008, 05:08 AM (5,996 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Code: HTML
 
<script>

/****************************************************
Add new BBCode Tags by Viral of http://www.zetaresources.com
Not to be redistributed or re-hosted without Viral's permission
****************************************************/

extraTags=[];n=0
extraTags[n++]=["Marquee","yes","[marquee]","[/marquee]","<marquee onmouseover='this.stop()' onmouseout='this.start()'>","</marquee>"]
extraTags[n++]=["Marquee Right","Yes","[marquee=right]","[/marquee]","<marquee onmouseover='this.stop()' onmouseout='this.start()' direction='right'>","</marquee>"]
extraTags[n++]=["P","","[p]","[/p]","<p>","</p>"]
extraTags[n++]=["Reverse","yes","[reverse]","[/reverse]","<bdo dir='rtl'>","</bdo>"]
extraTags[n++]=["Block Quote","","[blockquote]","[/blockquote]","<blockquote>","</blockquote>"]

if(location.href.match('topic') || location.href.match('single')){
td=document.getElementsByTagName('td');
for(i=0;i<td.length;i++){
if(td[i].className=="c_post"){
thepost=td[i].innerHTML;
for(j=0;j<extraTags.length;j++){
thepost=thepost.split(extraTags[j][2]).join(extraTags[j][4]).split(extraTags[j][3]).join(extraTags[j][5]);
}
td[i].innerHTML=thepost;
}}}

if(location.href.match('post')){
td=document.getElementsByTagName('td');
for(k=0;k<td.length;k++){
lots=td[k].innerHTML;
for(u=0;u<extraTags.length;u++){
lots=lots.split(extraTags[u][2]).join(extraTags[u][4]).split(extraTags[u][3]).join(extraTags[u][5]);
td[k].innerHTML=lots;
}}}

function addExtraTag(open,close){
texty=document.getElementsByTagName('textarea')[0];
texty.innerHTML+=open+close+" ";
}

if(location.href.match('post')){
bbc=document.getElementById('c_bbcode');
for(f=0;f<extraTags.length;f++){
if(extraTags[f][1]=="yes" || extraTags[f][1]=="Yes"){
bbc.innerHTML="<button type=\"button\" name=\""+extraTags[f][0]+"\" onmouseover=\"ZetaHelp('"+extraTags[f][0]+"')\" onclick=\"addExtraTag('"+extraTags[f][2]+"','"+extraTags[f][3]+"')\">"+extraTags[f][0]+"</button> "+bbc.innerHTML;
}}}

if(location.href.match('post')){
texty=document.getElementsByTagName('textarea');
for(y=0;y<texty.length;y++){
post=texty[y].value;
for(r=0;r<extraTags.length;r++){
post=post.split(extraTags[r][4]).join(extraTags[r][2]).split(extraTags[r][5]).join(extraTags[r][3]);
texty[y].value=post;
}}}

</script>


Bugs Fixed:

  • Quoting Posts change to HTML Tags
  • Editing Posts change to HTML Tags


Goes Below the Board, should be straight forward.

Viral.

Copied and pasted at school and Notepad was being ******* so the code was messing up when pasting, if it doesn't work, please post here and I will update when I get back home.
Edited by Viral, Jan 29 2008, 05:09 AM.
Offline Profile Quote Post Goto Top
 
Michael W
Member Avatar
MESKOS - Forum Consultant
[ *  * ]
Great, what i was looking for.

Thank You. Do you have a preview?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
http://s1.zetaboards.com/sigrules
Offline Profile Quote Post Goto Top
 
Kanzar
Member
[ *  * ]
Uh... the buttons aren't working now. :(

And I can still quote a blocked quote. :(
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Ahh, just saw that. I will try and fix tomorrow, but blockquote doesn't actually block quotes. It is a quote box with the style det to block. *Pointless, I know*.
Offline Profile Quote Post Goto Top
 
Kanzar
Member
[ *  * ]
Oh. <_> There was one that worked in IF, so I thought... >_>;;
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
I may make that later on, but for now, this is all I am working on (besides my secret-project o.0).
Offline Profile Quote Post Goto Top
 
carastir
Member Avatar
Did you say something?
[ *  *  * ]
Great code... You are awesome, Viral!
Offline Profile Quote Post Goto Top
 
..SMOKEY..
Member
[ *  * ]
what exactly does this code do? i'm a lil slow sometimes so could you explain it like i'm two lol

thanks

*edit #1* i installed it to see what it does, but it won't work at all, any ideas? ( i'm getting the yellow exclamition point at the bottom left of my screen if that helps at all ) could it be possibly be conflicting with another code?

*edit#2* i tried to see if v.1 would work, and it took away the error message but it still seems like the code isn't working because it appears that nothing has changed ( i saw no extra bb code butons in my posts )
Edited by ..SMOKEY.., Jan 31 2008, 08:33 AM.
Offline Profile Quote Post Goto Top
 
..SMOKEY..
Member
[ *  * ]
after entering the code, it somehow erased EVERYTHING...which is odd, but i after i started over, it worked just fine

idk what happened

just an fyi if you do use this code, copy your board template to the notepad first just in case

thanks for the code!
Edited by ..SMOKEY.., Jan 31 2008, 10:44 AM.
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