Automatic Polling of B2Evolution Antispam Update List

Published by Andrew Hreschak in Web Development, b2evolution 0.9.x, PHP
Published on 09/20/05 @ 02:52:00 pm using 165 words, and has 57749 views

In b2evolution 0.9.x automatically updating the antispam database involves the creation of a local file which will process the new entries and add them to the database. First, create a file in your b2evolution blog's /admin/ folder (in this example we name the file b2antispam_poll.php) and paste the following code into it:

require_once( dirname(__FILE__) . '/../conf/_config.php' );
$login_required = false;
require_once( dirname(__FILE__) . "/$admin_dirout/$core_subdir/_main.php" );
require_once (dirname(__FILE__).'/'.$admin_dirout.'/'.$core_subdir.'/_functions_antispam.php');

Then, create the following crontab:

0 */6 * * * /path/to/php /path/to/blog/admin/b2antispam_poll.php

When CRON executes the b2antispam_poll.php file, the central antispam database is polled for new entries which are then entered into the local antispam database. Essentially, this process automates the task of updating the antispam list, eliminating the need for an administrator to manually keep the local antispam blacklist up to date.

(The above CRON syntax specifies that CRON will execute the b2antispam_poll.php file at the top of the hour, every six hours. Read this page for additional information on CRONtab syntax.)

Contemporaneous Auditory Narcotics:
or, What my speakers are currently pumping...
Quannum - I Changed My Mind

No feedback yet