You are here

function spam_denied_in_error_page in Spam 6

Same name and namespace in other branches
  1. 5.3 spam.module \spam_denied_in_error_page()

Allow the user to report when their content was inapropriately marked as spam.

1 string reference to 'spam_denied_in_error_page'
spam_menu in ./spam.module
Drupal _menu() hook.

File

./spam.module, line 1642
Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.

Code

function spam_denied_in_error_page() {
  if ($_SESSION['spam_content']) {
    $content = unserialize($_SESSION['spam_content']);
    if (is_array($content)) {
      $hash = md5($_SESSION['spam_content']);
      $exists = db_result(db_query("SELECT bid FROM {spam_filters_errors} WHERE content_hash = '%s'", $hash));
      if ($exists) {
        $output = t('You have already reported this content as not spam.  Please be patient; a site administrator will review it soon.');
      }
      else {
        return drupal_get_form('spam_error_page');
      }
    }
  }
  return $output;
}