Difference between revisions of "Nobots.php"

From Organic Design wiki
(Redirect unless meatware)
m
Line 1: Line 1:
 
<?
 
<?
 
# Add an "I am a human" checkbox to stop spambots for a while
 
# Add an "I am a human" checkbox to stop spambots for a while
if ($event == 'view') {
+
if ( $event == 'view' ) {
 
$article = preg_replace(
 
$article = preg_replace(
 
"/(Your email\\*:.+?)<\\/tr>/is",
 
"/(Your email\\*:.+?)<\\/tr>/is",
Line 8: Line 8:
 
);
 
);
 
$article = str_replace( '(new users only)', '(new users only - no robots!)', $article );
 
$article = str_replace( '(new users only)', '(new users only - no robots!)', $article );
 +
}
 
else {
 
else {
 
xwSetProperty( $properties, 'xpath:/properties:view', $tTitle );
 
xwSetProperty( $properties, 'xpath:/properties:view', $tTitle );

Revision as of 05:29, 3 March 2006

<?

  1. Add an "I am a human" checkbox to stop spambots for a while

if ( $event == 'view' ) { $article = preg_replace( "/(Your email\\*:.+?)<\\/tr>/is",

"$1<input type='checkbox' name='xwSpecies' value='meat'>Yes I'm a meat creature",

$article ); $article = str_replace( '(new users only)', '(new users only - no robots!)', $article ); } else { xwSetProperty( $properties, 'xpath:/properties:view', $tTitle ); if ( $_REQUEST['wpCreateaccount'] ) { if ( $_REQUEST['xwSpecies'] != 'meat' ) header( "Location: http://" .$_SERVER['HTTP_HOST'].'/No+Bots!' ); } } ?>