Helpful Information
 
 
Category: vBulletin 2.x Beta Releases
stripping URLs and email addresses from posts

I needed to strip URLs and Email addresses from posts as users were posting spam onto my board. I looked on this site but couldn't find anything that matched what I wanted so I devised this hack. It has been tested on Version 2.3.0 and works ok. Can somebody please try it on other versions.

Find this:

// auto bypass queueing for admins/mods
if (ismoderator($foruminfo[forumid])) {
$visible=1;
}

in both newthread and newreply then put this code after:

//remove URLs and email addresses from message body
$URL_replace='<sorry the email addresses or URLs have been removed>'; //change this string to one of your choice

$pieces=explode(" ",$message);
for ($i=0;$i<count($pieces);$i++) {
$pieces[$i]=eregi_replace("^.+(\.|dot)(com|net|org|uk|us|au)",$URL_replace,$pieces[$i]); //add values to com|... (inside paretheses)for new domains
}
$message=implode(" ",$pieces);

Sorry it isn't presented very elegantly but I'm new to this.

Kevin










privacy (GDPR)