[phpmix-cvs] drupal/modules/akismet akismet.module,1.4,1.5
Status: Pre-Alpha
Brought to you by:
markus_petrux
From: <php...@li...> - 2006-06-06 00:56:09
|
Update of /cvsroot/phpmix/drupal/modules/akismet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6858 Modified Files: akismet.module Log Message: - Implemented spam counter (settings and counter, a themable block is on the works). - TODO notes updated. Index: akismet.module =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/akismet.module,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** akismet.module 5 Jun 2006 13:32:39 -0000 1.4 --- akismet.module 5 Jun 2006 15:37:15 -0000 1.5 *************** *** 5,11 **** WARNING: Module is in development! @TODO: Think about and implement spam moderation queue. @TODO: Review the help page. - @TODO: Implement spam counter (and maybe a themable block?). @TODO: Implement an opt-in option for administrators to e-mail them when content is posted (maybe for all posts, or for detected spam or nothing). --- 5,11 ---- WARNING: Module is in development! + @TODO: Implement a themable block (or something for spam counter). @TODO: Think about and implement spam moderation queue. @TODO: Review the help page. @TODO: Implement an opt-in option for administrators to e-mail them when content is posted (maybe for all posts, or for detected spam or nothing). *************** *** 228,231 **** --- 228,265 ---- } + $date_formats = array( + 'F j, Y', 'j F, Y', 'Y, F j', + 'M j, Y', 'j M, Y', 'Y, M j', + 'Y/m/d', 'm/d/Y', 'd/m/Y', + 'Y-m-d', 'm-d-Y', 'd-m-Y' + ); + $date_options = array(); + $now = time(); + foreach ($date_formats as $format) { + $date_options[$format] = format_date($now, 'custom', $format); + } + + $form['counter_options'] = array( + '#type' => 'fieldset', '#title' => t('Counter options'), + '#collapsible' => TRUE, '#collapsed' => TRUE + ); + $form['counter_options']['akismet_counter_spam'] = array( + '#type' => 'textfield', '#title' => t('Spam counter'), + '#default_value' => variable_get('akismet_counter_spam', 0), + '#size' => 10, '#maxlength' => 10, + '#description' => t('This counter is incremented for every spam caught by Akismet.') + ); + $form['counter_options']['akismet_counter_since'] = array( + '#type' => 'date', '#title' => t('Counting since'), + '#default_value' => variable_get('akismet_counter_since', array('day' => date('j'), 'month' => date('n'), 'year' => date('Y'))), + '#description' => t('This is the date that will tell your visitor when your Akismet spam counter started to increment.') + ); + $form['counter_options']['akismet_counter_date_format'] = array( + '#type' => 'select', '#title' => t('Date format'), + '#default_value' => variable_get('akismet_counter_date_format', $date_formats[0]), + '#options' => $date_options, + '#description' => t('Date format used to render the <em>Counting since</em> date.') + ); + return $form; } *************** *** 414,417 **** --- 448,453 ---- // Oops! Akismet is telling us we got spammed, let's mark the comment as such. akismet_content_spam_operation('node', $node, 'submit-spam'); + // Increment Akismet spam counter + variable_set('akismet_counter_spam', intval(variable_get('akismet_counter_spam', 0)) + 1); } *************** *** 520,523 **** --- 556,561 ---- // Oops! Akismet is telling us we got spammed, let's mark the comment as such. akismet_content_spam_operation('comment', $comment, 'submit-spam'); + // Increment Akismet spam counter + variable_set('akismet_counter_spam', intval(variable_get('akismet_counter_spam', 0)) + 1); } |