s9y/Serendipity — comment on commit 40032c15e2e82cd919fb520b4ddb73a64d96cfed
File:  line 0
By brockhaus:

As some of us (me included) use the Bayes but not the standard SpamBlock plugin, I have added the required field check to the commentspice plugin, too, because I still want to have required fields (what is not necessarily for antispam reasons).

So, if you want to support this required fields, too, you can change the above config.inc.php code to:

if (class_exists('serendipity_event_spamblock')) {
$required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%spamblock%required_fields'", true, 'assoc');
}
elseif (class_exists('serendipity_event_commentspice')) {
$required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%commentspice%required_fields'", true, 'assoc');
}
if (is_array($required_fieldlist)) {
$required_fields = explode(',', $required_fieldlist['value']);
$smarty_required_fields = array();
foreach($required_fields AS $required_field) {
$required_field = trim($required_field);
if (empty($required_field)) continue;
$smarty_required_fields[$required_field] = $required_field;
}
$serendipity['smarty']->assign('required_fields', $smarty_required_fields);
}