1 of 2
1
Building an Extension for Comment Spam
Posted: 17 January 2006 12:16 AM   [ Ignore ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Depending on my day, the pMachine Feature Requests forum is either my favorite or least favorite forum to take a peek in.  You either want to strangle people or you think their ideas are good and perhaps even clever.  Probably has as much to do with their presentation of the feature as it does with the feature itself.  Trying to sell me on a feature takes work, especially if I do not see a good enough reason for it to be included in the core program.

With extensions though, a large number of feature requests that we may decide not to include in ExpressionEngine can be added with a minimum of work on the part of the user.  I thought with this DevBlog entry, we might do something relatively simple like taking Adam’s feature request and doing the first three suggestions he has for preventing comment spam. 

continue…

 Signature 
Profile
 
 
Posted: 17 January 2006 01:10 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1695
Joined  05-13-2004

This is really fantastic - I’ve already installed it on my blogs.

just curious - does EE Core support extensions?

 Signature 

CreateSean Web Design
CreateSean - My journey to pro web designer
I am the poster formally known as The Linguist.

Profile
 
 
Posted: 17 January 2006 01:16 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Yes, EE Core has extensions supported.  EE Core really is only missing some modules, the rest of the program is the same.

 Signature 
Profile
 
 
Posted: 17 January 2006 01:28 AM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1695
Joined  05-13-2004
Paul Burdick - 17 January 2006 01:16 AM

Yes, EE Core has extensions supported.  EE Core really is only missing some modules, the rest of the program is the same.

Fantastic! - I just wrote a bit about this extension on my blog and plugged EE Core.

 Signature 

CreateSean Web Design
CreateSean - My journey to pro web designer
I am the poster formally known as The Linguist.

Profile
 
 
Posted: 17 January 2006 01:38 AM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Cool, thanks!  I suspect someone else will come along soon and expand the extension even more (take the code and go, people!), since this was really meant more as an example than anything.

 Signature 
Profile
 
 
Posted: 17 January 2006 06:45 AM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23744
Joined  05-20-2002

It scares me how bloody fast you code!  When’s 1.4.2 coming out? cool smile

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 17 January 2006 11:10 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1397
Joined  01-15-2005

Thanks Paual!

(wiki’d)

 Signature 

EE Duration Tags | {view_count_total}

Profile
 
 
Posted: 17 January 2006 11:18 AM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Yes, I can code fast.  Deciding what to do and how to do is far more time consuming.  Oh, and explaining it.  Took me about ten minutes to write the extension and another five to test it (bugs bugs bugs), but the DevBlog entry took something like two hours to do.  I grant I might have played some GoldenEye in the middle there though.

Thanks, EE lover. I do believe my name is Paul (could someone look into that and check?).  I have been thinking about changing it to something a bit exotic like P’aul though.  grin

 Signature 
Profile
 
 
Posted: 17 January 2006 11:33 AM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1397
Joined  01-15-2005

Doh! That keyboard thing again wink

Or if it is not my keyboard this time, there must be a bug in the forum module: when you type “Paul” it will be displayed “Paual”!

smile

 Signature 

EE Duration Tags | {view_count_total}

Profile
 
 
Posted: 17 January 2006 11:58 AM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002
EE lover - 17 January 2006 11:33 AM

Or if it is not my keyboard this time, there must be a bug in the forum module: when you type “Paul” it will be displayed “Paual”!

I bet Rick did that just for fun.

 Signature 
Profile
 
 
Posted: 18 January 2006 03:06 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  215
Joined  08-15-2003

I’m both honored and pleased, Paul.  Very handy stuff!

 Signature 

Woo hoo!  My EE site finally went live as of Monday, January 9, 2006, at 5am PST grin

Profile
 
 
Posted: 18 January 2006 11:44 PM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  05-14-2004

Got it downloaded too! But, erm. .. I changed Adam to my own name. smile

/ego

 Signature 

danielphillip.com

Profile
 
 
Posted: 20 January 2006 11:14 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Total Posts:  12
Joined  08-28-2005

I already got it installed in my EE core.. but how to make it work? does it need any coding alter in comment template?

Profile
 
 
Posted: 31 January 2006 01:13 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  887
Joined  12-14-2004

Someone hack this up to add one small - but big - improvement:

I want to make it so that my Editors member group and Super Admins group are not affected by the spam settings. Earlier this morning one of my editors tried to put 4 hyperlinks into a comment, with good reason, and the extension wouldnt allow him to do it. I had to up the number of links to 4, but that is now less effective at fighting spam.

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 31 January 2006 03:21 PM   [ Ignore ]   [ # 14 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Silly SuperAdmins, Trix is for kids.  Ok, download the extension again, just added your tweak.

 Signature 
Profile
 
 
Posted: 31 January 2006 04:52 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  887
Joined  12-14-2004

Just installed. What does this new one do? I am guessing, it is just protection to not stop Super Admins? Or will it allow ANY group with weblog posting privileges to get through the filter? smile

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 31 January 2006 04:58 PM   [ Ignore ]   [ # 16 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Simply protects the superadmins, no one else.  You should see where I am checking for the group_id at the top of the second function so if you need to add more groups you can do it there.

 Signature 
Profile
 
 
Posted: 02 February 2006 04:24 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  887
Joined  12-14-2004

How do I format that? I put this in, but it broke commenting:

if ($SESS->userdata['group_id'] == '1','6','11','10','13')

That resulted in this whenever someone tries to comment:

Parse error: parse error, unexpected ‘,’ in /home/andru/public_html/sistem/extensions/ext.spam_prevention.php on line 37


What is the correct way to add more groups?

 Signature 

Love gadgets, technology, and pop culture? Visit us at Gear Live: http://www.gearlive.com

Profile
 
 
Posted: 02 February 2006 06:33 PM   [ Ignore ]   [ # 18 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Er, no.  Try something like this:

if ( in_array($SESS->userdata['group_id'], array('1', '6', '11', '10', '13')))

That will basically check the group id against an array you have just created containing all of the valid member groups for skipping this check.

 Signature 
Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66395 Total Logged-in Users: 27
Total Topics: 84728 Total Anonymous Users: 15
Total Replies: 454726 Total Guests: 214
Total Posts: 539454    
Members ( View Memberlist )