PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2007-04-30 14:44:56

mathiasm
Member
Registered: 2006-05-12
Posts: 30

Captcha Box 1.0.5

Code:

##
##
##        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 
################################################################################

Download here

Offline

 

#2 2007-04-30 14:50:16

liquidat0r
Member
From: London
Registered: 2006-10-12
Posts: 92
Website

Re: Captcha Box 1.0.5

Thanks big_smile


http://liquidat0r.com/logo.png

Offline

 

#3 2007-05-28 08:59:18

srw
New member
Registered: 2007-05-28
Posts: 3

Re: Captcha Box 1.0.5

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

 

#4 2007-05-28 09:09:07

MindlessOath
Member
Registered: 2007-04-24
Posts: 61

Re: Captcha Box 1.0.5

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

 

#5 2007-05-28 09:23:34

srw
New member
Registered: 2007-05-28
Posts: 3

Re: Captcha Box 1.0.5

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

 

#6 2007-05-28 09:38:35

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Captcha Box 1.0.5


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#7 2007-05-28 10:15:22

srw
New member
Registered: 2007-05-28
Posts: 3

Re: Captcha Box 1.0.5

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

 

#8 2007-11-24 12:33:19

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

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

 

#9 2007-11-25 16:41:20

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

Anyone know if their is a captcha mod which is up-to-date and still being supported?

Offline

 

#10 2007-11-26 00:06:38

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Captcha Box 1.0.5

whats wrong wit this one?


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#11 2007-11-26 02:28:58

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

Read my post two posts up.

Offline

 

#12 2007-11-26 09:14:41

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Captcha Box 1.0.5

yer... read my post.. whats up with it?
why isnt it supported?


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#13 2007-11-26 10:48:00

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

lol like I say read my previous post... post #8... I already explained it...

Offline

 

#14 2007-11-26 11:48:21

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Captcha Box 1.0.5

can you paste the plugin code here in [ code ] tags please?


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#15 2007-11-26 12:06:11

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

Well I`m using an un-edited v1.0.5 so it`s the same as the download but OK.

AP_captchabox.php

Code:

<?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 &hellip;');
  }

};            
    // 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'] ?>&amp;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"/>
                  &nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;
                  <input type="radio" name="guest_post_captchabox" value="0"
                  <?php if ($pun_config['o_guest_post_captchabox'] == '0') echo 'checked="checked"' ?>  tabindex="2"/>
                  &nbsp;<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"/>
                  &nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;
                  <input type="radio" name="regs_captchabox" value="0"
                  <?php if ($pun_config['o_regs_captchabox'] == '0') echo 'checked="checked"' ?>  tabindex="4"/>
                  &nbsp;<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

 

#16 2007-11-26 13:45:45

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 430

Re: Captcha Box 1.0.5

Try changing this line:

Code:

redirect($_SERVER['REQUEST_URI'], 'CaptchaBox Options updated. Redirecting &hellip;');

to:

Code:

redirect($pun_config['o_base_url'].'/'.basename($_SERVER['PHP_SELF']), 'CaptchaBox Options updated. Redirecting &hellip;');

Offline

 

#17 2007-11-26 14:09:09

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

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..

Code:

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

 

#18 2007-11-26 15:10:29

MattF
Member
From: South Yorkshire, England
Registered: 2007-03-16
Posts: 430

Re: Captcha Box 1.0.5

Code:

redirect($pun_config['o_base_url'].'/admin_index.php', 'CaptchaBox Options updated. Redirecting &hellip;');

That should redirect you back to the admin_index page.

Offline

 

#19 2007-11-26 15:46:01

oneless
New member
Registered: 2007-11-24
Posts: 8

Re: Captcha Box 1.0.5

Bingo! I edited it a bit so it redirected to the captcha plugin page instead. Works like a charm though.

Code:

redirect($pun_config['o_base_url'].'/admin_loader.php?plugin=AP_captchabox.php', 'CaptchaBox Options updated. Redirecting &hellip;');

Thanks for your help Matt. smile

Offline

 

#20 2008-08-13 16:04:57

lament
Member
Registered: 2005-11-08
Posts: 11

Re: Captcha Box 1.0.5

is there an updated version for 1.2.19?

Offline

 

#21 2008-12-22 12:55:20

chang112x
New member
Registered: 2008-12-22
Posts: 1

Re: Captcha Box 1.0.5

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"):

Code:

'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&ugrave 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

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.