trigger a "spam" flag for testing?

7 views
Skip to first unread message

Stephen Rider

unread,
Jun 5, 2010, 10:36:21 PM6/5/10
to sk2-g...@googlegroups.com
Hi all --

Does anyone have a good simple way to make a plugin flag as negative karma for purposes of testing? I want to set up my test install so that I can at will submit a comment that's marked "not spam", or "spam" -- my choice.

Ideas?

Stephen


--
Stephen Rider
http://striderweb.com/

drdave unknowngenius

unread,
Jun 5, 2010, 10:44:26 PM6/5/10
to sk2-g...@googlegroups.com
Hi Stephen,

If I understand correctly, you want a way to control the way a comment
is going to be flagged in your install...

Easiest way, I think, is to add a custom SK2 module with the highest
priority, which sets the karma to a very low number, based on some
simple condition (e.g. grep the comment's content for a special
codeword). Just reuse one of the simpler existing module and you
should be able to get that going in a couple minutes...

Hope I am making sense, don't hesitate to ask if you need more help with this...

Cheers!

Peter Westwood

unread,
Jun 6, 2010, 6:39:28 AM6/6/10
to sk2-g...@googlegroups.com

On 6 Jun 2010, at 03:44, drdave unknowngenius wrote:

Hi Stephen,

If I understand correctly, you want a way to control the way a comment
is going to be flagged in your install...

Easiest way, I think, is to add a custom SK2 module with the highest
priority, which sets the karma to a very low number, based on some
simple condition (e.g. grep the comment's content for a special
codeword). Just reuse one of the simpler existing module and you
should be able to get that going in a couple minutes...


An alternative way would be to run last and set the $skip_under and $skip_above so that it always gets triggered.

Thats how my plugin which enforces the WP built-in moderation rules works.


westi
-- 
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5

Reply all
Reply to author
Forward
0 new messages