Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Zelnen

Zelnen Avatar
Javascriptin'

**
Official Member

91


June 2006
Ok basically this code makes it so if you put [block] [/block] tags round some text other members can't quote it.

If text has the block tag around it it will appear grey. If you try to quote blocked text inside the quote it will appear bold saying Quote blocked.

The barriers can be slightly slipped around if you directly write your own
tags round text but otherwise it's fine. No one will think to do that anyway so meh.

Put this into your footers.


<script>
// Blockquote tag
// Created by Zelnen [URL=http://ifcodingzone.com]http://ifcodingzone.com[/URL]

function block(){

forms = document.forms['REPLIER']
forms.Post.value += "[block] [/block]"

}

if(location.href.match("act=Post&CODE=")){
tds = document.getElementsByTagName("td")
for(i=0; i < tds.length; i++){
if(tds[i].innerHTML.match("Open Tags:")){

var newelement = document.createElement("input")
newelement.type = 'button'
newelement.value = 'block'
newelement.className = 'codebuttons'
newelement.name = 'block'
newelement.onclick = block

var node = null
inputs = tds[i].getElementsByTagName("input")
for(x=0; x < inputs.length; x++){
if(inputs[x].name == 'LIST'){
node = inputs[x]
}
}

tds[i].insertBefore(newelement, node);

}}

forms = document.forms['REPLIER']
if(forms.QPost.value.match("\[block\]")){

forms.QPost.value = forms.QPost.value.replace(/\[block\]/gi,"\[bq\]")
forms.QPost.value = forms.QPost.value.replace(/\[\/block\]/gi,"\[\/bq\]")
}}

if(location.href.match("showtopic=")){

tds = document.getElementsByTagName("td")
for(i=0; i < tds.length; i++){

if(tds[i].id == 'QUOTE' && tds[i].innerHTML.match("\[bq\]")){

tds[i].innerHTML = tds[i].innerHTML.replace(/\[bq\](.*)\[\/bq\]/," <b>Quote Blocked</b>")
}}

divs = document.getElementsByTagName("div")
for(i=0; i < divs.length; i++){

if(divs[i].className == 'postcolor' && divs[i].innerHTML.match("\[block\]")){

divs[i].innerHTML = divs[i].innerHTML.replace(/\[block\]/,"<b><i><font color='grey'>")
divs[i].innerHTML = divs[i].innerHTML.replace(/\[\/block\]/,"</font></i></b>")
}}}
</script>



Last Edit: Jun 30, 2006 21:34:05 GMT by Zelnen

newBookmarkLockedFalling