Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CommentSpice, SpamblockBee: Removed antispam related code from CS and

finetuned SB.
  • Loading branch information...
commit 43b7bcaaa36587d42f2f1e7be5fa08f30bc4ff3c 1 parent 385533e
@brockhaus brockhaus authored
View
3  serendipity_event_commentspice/ChangeLog
@@ -1,3 +1,6 @@
+Version 1.02
+* Removed all antispam related and put it into a new plugin "Spamblock Bee".
+
Version 1.01
* Preview of a comment is "spiced" now, too.
* Preview comment is not loosing article promotion selection anymore.
View
16 serendipity_event_commentspice/UTF-8/lang_de.inc.php
@@ -1,7 +1,7 @@
<?php
@define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators. Implementiert auch einige AntiSpam Routinen wie einen "Honeypot" und nofollow nach bestimmten Regeln.');
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators und nofollow nach bestimmten Regeln.');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Artikel bewerben');
@@ -59,20 +59,6 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugin Pfad');
@define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Pflichtfelder');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
-
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Honeypot einsetzen');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'Ein "Honeypot" ist ein verstecktes Kommentar Feld, das leer gelasen werden soll. Da Bots aber dazu tendieren, alle vorgefundenen Felder auszufüllen, ist dies ein einfacher und unkritischer Weg, viele der Bots auszusperren. Um den Honeypot besonders effektiv zu machen, setze CommentSpice als erstes AntiSpam plugin in Deiner Liste ein.');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam Log Typ');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Wohin sollen Kommentare, die von CommentSpice gefunden wurden, geloggt werden?');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Nicht loggen');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Textdatei');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog Datenbank Tabelle');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logdatei');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Wohin soll das Textfile für die Logs gespeichert werden?');
@define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Erweiterte Einstellungen anzeigen');
@define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Grundeinstellungen anzeigen');
View
16 serendipity_event_commentspice/lang_de.inc.php
@@ -1,7 +1,7 @@
<?php
@define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators. Implementiert auch einige AntiSpam Routinen wie einen "Honeypot" und nofollow nach bestimmten Regeln.');
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Würze Deinen Kommentarbereich mit Extras wie einem Twitterlink oder einem Link auf den letzten Artikel des Kommentators und nofollow nach bestimmten Regeln.');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Artikel bewerben');
@@ -59,20 +59,6 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugin Pfad');
@define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Pflichtfelder');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
-
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Honeypot einsetzen');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'Ein "Honeypot" ist ein verstecktes Kommentar Feld, das leer gelasen werden soll. Da Bots aber dazu tendieren, alle vorgefundenen Felder auszufüllen, ist dies ein einfacher und unkritischer Weg, viele der Bots auszusperren. Um den Honeypot besonders effektiv zu machen, setze CommentSpice als erstes AntiSpam plugin in Deiner Liste ein.');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam Log Typ');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Wohin sollen Kommentare, die von CommentSpice gefunden wurden, geloggt werden?');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Nicht loggen');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Textdatei');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog Datenbank Tabelle');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logdatei');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Wohin soll das Textfile für die Logs gespeichert werden?');
@define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Erweiterte Einstellungen anzeigen');
@define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Grundeinstellungen anzeigen');
View
16 serendipity_event_commentspice/lang_en.inc.php
@@ -1,7 +1,7 @@
<?php
@define('PLUGIN_EVENT_COMMENTSPICE_TITLE', 'Comment Spice');
-@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Spice up your comments area with goodies like commenters twitter or last posted article link. Has some antispam stuff like a honeypot and nofollows by rules.');
+@define('PLUGIN_EVENT_COMMENTSPICE_DESC', 'Spice up your comments area with goodies like commenters twitter or last posted article link and nofollows by rules.');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_TWITTERNAME', 'Twittername');
@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_ANNOUNC_RSS', 'Announce recent posts');
@@ -59,20 +59,6 @@
@define('PLUGIN_EVENT_COMMENTSPICE_PATH', 'Plugins path');
@define('PLUGIN_EVENT_COMMENTSPICE_PATH_DESC', 'In normal installations the default is correct.');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS', 'Required comment fields');
-@define('PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC', 'Enter a list of required fields that need to be filled when a user comments. Seperate multiple fields with a ",". Available keys are: name, email, url, replyTo, comment');
-@define('PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD', 'You did not specify the %s field!');
-
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM', 'Anti Spam');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT', 'Use Honeypot');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC', 'A "Honeypot" is a hidden comment form field that should be left empty but as most SPAM bots do fill any field found it is an easy way to detect automatic commenting. There is no risk to switch it on, but high benefit! In order to make the honeypot more effective put CommentSpice at top of any anti spam plugin.');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE', 'Spam log type');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC', 'Where do you want to log spam found by CommentSpice?');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE', 'Don\'t log');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE', 'Text logfile');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE', 'Spamlog database table');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE', 'Logfile');
-@define('PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC', 'Where to save the logfile if used for logging?');
@define('PLUGIN_EVENT_COMMENTSPICE_EXPERTSETTINGS', 'Show advanced settings');
@define('PLUGIN_EVENT_COMMENTSPICE_STANDARDSETTINGS', 'Show basic settings');
View
162 serendipity_event_commentspice/serendipity_event_commentspice.php
@@ -34,7 +34,8 @@ function introspect(&$propbag)
'smarty' => '2.6.7',
'php' => '4.1.0'
));
- $propbag->add('version', '1.01');
+ $propbag->add('version', '1.02');
+
$propbag->add('event_hooks', array(
'entry_display' => true,
'frontend_footer' => true,
@@ -47,7 +48,7 @@ function introspect(&$propbag)
'css' => true,
'avatar_fetch_userinfos' => true,
));
- $propbag->add('groups', array('FRONTEND_VIEWS','ANTISPAM'));
+ $propbag->add('groups', array('FRONTEND_VIEWS'));
$config_switchexpert = array('expert_switch');
$config_twitter = array('title_twitter','twitterinput','followme_widget', 'followme_widget_counter','followme_widget_dark');
@@ -60,13 +61,7 @@ function introspect(&$propbag)
$config_boo = array('title_boo','allow_boo','moderate_boo');
- $config_spam = array('title_spam', 'do_honeypot');
- $config_spam_expert = array('spamlogtype', 'spamlogfile');
-
$config_general = array('title_general');
- if (!class_exists('serendipity_event_spamblock')) { // Only do that, if spamblock is not installed.
- $config_general[] = 'required_fields';
- }
if (function_exists('fetchPingbackData') && $this->isLocalConfigWritable()) {
$config_general[] = 'fetchPingback';
}
@@ -74,16 +69,16 @@ function introspect(&$propbag)
$open_expert_setting = isset($_GET['pluginexpert']);
if ($open_expert_setting) {
- $configuration = array_merge($config_switchexpert,$config_twitter, $config_twitter_expert, $config_announce, $config_announce_expert, $config_boo, $config_rules, $config_rules_extra, $config_spam, $config_spam_expert, $config_general, $config_general_expert);
+ $configuration = array_merge($config_switchexpert,$config_twitter, $config_twitter_expert, $config_announce, $config_announce_expert, $config_boo, $config_rules, $config_rules_extra, $config_general, $config_general_expert);
}
else {
- $configuration = array_merge($config_switchexpert,$config_twitter, $config_announce, $config_rules, $config_spam, $config_general);
+ $configuration = array_merge($config_switchexpert,$config_twitter, $config_announce, $config_rules, $config_general);
}
$propbag->add('configuration', $configuration );
}
function generate_content(&$title) {
- $title = PLUGIN_EVENT_EMOTICONCHOOSER_TITLE;
+ $title = PLUGIN_EVENT_COMMENTSPICE_TITLE;
}
function introspect_config_item($name, &$propbag)
@@ -257,45 +252,10 @@ function introspect_config_item($name, &$propbag)
$propbag->add('default', 0);
break;
- case 'title_spam':
- $propbag->add('type', 'content');
- $propbag->add('default', '<br/><h3>' . PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM .'</h3>');
- break;
- case 'do_honeypot':
- $propbag->add('type', 'boolean');
- $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT);
- $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_HONEYPOT_DESC);
- $propbag->add('default', true);
- break;
- case 'spamlogtype':
- $logtypevalues = array (
- 'none' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_NONE,
- 'file' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_FILE,
- 'db' => PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DATABASE,
- );
- $propbag->add('type', 'select');
- $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE);
- $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGTYPE_DESC);
- $propbag->add('select_values', $logtypevalues);
- $propbag->add('default', 'none');
- break;
- case 'spamlogfile':
- $propbag->add('type', 'string');
- $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE);
- $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_CONFIG_SPAM_LOGFILE_DESC);
- $propbag->add('default', $serendipity['serendipityPath'] . 'spamblock.log');
- break;
-
case 'title_general':
$propbag->add('type', 'content');
$propbag->add('default', '<br/><h3>' . PLUGIN_EVENT_COMMENTSPICE_CONFIG_GENERAL .'</h3>');
break;
- case 'required_fields':
- $propbag->add('type', 'string');
- $propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS);
- $propbag->add('description', PLUGIN_EVENT_COMMENTSPICE_REQUIRED_FIELDS_DESC);
- $propbag->add('default', '');
- break;
case 'plugin_path':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_COMMENTSPICE_PATH);
@@ -569,32 +529,7 @@ function checkComment(&$eventData, &$addData) {
if ("NORMAL" == $addData['type']) { // only supported for normal comments
$this->rememberInputs();
- // Check for honeypot:
- $do_honepot = serendipity_db_bool($this->get_config('do_honeypot',true));
- if ($do_honepot && (!empty($serendipity['POST']['phone']) || $serendipity['POST']['phone']=='0') ) {
- $logfile = $this->get_config('spamlogfile', $serendipity['serendipityPath'] . 'spamblock.log');
- $this->spamlog($logfile, $eventData['id'], 'REJECTED', $serendipity['POST']['phone'], $addData);
- $eventData = array('allow_comments' => false);
- return false;
- }
-
- // Check, if all required fields are set, but only if spamblock is not installed.
- if (!class_exists('serendipity_event_spamblock')) {
- $required_fields = $this->get_config('required_fields', '');
- if (!empty($required_fields)) {
- $required_field_list = explode(',', $required_fields);
- foreach($required_field_list as $required_field) {
- $required_field = trim($required_field);
- if (empty($addData[$required_field])) {
- $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD, $addData);
- $eventData = array('allow_comments' => false);
- $serendipity['messagestack']['comments'][] = sprintf(PLUGIN_EVENT_COMMENTSPICE_REASON_REQUIRED_FIELD, $required_field);
- return false;
- }
- }
- }
- }
-
+
// Check, if promoted URL is still valid (unmodified)
if (isset($serendipity['POST']['promorss']) && !empty($serendipity['POST']['promorss'])) {
$promorss = $serendipity['POST']['promorss'];
@@ -942,15 +877,6 @@ function printCommentEditExtras(&$eventData, &$addData) {
$styleInputRss = serendipity_db_bool($this->get_config('style_inputrss',true));
- // Honeypot
- if (serendipity_db_bool($this->get_config('do_honeypot',true))) {
- echo '<div id="serendipity_commentspice_phone" class="serendipity_commentDirection commentspice_phone_input" >' . "\n";
- echo '<img src="' . $serendipity['baseURL'] . 'index.php?/plugin/commentspice.png" class="commentspice_ico" title="' . PLUGIN_EVENT_COMMENTSPICE_TITLE . '">' . "\n";
- echo '<label for="serendipity_commentform_phone">Phone*</label>' . "\n";
- echo '<input class="commentspice_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
- echo "</div>\n";
- }
-
if ($do_twitter) {
if (isset($serendipity['COOKIE']['remember']) && isset($serendipity['COOKIE']['twitter'])) {
$twittername = $serendipity['COOKIE']['twitter'];
@@ -1081,15 +1007,6 @@ function printCss(&$eventData, &$addData) {
}
<?php
}
- if (!(strpos($eventData, '.commentspice_phone_input'))) {
-?>
-.commentspice_phone_input {
- max-width: 100%;
- display:none;
- visibility:hidden;
-}
-<?php
- }
if (!(strpos($eventData, '.commentspice_twitter_input'))) {
?>
.commentspice_twitter_input {
@@ -1189,69 +1106,4 @@ function log($message){
fflush($fp);
fclose($fp);
}
-
- function spamlog($logfile, $id, $switch, $reason, $addData) {
- global $serendipity;
- $method = $this->get_config('spamlogtype', 'none');
- if (empty($logfile)) $logfile = dirname(__FILE__) . '/spice_honeypot.log';
-
- switch($method) {
- case 'file':
- $reason = "Honeypot=$reason";
- if (empty($logfile)) {
- return;
- }
- if (strpos($logfile, '%') !== false) {
- $logfile = strftime($logfile);
- }
-
- $fp = @fopen($logfile, 'a+');
- if (!is_resource($fp)) {
- return;
- }
- fwrite($fp, sprintf(
- '[%s] - [%s: %s] - [#%s, Name "%s", E-Mail "%s", URL "%s", User-Agent "%s", IP %s] - [%s]' . "\n",
- date('Y-m-d H:i:s', serendipity_serverOffsetHour()),
- $switch,
- $reason,
- $id,
- str_replace("\n", ' ', $addData['name']),
- str_replace("\n", ' ', $addData['email']),
- str_replace("\n", ' ', $addData['url']),
- str_replace("\n", ' ', $_SERVER['HTTP_USER_AGENT']),
- $_SERVER['REMOTE_ADDR'],
- str_replace("\n", ' ', $addData['comment'])
- ));
-
- fclose($fp);
- break;
-
- case 'none':
- return;
- break;
-
- case 'db':
- default:
- $reason = "CommentSpice Honeypot: " . serendipity_db_escape_string($reason);
- $q = sprintf("INSERT INTO {$serendipity['dbPrefix']}spamblocklog
- (timestamp, type, reason, entry_id, author, email, url, useragent, ip, referer, body)
- VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
-
- serendipity_serverOffsetHour(),
- serendipity_db_escape_string($switch),
- serendipity_db_escape_string($reason),
- serendipity_db_escape_string($id),
- serendipity_db_escape_string($addData['name']),
- serendipity_db_escape_string($addData['email']),
- serendipity_db_escape_string($addData['url']),
- substr(serendipity_db_escape_string($_SERVER['HTTP_USER_AGENT']), 0, 255),
- serendipity_db_escape_string($_SERVER['REMOTE_ADDR']),
- substr(serendipity_db_escape_string(isset($_SESSION['HTTP_REFERER']) ? $_SESSION['HTTP_REFERER'] : $_SERVER['HTTP_REFERER']), 0, 255),
- serendipity_db_escape_string($addData['comment'])
- );
-
- serendipity_db_schema_import($q);
- break;
- }
- }
}
View
7 serendipity_event_spamblock_bee/UTF-8/lang_de.inc.php
@@ -1,11 +1,12 @@
<?php
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honepot)');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implementiert einfache Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind. (Honeypot)');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honeypot)');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implementiert Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind (Honeypot).');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC', '<strong>Installationshinweis</strong>: Es ist recht wichtig, dieses Plugin an die Spitze Deiner Plugin Liste zu verschieben, weil es dann am effektivsten arbeiten kann.');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugin Pfad');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder beim Kommentieren');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
View
7 serendipity_event_spamblock_bee/lang_de.inc.php
@@ -1,11 +1,12 @@
<?php
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honepot)');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implementiert einfache Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind. (Honeypot)');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamschutz Biene (Honeypot)');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implementiert Kommentar AntiSpam Maßnahmen, die einfach zu konfigurieren aber sehr effektiv sind (Honeypot).');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC', '<strong>Installationshinweis</strong>: Es ist recht wichtig, dieses Plugin an die Spitze Deiner Plugin Liste zu verschieben, weil es dann am effektivsten arbeiten kann.');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugin Pfad');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normalen Installationen ist der Default die korrekte Einstellung.');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Pflichtfelder beim Kommentieren');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Geben Sie die Liste von Pflichtfeldern bei der Abgabe eines Kommentars ein. Mehrere Felder können mit "," getrennt werden. Verfügbare Felder sind: name, email, url, replyTo, comment');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'Sie haben das Feld "%s" nicht ausgefüllt!');
View
7 serendipity_event_spamblock_bee/lang_en.inc.php
@@ -1,11 +1,12 @@
<?php
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamblock Bee (Honepot)');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implements simple comment antispam mechanisms, that are easy to configure but very effective (Honepot).');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_TITLE', 'Spamblock Bee (Honeypot)');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_DESC', 'Implements simple comment antispam mechanisms, that are easy to configure but very effective (Honeypot).');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC', '<strong>Installation hint</strong>: It is important that you put this plugin at the start of your plugin list. It will be most effective then.');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH', 'Plugins path');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC', 'In normal installations the default is correct.');
-@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Required comment fields');
+@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS', 'Required comment fields when commenting');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC', 'Enter a list of required fields that need to be filled when a user comments. Seperate multiple fields with a ",". Available keys are: name, email, url, replyTo, comment');
@define('PLUGIN_EVENT_SPAMBLOCK_BEE_REASON_REQUIRED_FIELD', 'You did not specify the %s field!');
View
31 serendipity_event_spamblock_bee/serendipity_event_spamblock_bee.php
@@ -40,7 +40,11 @@ function introspect(&$propbag)
));
$propbag->add('groups', array('ANTISPAM'));
- $configuration = array('do_honeypot', 'spamlogtype', 'spamlogfile', 'plugin_path');
+ $configuration = array('header_desc','do_honeypot', 'spamlogtype', 'spamlogfile', );
+ if (!class_exists('serendipity_event_spamblock')) { // Only do that, if spamblock is not installed.
+ $configuration[] = 'required_fields';
+ }
+ $configuration[] = 'plugin_path';
$propbag->add('configuration', $configuration );
}
@@ -54,6 +58,11 @@ function introspect_config_item($name, &$propbag)
global $serendipity;
switch($name) {
+ case 'header_desc':
+ $propbag->add('type', 'content');
+ $propbag->add('default', PLUGIN_EVENT_SPAMBLOCK_BEE_EXTRA_DESC);
+ break;
+ break;
case 'do_honeypot':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BEE_CONFIG_SPAM_HONEYPOT);
@@ -80,8 +89,8 @@ function introspect_config_item($name, &$propbag)
break;
case 'required_fields':
$propbag->add('type', 'string');
- $propbag->add('name', PLUGIN_EVENT_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS);
- $propbag->add('description', PLUGIN_EVENT_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC);
+ $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS);
+ $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BEE_REQUIRED_FIELDS_DESC);
$propbag->add('default', '');
break;
@@ -89,7 +98,7 @@ function introspect_config_item($name, &$propbag)
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BEE_PATH);
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BEE_PATH_DESC);
- $propbag->add('default', $serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_commentspice/');
+ $propbag->add('default', $serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_spamblock_bee/');
break;
default:
@@ -169,9 +178,9 @@ function printCommentEditExtras(&$eventData, &$addData) {
// Honeypot
if (serendipity_db_bool($this->get_config('do_honeypot',true))) {
- echo '<div id="serendipity_commentspice_phone" class="serendipity_commentDirection commentspice_phone_input" >' . "\n";
+ echo '<div id="serendipity_comment_phone" class="serendipity_commentDirection comment_phone_input" >' . "\n";
echo '<label for="serendipity_commentform_phone">Phone*</label>' . "\n";
- echo '<input class="commentspice_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
+ echo '<input class="comment_phone_input" type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="" placeholder="You don\'t want to give me your number, do you? ;)"/>' . "\n";
echo "</div>\n";
}
}
@@ -179,13 +188,15 @@ function printCommentEditExtras(&$eventData, &$addData) {
function printCss(&$eventData, &$addData) {
global $serendipity;
- if (!(strpos($eventData, '.commentspice_phone_input'))) {
+ if (!(strpos($eventData, '.comment_phone_input'))) {
?>
-.commentspice_phone_input {
+.comment_phone_input {
max-width: 100%;
+}
+/*
display:none;
visibility:hidden;
-}
+*/
<?php
}
}
@@ -201,7 +212,7 @@ function hashString( $what ) {
function log($message){
if (!PLUGIN_EVENT_SPAMBLOCK_BEE_DEBUG) return;
- $fp = fopen(dirname(__FILE__) . '/spice.log','a');
+ $fp = fopen(dirname(__FILE__) . '/spambee.log','a');
fwrite($fp, date('Y.m.d H:i:s') . " - " . $message . "\n");
fflush($fp);
fclose($fp);
Please sign in to comment.
Something went wrong with that request. Please try again.