vForums Support > Programming & Coding :: Code Requests & Support :: > [F] censors

[F] censors - Posted By Alex Bailey (system) on 30th Mar 08 at 1:01am
Problem:

Is it possible so that staff could have their own censor, Like if i was admin i could use say :admin: And only the admin could use it?

Re: censors - Posted By Marc (cr0w) on 30th Mar 08 at 2:27am
Normally I would move this to suggestions, but seeing as the board is closed I'll move it to Code Requests.

Re: censors - Posted By Michael (wrighty) on 30th Mar 08 at 11:54pm
can't you just set it as a censor and not tell anyone? {Tongue Out}

Re: censors - Posted By Marc (cr0w) on 31st Mar 08 at 12:04am
 
can't you just set it as a censor and not tell anyone? {Tongue Out}


It would be visible when quoting a post. {Wink}

Re: censors - Posted By Michael (wrighty) on 31st Mar 08 at 12:08am
 
 
can't you just set it as a censor and not tell anyone? {Tongue Out}


It would be visible when quoting a post. {Wink}


So true! {Unsure}

*jumps on this*

Gimme 10/20 mins

Re: censors - Posted By Michael (wrighty) on 31st Mar 08 at 12:19am
<script>
/*Censors for certain members
Created By Wrighty */
var censors = [
[":admin:","Wrighty is God!"],
[":marc:","Marc likes cows"],
[":ross:","Ross r 1337"]
]

var users = /(admin|wrighty|god|system)/;


function save(){
    for(i=0;i<censors.length;i++){
        if(get('message','name')[0].value.match(censors[i][0])){
            get('message','name')[0].value = get('message','name')[0].value.replace(censors[i][0],censors[i][1]);
        }
    }
}

if(document.post_form && vf_username.match(users)){
    if(document.addEventListener){
        document.post_form.addEventListener('submit', save,false);
    }else{
        document.post_form.attachEvent('onsubmit', save);
    }
}else if(document.quick_reply_form && vf_username.match(users)){
    if(document.addEventListener){
        document.quick_reply_form.addEventListener('submit', save,false);
    }else{
        document.quick_reply_form.attachEvent('onsubmit', save);
    }
}
</script>


Global Footer.

You must know what to do with the 'array' at the top by now? {Tongue Out}
(Remember, no comma on last line)

The users that can use it are shown in the 'red' area. To add more simply add them with |user1 that's a line and then their username! {Smile}

This will then replace what their posting with (their censor) with the censorthingy. {Tongue Out}

Questions?

Re: censors - Posted By Alex Bailey (system) on 31st Mar 08 at 12:32am
Thanks mate, ill try it later {Smile}