Author |
Message |
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Sat Feb 28, 2009 7:29 am Post subject: I have trouble tweaking Cspam mod |
|
|
hi guys, I have a diffuculties tweaking Cspam mod and hope u can help. Cspam add ' rel="nofollow" ', to url which make no sense for a spammer to post his spam because SE won't follow his url, ok , no after installing this mod and the config addon mod which add condition to the main mod's job and an exception list, I noticed that if I place for example google.com in the exception list, the rel="nofollow" is still added to www.google.com !!! which make a hard work if we need to add all possible subdomains to the exceptions list. can someone help will this , so the mod will except all the domains and it's subdomains from the list, I think the stuff is here , but I'm not so talented with regEx . here is the code I think Code: | $sql = "select * from " . CSPAM_EXCEPT_TABLE ." where except = '" . str(replace("\'","''",addslashes(preg_replace('#^([\w]+?://)?([^/]+)/?.*$#i',"$2",$url))) . "'"; | ok, guys, if this is the write place where to tweak that mod , tell me, and what shoud I do to make the desired stuffs. thnkx |
|
Back to top |
|
|
lumpy burgertushie Board Member
Joined: 18 Nov 2008
Posts: 266
|
Posted: Mon Mar 09, 2009 1:38 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
this is not needed. spammers do not know or care if you have this or not. they will post their spam anyway.
robert |
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Mon Mar 09, 2009 6:09 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
Thanx, I know that, but this mod isen't made to stop spammer's post, but to give post no sense, because SE won't follow it.
Ok guys, who can help, i pass all the morning triying to rectify that issue but still unable to succes. |
|
Back to top |
|
|
Dog Cow Board Member
Joined: 18 Nov 2008
Posts: 378
|
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Mon Mar 09, 2009 1:31 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
Dog cow: I didn't really understand your meaning, can u clarify plz.
Whatever guys, I did it again
I found a solution
here is what the function add_nofollow() from Cspam mod in includes/functions.php should look like if anybody have this mod.
Code: |
function add_nofollow($url)
{
global $board_config, $db;
//the following two lines will exclude your site from marking it with rel="nofollow" even it dosen't exist in the exception list
// this can be done in a better way , but it's ok until now :)
$serverurl="http://".$board_config['server_name']; //without wwww
$serverwurl="http://www.".$board_config['server_name']; // with www
//the following tow functions was found as an example in php.net preg_mach function explain
// get host name from URL
preg_match('@^(?:http://)?([^/]+)@i',$url, $matches);
$host = $matches[1];
// get last two segments of host name
//as mentionated this capture only the site.tld that's why I added the $serverurl and $serverurl for
// poeple like me with site like site.co.cc
preg_match('/[^.]+\.[^.]+$/', $host, $matches);
$lasttwo=$matches[0];
/*this is no so necessary */ $lasttwo="http://".$lasttwo;
$sql = "SELECT *
FROM " . CSPAM_EXCEPT_TABLE . "
WHERE except = '" . str_replace("\'","''",addslashes(preg_replace('#^([\w]+?://)?([^/]+)/?.*$#i',"$2",$lasttwo))) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't check against exception list", "", __LINE__, __FILE__, $sql);
}
$in_list = $db->sql_numrows($result);
$db->sql_freeresult($result);
if (($board_config['cspam_general'] && !$in_list) || (!$board_config['cspam_general'] && $in_list) || (!$board_config['cspam_general'] && $url==$serverurl)||(!$board_config['cspam_general'] && $url==$serverwurl))
{
return '';
}
return 'rel="nofollow"';
}
|
hope it will be usefull, i'll pm it too to the mod author because he give the adress of this wonderfull site |
|
Back to top |
|
|
Dog Cow Board Member
Joined: 18 Nov 2008
Posts: 378
|
Posted: Mon Mar 09, 2009 3:59 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
khofech wrote: | Dog cow: I didn't really understand your meaning, can u clarify plz.
|
What I mean is that forum spam is so blatantly obvious, that unless your forum is about pornography or counterfeit drugs, it just sticks out. I'm pretty sure that Google is smart enough not to give the spammer web sites any "bonus" rankings when Google detects the spam. This holds higher merit when you take into fact that one of the aims of Google (as stated by the founders) is to provide useful, unbiased results for a given query. Is forum spam meant to be unbiased? Certainly not!
Now, I don't know this for a fact or not, so it's best always to take control of your own forum, but it's a suspicion I have. _________________ Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL • Mac 512K Blog • Mac GUI |
|
Back to top |
|
|
lumpy burgertushie Board Member
Joined: 18 Nov 2008
Posts: 266
|
Posted: Mon Mar 09, 2009 5:42 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
and my point was ; why waste your time trying to get back at the spammers?
spend your time wisely getting rid of them from your board.
If I come to your board and post spam and you have that MOD installed, I am not going to know whether google found my post or not.
Therefore, I will keep posting my spam whenever I wish unless and until you do something to actually stop me.
So, trying to keep a spam post from showing up in google is like shutting the barn door after the horses are already out.
robert |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Mon Mar 09, 2009 6:24 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
Right,
If it is easy to keep spam out of your forum why not simply do that, stop it before it shows up.
It's been a couple of years now since the last spammer managed to register at my board, no spam on my board. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Mon Mar 09, 2009 11:32 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
Ok guys (and maybe girls), i understand your meaning now, but can we just admit that this mod is just a + and not a main anti spam solution? So if by any way a spammer succeed to posting something and u are out for time.....
By the way, do you know that google yahoo microsoft are the corporations that created the tag rel="nofollow" ? They said to help fighting spam!! |
|
Back to top |
|
|
Red Dog Board Member
Joined: 06 Mar 2009
Posts: 41
|
Posted: Wed Mar 11, 2009 10:46 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
What is the name of this wonderful MOD? |
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Mon Mar 16, 2009 12:59 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
Cspam (comment spam),
r u jocking by saying "wonderfull"?? Coz ppl here i think don't share the same idea . |
|
Back to top |
|
|
Red Dog Board Member
Joined: 06 Mar 2009
Posts: 41
|
Posted: Mon Mar 16, 2009 4:41 pm Post subject: Re: I have trouble tweaking Cspam mod |
|
|
I am sure they were just teasing you. (that, or they don't know a thing about SEO)
I am already using Forum Meta Tags (another great mod!) and it seems that I got there a setting for follow/ nofollow, after all.
Image link |
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Tue Mar 17, 2009 8:48 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
I think that better if u try it, it do different things (u can indicate which domain SE will not follow), via a birectional exceptions list. i already placed the new version in the forum number 3.
Mod development. |
|
Back to top |
|
|
khofech Board Member
Joined: 26 Feb 2009
Posts: 44
|
Posted: Tue Mar 17, 2009 8:48 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
I think that better if u try it, it do different things (u can indicate which domain SE will not follow), via a birectional exceptions list. i already placed the new version in the forum number 3.
Mod development. |
|
Back to top |
|
|
Jim_UK Board Member
Joined: 19 Nov 2008
Posts: 656 Location: North West UK
|
Posted: Tue Mar 17, 2009 10:37 am Post subject: Re: I have trouble tweaking Cspam mod |
|
|
I do not see the point in creating such a mod when you can just add the tag directly into the overall header file or accomplish the same with a robots.txt file.
Not all bots will even comply with the instructions.
Better just to stop the bots getting in. (5 minute job)
Jim |
|
Back to top |
|
|
|