Difference between revisions of "Nobots.php"
(try border style round human detector) |
m |
||
Line 14: | Line 14: | ||
'/<td.+?\\(new users only\\)/', | '/<td.+?\\(new users only\\)/', | ||
'<td rowspan=2><a href="http://en.wikipedia.org/wiki/GIR_(Invader_Zim)"><img src="http://www.organicdesign.co.nz/wiki/images/a/a2/SadGir.jpg" /></a></td></tr> | '<td rowspan=2><a href="http://en.wikipedia.org/wiki/GIR_(Invader_Zim)"><img src="http://www.organicdesign.co.nz/wiki/images/a/a2/SadGir.jpg" /></a></td></tr> | ||
− | <tr><td><td style="border:groove 2px #eeeeee;"> | + | <tr><td><td> |
+ | <table border=0 cellpadding=0 cellspacing=0><tr><td style="border:groove 2px #eeeeee;"> | ||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | ||
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" | codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" | ||
Line 27: | Line 28: | ||
name=/wiki/nobots.swf type="application/x-shockwave-flash" | name=/wiki/nobots.swf type="application/x-shockwave-flash" | ||
pluginspage="http://www.macromedia.com/go/getflashplayer" /> | pluginspage="http://www.macromedia.com/go/getflashplayer" /> | ||
− | </object></td></tr> | + | </table></object></td></tr> |
<tr><td align=right><i>Enter the characters above <br>to prove you\'re not a robot </i></td> | <tr><td align=right><i>Enter the characters above <br>to prove you\'re not a robot </i></td> | ||
<td align=left valign=top><input type=text name=xwSpecies size=20></td> | <td align=left valign=top><input type=text name=xwSpecies size=20></td> |
Revision as of 03:27, 5 March 2006
<?
- Add an "I am a human" checkbox to stop spambots for a while
global $xwUserName; $comment = ; $code = array(); for ( $i = 1; $i < 5; $i++ ) $code[] = rand(0,1) ? rand(65,90) : rand(49,57); $code = 'code='.join( '.', $code );
if ( $event == 'view' ) { # Called after rendering login form
$article = preg_replace( '/(<td.+?Retype password:)/', "
New users:
$1", $article );
$article = preg_replace( '/<td.+?\\(new users only\\)/',
'<a href="http://en.wikipedia.org/wiki/GIR_(Invader_Zim)"><img src="http://www.organicdesign.co.nz/wiki/images/a/a2/SadGir.jpg" /></a>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width=155 height=50 id=/wiki/nobots.swf align="" type="application/x-shockwave-flash" data=/wiki/nobots.swf> <param name=flashvars value="'.$code.'"> <param name=movie value=/wiki/nobots.swf> <param name=quality value=low> <param name=bgcolor value=cccccc> <embed src=/wiki/nobots.swf quality=low bgcolor=cccccc width=155 height=50 align="" flashvars="'.$code.'" name=/wiki/nobots.swf type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> |
</object>
Enter the characters above
to prove you\'re not a robot
<input type=text name=xwSpecies size=20>
No robots allowed!',
$article ); } elseif ( $event == 'init' ) { # Called before processing posted login form xwSetProperty( $properties, 'xpath:/properties:view', $tTitle ); if ( $_REQUEST['wpCreateaccount'] ) { $xwBot = $_REQUEST['wpName']; if ( !ereg( '^[1-9A-Z]{4}$', $_REQUEST['xwSpecies'] ) ) { $url = $_SERVER['HTTP_HOST']."/wiki/index.php?title=No+Bots!&xwBot=$xwBot"; header( "Location: http://$url" ); exit; } $comment = "User:$xwBot successfully created from IP $xwUserName"; } } elseif ( $event == 'data' && ( $xwBot = $_REQUEST['xwBot'] ) ) { # This is called from the "No Bots!" page $comment = "Attempt from IP $xwUserName to create user \"$xwBot\" denied ;-)"; }
- Append the XmlWiki log article if there's a comment
if ( $comment ) { global $wgLang; $ts = $wgLang->timeanddate( wfTimestampNow(), true ); $log = xwArticleContent( 'XmlWiki Log' )."\n*$ts : $comment"; $a = new Article( Title::makeTitle( 0, 'XmlWiki Log' ) ); $a->quickEdit( $log ); } ?>