You are here

function spam_init_filters in Spam 6

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

Check if any new spam filters are available for installation.

1 call to spam_init_filters()
spam_admin_filter_overview in ./spam.module
Spam filter overview page. Allows enabling/disabling, ordering, and tuning of individual filters.

File

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

Code

function spam_init_filters() {
  static $initialized = FALSE;
  if (!$initialized) {
    $modules = spam_invoke_api('filter_module');
    foreach ($modules as $module) {
      $filter = spam_invoke_module($module, 'filter_info');
      $fid = db_result(db_query_range("SELECT fid FROM {spam_filters} WHERE name = '%s' AND module = '%s'", $filter['name'], $filter['module'], 0, 1));
      if (!$fid) {
        spam_install_filter($filter);
      }
    }
  }
}