Obsolete recipe, please see PmWiki.Blocklist
How can I block wiki spammers from using my site in a vain, futile attempt to increase their Google pagerank?
The blocklist.phpΔ script allows the creation of a list of words and IP addresses to be blocked from posts to the site. To use the script, simply copy it into the cookbook/ directory and then add the line
if ($action=='edit') include_once('cookbook/blocklist.php');
to the local/config.php file.
When activated, blocklist.php scans the Main.Blocklist page looking for strings of the form
In general the administrator will also want to edit-protect the Main.Blocklist page to prevent arbitrary additions/deletions from the blocklist (see PmWiki.Passwords). It's also possible to read-protect the Main.Blocklist page so that others do not know the exact phrases and/or IP addresses that are being blocked.
The blocklist.php script also sets the variable $Blocklisted, so that an administrator can perform other actions beyond simply disallowing a post.
And this script could also be used on pmwiki-v1. (Elias Soong has tested it on Pmwiki 1.0.5)