Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5547/plugins/serendipity_event_spamblock
Modified Files:
serendipity_event_spamblock.php
Log Message:
spamblock plugin can be configured to hide email adresses when displaying
comments
Index: serendipity_event_spamblock.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- serendipity_event_spamblock.php 23 Nov 2004 10:02:59 -0000 1.29
+++ serendipity_event_spamblock.php 24 Nov 2004 15:30:00 -0000 1.30
@@ -53,7 +53,9 @@
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_FORCEMODERATION', 'Moderation nach X Tagen');
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_LINKS_REJECT', 'Zu viele Links');
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_LINKS_MODERATE', 'Zu viele Links');
-
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL', 'E-Mail-Adressen bei Kommentatoren verstecken');
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_DESC', 'Zeigt in den Kommentaren keine E-Mail Adressen der jeweiligen Kommentatoren an');
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_NOTICE', 'Die angegebene E-Mail Adressse wird nicht dargestellt, sondern nur für evtl. Benachrichtigungen verwendet');
break;
default:
@@ -110,6 +112,9 @@
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_FORCEMODERATION', 'Auto-moderation after X days');
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_LINKS_REJECT', 'Too many hyperlinks');
@define('PLUGIN_EVENT_SPAMBLOCK_REASON_LINKS_MODERATE', 'Too many hyperlinks');
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL', 'Hide E-Mail addresses for commenting users');
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_DESC', 'Will show no E-Mail addresses in comments of commenting users');
+ @define('PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_NOTICE', 'E-Mail addresses will not be displayed and only used for E-Mail notifications');
break;
}
@@ -128,13 +133,14 @@
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking, Sebastian Nohn');
- $propbag->add('version', '1.1');
+ $propbag->add('version', '1.15');
$propbag->add('event_hooks', array(
'frontend_saveComment' => true,
'external_plugin' => true,
- 'frontend_comment' => true
+ 'frontend_comment' => true,
+ 'fetchcomments' => true
));
- $propbag->add('configuration', array('killswitch', 'bodyclone', 'ipflood', 'surbl_enabled', 'rbl_enabled', 'rbllist', 'captchas', 'captchas_ttl', 'captcha_color', 'forcemoderation', 'links_moderate', 'links_reject', 'logfile'));
+ $propbag->add('configuration', array('killswitch', 'bodyclone', 'ipflood', 'surbl_enabled', 'rbl_enabled', 'rbllist', 'captchas', 'captchas_ttl', 'captcha_color', 'forcemoderation', 'links_moderate', 'links_reject', 'logfile', 'hide_email'));
}
function introspect_config_item($name, &$propbag)
@@ -142,6 +148,13 @@
global $serendipity;
switch($name) {
+ case 'hide_email':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL);
+ $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_DESC);
+ $propbag->add('default', false);
+ break;
+
case 'bodyclone':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE);
@@ -271,6 +284,15 @@
}
switch($event) {
+ case 'fetchcomments':
+ if (is_array($eventData) && serendipity_db_bool($this->get_config('hide_email', false))) {
+ @reset($eventData);
+ while(list($idx, $comment) = each($eventData)) {
+ $eventData[$idx]['email'] = '';
+ }
+ }
+ break;
+
case 'frontend_saveComment':
if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) {
$serendipity['csuccess'] = 'true';
@@ -403,6 +425,10 @@
break;
case 'frontend_comment':
+ if (serendipity_db_bool($this->get_config('hide_email', false))) {
+ echo '<div class="serendipity_commentDirection">' . PLUGIN_EVENT_SPAMBLOCK_HIDE_EMAIL_NOTICE . '</div>';
+ }
+
if ($show_captcha) {
echo '<div class="serendipity_commentDirection">';
if (!isset($serendipity['POST']['preview']) || strtolower($serendipity['POST']['captcha'] != strtolower($_SESSION['spamblock']['captcha']))) {
@@ -432,6 +458,7 @@
}
echo '</div>';
}
+
return true;
break;
|