Your ultimate PunBB resource!
You are not logged in.
## ## ## Mod title: CaptchaBox ## ## Mod version: 1.0.5 ## Works on PunBB: 1.2.5,1.2.11 ## Release date: 2007-04-30 ## Author: Mathias Michel [mmichel@chez.com] ## ## Description: This gives administrators the option to use CaptchaBox for ## registering user or guest posting. CaptchaBox needs the ## user to click a defined area in an image to validate. The ## big image replace the submit button. ## ## Affects DB: Yes ## ## Affected files: register.php ## post.php ## lang/LANGUAGE/common.php ## ## Notes: This modification uses GD and sessions. ## ## DISCLAIMER: Please note that 'mods' are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## ################################################################################ ## CHANGELOG: ## 1.0.5 : finally fixed an old bug for IE6 (thanks to pierrick fdor the recall :-) ## 1.0.4 : enhanced tests of variables to avoid php notice (thanks to pierrick) ## 1.0.3 : updated class to check for the session (many thanks to smartys) ## modified string "gray" to "dark", since the color changes... ## 1.0.2 : corrected strings in plugin and inconsistency in code (thanks to tamlyn) ## 1.0.1 : corrected a bug in action 19 (second insert in post.php) ## 1.0.0 : initial release ################################################################################
Offline
Hi,
Can I run it on 1.2.14 or it requires some change on the source code (despite the max version number)?
Thanks,
srw
Offline
i installed this yesterday on 1.2.15, and it will work, except that installation is slightly differnt, you should be able to figure it out if you know what your doing, but it didnt find everything exactly the way it should, when i searched for the lines of text.
it does work tho!
backup your files first! i forgot to do this, and halfway through installing it, i was regretting to backup my files - but it worked.
Last edited by MindlessOath (2007-05-28 09:09:42)
Offline
Hi MindlessOath,
May you comment on the necessary steps? since I am not an expert in PunBB, in this case I am searching for the easy & straight way.
Thanks,
srw
Offline
Offline
Hi,
I am seeing the captcha plugin configuration, but when a new user is registered the captcha doesn't appear, any idea?
Thank you,
srw
Last edited by srw (2007-05-28 12:05:22)
Offline
Hi,
First let me say thanks for this mod, much better than haveing to figure out and type the answer imo.
Now, it seems to work but on the plugin page after clicking the Save Changes button you get re-directed to a bad url which throws a 404 message
Not Found
The requested URL /forums//forums/admin_loader.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
It`s adding /forums/ infront of the URL.. anyone know why? This only happens with this plugin, all other plugins and punbb options re-direct fine.
Thanks
oneless
Last edited by oneless (2007-11-24 12:36:04)
Offline
Anyone know if their is a captcha mod which is up-to-date and still being supported?
Offline
Read my post two posts up.
Offline
lol like I say read my previous post... post #8... I already explained it...
Offline
Well I`m using an un-edited v1.0.5 so it`s the same as the download but OK.
AP_captchabox.php
<?php
/***********************************************************************
Author: Mathias Michel
Date: 2006-05-22
Description: Plugin to add a captcha for either guest posting or
registering, or both.
Derived from a work of Kai Blankenhorn, botproof email v3.1
Copyright (C) 2006 Mathias Michel (mmichel@chez.com)
************************************************************************
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************
CHANGELOG:
2006-05-22 : corrected descriptive strings.
2006-05-09 : initial release
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);
//
// The rest is up to you!
//
// If the "Save changes" button was clicked
if (isset($_POST['set_captchabox_options']))
{
if ($_POST['regs_captchabox'] != $pun_config['o_regs_captchabox'] ) {
$query= 'UPDATE '.$db->prefix."config SET conf_value='".$_POST['regs_captchabox']."'
WHERE conf_name='o_regs_captchabox'";
$db->query($query) or error('Unable to update board config reg',__FILE__, __LINE__, $db->error());
$updated=true;
};
if ($_POST['guest_post_captchabox'] != $pun_config['o_guest_post_captchabox'] ) {
$query = 'UPDATE '.$db->prefix."config SET conf_value='".$_POST['guest_post_captchabox']."'
WHERE conf_name='o_guest_post_captchabox'";
$db->query($query) or error('Unable to update board config post '. print_r($db->error()),__FILE__, __LINE__, $db->error());
$updated=true;
}
if ($updated) {
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
redirect($_SERVER['REQUEST_URI'], 'CaptchaBox Options updated. Redirecting …');
}
};
// Display the admin navigation menu
generate_admin_menu($plugin);
?>
<div id="captchabox" class="blockform">
<h2><span>CaptchaBox plugin</span></h2>
<div class="box">
<div class="inbox">
<p>This plugin is used to replace submit buttons by image buttons.</p>
<p>This normally would eradicate most of spam on your forums.</p>
</div>
</div>
<h2 class="block2"><span>Where to use Captcha Box</span></h2>
<div class="box">
<form id="example" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>&cfg=captcha">
<fieldset>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">For guest posts</th>
<td>
<input type="radio" name="guest_post_captchabox" value="1"
<?php if ($pun_config['o_guest_post_captchabox'] == '1') echo ' checked="checked"' ?> tabindex="1"/>
<strong>Yes</strong>
<input type="radio" name="guest_post_captchabox" value="0"
<?php if ($pun_config['o_guest_post_captchabox'] == '0') echo 'checked="checked"' ?> tabindex="2"/>
<strong>No</strong>
<span>When enabled, guest users (unsigned) should click in a specific area of an image in order to post.
This is an effective way of avoiding bot spams.</span>
</td>
</tr>
<tr>
<th scope="row">For new registrations</th>
<td>
<input type="radio" name="regs_captchabox" value="1"
<?php if ($pun_config['o_regs_captchabox'] == '1') echo ' checked="checked"' ?> tabindex="3"/>
<strong>Yes</strong>
<input type="radio" name="regs_captchabox" value="0"
<?php if ($pun_config['o_regs_captchabox'] == '0') echo 'checked="checked"' ?> tabindex="4"/>
<strong>No</strong>
<span>When enabled, guest users should click in a specific area of an image in order to register.
This is an effective way of avoiding spam bots to register.</span> </td>
</tr>
</table>
<p></p>
<div><input type="submit" name="set_captchabox_options" value="Save changes" tabindex="5" />
</div>
</div>
</fieldset>
</form>
</div>
</div>
<?php
// Note that the script just ends here. The footer will be included by admin_loader.php.Offline
Try changing this line:
redirect($_SERVER['REQUEST_URI'], 'CaptchaBox Options updated. Redirecting …');
to:
redirect($pun_config['o_base_url'].'/'.basename($_SERVER['PHP_SELF']), 'CaptchaBox Options updated. Redirecting …');
Offline
404 is now gone but pun pressents an info box with this message:
Bad request. The link you followed is incorrect or outdated.
Don`t know if the debug output would be helpfull..
Debug information Time (s) Query 0.00253 SELECT u.*, g.*, o.logged, o.idle FROM x_users AS u INNER JOIN x_groups AS g ON u.group_id=g.g_id LEFT JOIN x_online AS o ON o.user_id=u.id WHERE u.id=2 0.00051 UPDATE x_online SET logged=1196114833 WHERE user_id=2 0.00025 SELECT * FROM x_online WHERE logged<1196114533 0.00039 SELECT COUNT(id) FROM x_reports WHERE zapped IS NULL Total query time: 0.00368 s
Offline
redirect($pun_config['o_base_url'].'/admin_index.php', 'CaptchaBox Options updated. Redirecting …');
That should redirect you back to the admin_index page.
Offline
Bingo! I edited it a bit so it redirected to the captcha plugin page instead. Works like a charm though.
redirect($pun_config['o_base_url'].'/admin_loader.php?plugin=AP_captchabox.php', 'CaptchaBox Options updated. Redirecting …');
Thanks for your help Matt. ![]()
Offline
is there an updated version for 1.2.19?
Offline
Hi guys.
I've translated the plugin in Italian.
First you must install the Italian Package.
Second select "Italian" as primary language.
This is the modification i made (File: punbb_dir/lang/Italian/common.php about line 151, after "Posted"):
'captchabox post tip' => 'Clicca nella parte oscura dell\'immagine per inviare i tuoi posts.', 'captchabox reg tip' => 'Clicca nella parte oscura dell\'immagine per registrarti.', 'captchabox failed' => 'Hai fallito il test. Riprova.', 'captchabox denied' => 'Hai esaurito i tentativi. Riprova più tardi.', 'captchabox img title' => 'Clicca il riquadro per la fase successiva',
I've also mailed mmichel.
You can find a working version here
I hope you enjoy it.
Last edited by chang112x (2008-12-22 13:01:57)
Offline