An example of what it would look like to add spam filtering to your extension:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
if (cot_plugin_active( 'spam_protection' )) { require_once cot_incfile( 'spam_protection' , 'plug' ); $spam_data = array ( 'content' => $msg [ 'text' ], 'authorname' => $usr [ 'name' ], 'authoremail' => $usr [ 'profile' ][ 'user_email' ], 'authorid' => $usr [ 'id' ], 'authorip' => $usr [ 'ip' ], 'date' => $sys [ 'now' ], 'section' => 'guestbook' , 'data' => array ( 'guestbook' => $msg ), ); $spam_check_result = spam_protection_check( $spam_data ); if ( $spam_check_result [ 'is_spam' ]) { // Item was returned as spam spam_protection_queue_add( $spam_data ); // Add to the moderation queue if you want. Not required. } } |
See https://github.com/xerora/cot-spam_protection#spam_protection_checkdata for more options to pass.
Go to https://github.com/xerora/cot-spam_protection or spam_protection/docs/README.htm for further documentation.
Thanked: 7 mal
Gracias, lo usare en comentarios !