Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28745/serendipity_event_spamblock
Modified Files:
Tag: branch-smarty
serendipity_event_spamblock.php
Log Message:
MFH: Better structure
Index: serendipity_event_spamblock.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -u -d -r1.4.2.5 -r1.4.2.6
--- serendipity_event_spamblock.php 22 Sep 2004 15:26:29 -0000 1.4.2.5
+++ serendipity_event_spamblock.php 22 Sep 2004 15:37:40 -0000 1.4.2.6
@@ -34,6 +34,8 @@
@define('PLUGIN_EVENT_SPAMBLOCK_LINKS_REJECT_DESC', 'When a comment reaches a certain amount of links, that comment can be set to be moderated. 0 means that no link-checking is done.');
@define('PLUGIN_EVENT_SPAMBLOCK_NOTICE_MODERATION', 'Because of some conditions, your comment has been marked to require moderation by the owner of this blog.');
+ @define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR', 'Background color of the captcha');
+ @define('PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR_DESC', 'Enter RGB values: 0,255,255');
break;
}
@@ -52,7 +54,7 @@
'external_plugin' => true,
'frontend_comment' => true
));
- $propbag->add('configuration', array('bodyclone', 'killswitch', 'ipflood', 'rbl', 'captchas', 'captchas_ttl', 'forcemoderation', 'links_moderate', 'links_kill'));
+ $propbag->add('configuration', array('killswitch', 'bodyclone', 'ipflood', 'rbl', 'captchas', 'captchas_ttl', 'captcha_color', 'forcemoderation', 'links_moderate', 'links_reject'));
}
function introspect_config_item($name, &$propbag)
@@ -102,6 +104,13 @@
$propbag->add('default', '7');
break;
+ case 'captcha_color':
+ $propbag->add('type', 'string');
+ $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR);
+ $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR_DESC);
+ $propbag->add('default', '255,255,255');
+ break;
+
case 'forcemoderation':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_FORCEMODERATION);
@@ -272,6 +281,7 @@
$height = 40;
$max_char = 5;
$min_char = 3;
+ $bgcolors = explode(',', $this->get_config('captcha_color', '255,255,255'));
$fontfiles = array('Comic_Sans_MS.ttf', 'Impact.ttf', 'Verdana.ttf');
$chars = array(2, 3, 4, 7, 9); // 1, 5, 6 and 8 may look like characters.
@@ -290,7 +300,7 @@
header('Content-Type: image/jpeg');
$image = imagecreate($width, $height);
- imagecolorallocate($image, 0, 0, 0);
+ imagecolorallocate($image, trim($bgcolors[0]), trim($bgcolors[1]), trim($bgcolors[2]));
// imagettftext($image, 10, 1, 1, 15, imagecolorallocate($image, 255, 255, 255), $font, 'String: ' . $string);
$pos_x = 5;
@@ -330,4 +340,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file
|