danopia (owner)

Revisions

gist: 170866 Download_button fork
public
Public Clone URL: git://gist.github.com/170866.git
Embed All Files: show embed
.htaccess #
1
2
3
4
5
6
7
8
9
10
# Put this file in the folder that has board/
# Probably public_html with shared hosting
 
RewriteEngine on
RewriteRule ^captcha.png$ board/captcha.php
RewriteRule ^captcha/([a-zA-Z0-9\ +]+)\.png$ board/captcha.php?message=$1
 
# Now go to <http://your_host/captcha.png>
# or <http://your_host/captcha/meep.png>
# (where your board is at <http://your_host/board/>)
board/captcha.php #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
// Custom CAPTCHA Server
// Copyright 2009 Danopia <http://danopia.net/>
 
// Assumes your board is in board/
// Put this file in board/
 
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
if ($config['captcha_gd'])
{
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
}
else
{
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
}
 
$config['captcha_gd_3d_noise'] = false;
 
$message = str_replace('0', 'O', strtoupper(request_var('message', 'I AM 1337')));
 
$captcha = new captcha();
$captcha->execute($message, time());
 
?>