Revision [19307]

Last edited on 2008-01-28 00:14:45 by SamClayton [Modified links pointing to docs server]

No Differences

Revision [17242]

Edited on 2007-07-08 05:33:50 by SamClayton [tweaked plugin code to allow editing of blacklist words page even when sbl_only_anon is false]
Additions:
if ((!$wikkaref->GetUser() || !$wikkaref->config["sbl_only_anon"]) && $wikkaref->tag != $wikkaref->config["sbl_page"]) {
Deletions:
if (!$wikkaref->GetUser() || !$wikkaref->config["sbl_only_anon"]) {


Revision [16074]

Edited on 2007-02-05 15:46:55 by MreimeR [Updated for PHP5 (not longer overwriting $this).]

No Differences

Revision [16073]

Edited on 2007-02-05 15:45:15 by MreimeR [Updated for PHP5 (not longer overwriting $this).]
Additions:
eval("?>" . $headercode);
eval("?>" . $footercode);
Deletions:
$headercode = "?>" . $headercode;
eval($headercode);
$footercode = "?>" . $footercode;
eval($footercode);


Revision [16072]

Edited on 2007-02-05 15:42:37 by MreimeR [Updated for PHP5 (not longer overwriting $this).]
Additions:
$headercode = file_get_contents("actions/header.php");
$headercode = str_replace('$this->', '$wikkaref->', $headercode);
$headercode = "?>" . $headercode;
eval($headercode);
$footercode = file_get_contents("actions/footer.php");
$footercode = str_replace('$this->', '$wikkaref->', $footercode);
$footercode = "?>" . $footercode;
eval($footercode);
Deletions:
$this = $wikkaref;
include("actions/header.php");
include("actions/footer.php");


Revision [16060]

Edited on 2007-02-04 14:08:33 by MreimeR [Moved settings from plugin to wikka.config.php, added teergrubing]
Additions:
"sbl_message" => "Es tut uns leid, aber leider hat unser Spam-Filter Ihren Text als Spam erkannt. Bitte klicken Sie auf \"Zurück\" und bearbeiten Sie ihren Text. Bitte verwenden Sie keine spamtypischen Worte (Medikamente, Potenzmittel) und senden Sie Links nicht als unkommentierte Linkliste (Links kurz erklären. Wohin führt der Link?)."
Deletions:
"sbl_message" => "Es tut uns leid, aber leider hat unser Spam-Filter Ihren Text als Spam erkannt. Bitte klicken Sie auf \"Zurück\" und bearbeiten Sie ihren Text. Bitte verwenden Sie keine Spamtypischen Worte (Medikamente, Potenzmittel) und senden Sie Links nicht als unkommentierte Linkliste (Links kurz erklären. Wohin führt der Link?)."


Revision [16059]

Edited on 2007-02-04 14:03:12 by MreimeR [Moved settings from plugin to wikka.config.php, added teergrubing]
Additions:
The plugin is using [[http://en.wikipedia.org/wiki/teergrubing teergrubing]] to keep the connection of the spammer open for at least 20 seconds!
// More information about SpamBlacklist here: http://wikkawiki.org/SpamBlacklist
// Main spam detection routine. If the message has been spam, then this
// one will call "sb_do_output_magic" and will *exit* the script immediately!
function sb_checkit($wikkaref, $body) {
if (!$wikkaref->config["sbl_page"])
die("SpamBlacklist: Please configure the plugin first!");
$sb_blacklist = $wikkaref->LoadPage($wikkaref->config["sbl_page"]);
if (!$wikkaref->GetUser() || !$wikkaref->config["sbl_only_anon"]) {
if ($wikkaref->config["sbl_logfile"]) {
$sb_fp = fopen($wikkaref->config["sbl_logfile"], "a");
sb_do_output_magic($wikkaref);
exit();
// Function for doing the output magic
// Will send the user a message first
// Then a short definition of "spam" is sent *really* slow, to slow down
// the spammer (teergrubing). The whole process takes about 20 seconds.
// This should be within the "max_execution_time" of most providers.
function sb_do_output_magic($wikkaref) {
$slow_message = array("Spamming", "is", "the", "abuse", "of", "electronic", "messaging", "systems", "to", "send", "unsolicited", "bulk", "messages,", "which", "are", "almost", "universally", "undesired.");
while(@ob_end_clean());
$this = $wikkaref;
include("actions/header.php");
print("<div class=\"page\">");
print $wikkaref->config["sbl_message"] . "<br/>\n<br/>\n";
flush();
sleep(1);
foreach ($slow_message as $word) {
print $word . " ";
flush();
sleep(1);
print "</div>";
include("actions/footer.php");
flush();
sleep(1);
print "<div class=\"smallprint\">Spam notice was generated in > 20 seconds. ";
flush();
sleep(1);
print "Spam filtering powered by <a href=\"http://www.wikkawiki.org/SpamBlacklist\">SpamBlacklist<a>. <a href=\"http://en.wikipedia.org/wiki/teergrubing\">Teergrubing</a> ends here ;-)</div>\n</body>\n</html>";
flush();
sleep(1);
?>%%
Now add the following entries to your wikka.config.php and edit them for your needs:
"sbl_page" => "SpamBlacklist", // Name of Wiki-Page with blacklist on it
"sbl_only_anon" => true, // Only append blacklist to anonymous users?
"sbl_logfile" => "spam.log", // Optional logfile (relative to wikka.php)
"sbl_message" => "No SPAM here!!!", // A short excuse message to your users.%%
Here are the two messages, used by me to inform the user about what happened:
English:
"sbl_message" => "We are sorry, but our spam filter detected your text as spam. Please use the \"back\" button and re-edit your text. Please don't use spam-like words (meds, ...) and don't send links without giving a short comment about it (explain the link. Where does it point to?)."
German:
"sbl_message" => "Es tut uns leid, aber leider hat unser Spam-Filter Ihren Text als Spam erkannt. Bitte klicken Sie auf \"Zurück\" und bearbeiten Sie ihren Text. Bitte verwenden Sie keine Spamtypischen Worte (Medikamente, Potenzmittel) und senden Sie Links nicht als unkommentierte Linkliste (Links kurz erklären. Wohin führt der Link?)."
sb_checkit($this, $_POST["body"]);
Deletions:
// Configuration area
define('SB_PAGE', "SpamBlacklist"); // Name of Wiki-Page with blacklist on it
define('SB_ONLY_ANON', true); // Only append blacklist to anonymous users?
define('SB_LOGFILE', "spam.log"); // Optional logfile (relative to wikka.php)
// Don't change below this line
// Main spam detection routine. Returns true for spam.
function sb_isspam($wikkaref, $body) {
$sb_blacklist = $wikkaref->LoadPage(SB_PAGE);
if (!$wikkaref->GetUser() || !SB_ONLY_ANON) {
if (SB_LOGFILE) {
$sb_fp = fopen(SB_LOGFILE, "a");
return true;
return false;
?>
You may configure the plugin for your needs, in the "configure area", in that file.
if (sb_isspam($this, $_POST["body"])) {
print("<div class=\"page\"><em>Go spam somewhere else!</em></div>\n");
return;


Revision [15375]

Edited on 2006-10-03 06:30:02 by MreimeR [added unhtmlentities, added flock]
Additions:
// Function for decoding all html entities
// http://www.php.net/manual/en/function.html-entity-decode.php
function sb_unhtmlentities($string) {
$string = html_entity_decode($string);
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string);
return $string;
// Main spam detection routine. Returns true for spam.
$body = sb_unhtmlentities(trim($body));
if ($sb_fp && flock($sb_fp, LOCK_EX)) {
fclose($sb_fp);
Deletions:
if ($sb_fp) {


Revision [15374]

Edited on 2006-10-03 05:40:26 by MreimeR [added unhtmlentities, added flock]
Deletions:
%%(php;1;spamblacklist.php)


Revision [15373]

Edited on 2006-10-03 05:39:41 by MreimeR [trying to set name for file]
Additions:
%%(php;1;spamblacklist.php)


Revision [15050]

Edited on 2006-08-03 09:17:46 by MreimeR [trying to set name for file]
Additions:
----
CategoryUserContributions


Revision [15009]

Edited on 2006-08-01 16:28:51 by MreimeR [trying to set name for file]
Additions:
An example for an expression could be:
Deletions:
An exaple for an expression could be:


Revision [15008]

Edited on 2006-08-01 16:15:19 by MreimeR [trying to set name for file]
Additions:
=====SpamBlacklist Plugin=====


Revision [15007]

Edited on 2006-08-01 12:47:49 by MreimeR [trying to set name for file]
Additions:
// Copyright (C) Manuel Reimer (Manuel _dot_ Reimer _at_ gmx _dot_ de)
Deletions:
// Copyright (C) Manuel Reimer (Manuel _dot_ Reimer _at_ gmx.de)


Revision [15005]

The oldest known version of this page was created on 2006-08-01 12:43:57 by MreimeR [trying to set name for file]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki
Page was generated in 0.0393 seconds