Quote:
Originally Posted by kawzaki
hello
I was interested in filtering links in PMs. so i modified the code (deleted the rest and kept the pm section) and replaced the search criteria to this:
PHP Code:
i just thought u might make use of it:
<phpcode><![CDATA[$spamgroups = explode(',', $vbulletin->options['no_pm_links_usergroups']);
if (is_member_of($vbulletin->userinfo, $spamgroups) || $vbulletin->userinfo['posts'] < $vbulletin->options['no_pm_links_postcount'])
{
$re = "/(www\.)?(\w*[^\.])(\.[a-z]{2,3})/";
$bState = preg_match_all( $re , $vbulletin->GPC['message'], $m );
if ( $bState ) {
foreach( $m[0] as $v ){
$vbulletin->GPC['message'] = ereg_replace( $v, $vbulletin->options['no_pm_links_message'], $vbulletin->GPC['message']);
}
}
}]]></phpcode>
the original post will be updated ( links replacements ) if found matching :
domain.com
or
any other format (e.g, http://www. domain.com ) that includes the above link as part of it. Indeed, it will capture (.ae, .ca, and all country specific domains ).
The next step,
is to allow using the forum URL in posts (or PMs).
( u know members usually tell each other about their posts)
Sorry for my 3-in-a-row posts.
Cheers
|
I'm a total preg_match noob. Everytime I look at those it makes my head hurt.
What exactly is it looking for here. I don't see what the criteria are.
PHP Code:
$re = "/(www\.)?(\w*[^\.])(\.[a-z]{2,3})/";
From what I can guess it's searching for "www", and then any combination of 2 letters after a " . " ?