Captcha (Visual Confirmation) for adding comments - Page 11 Captcha (Visual Confirmation) for adding comments - Page 11
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Captcha (Visual Confirmation) for adding comments

Started by Abbas Ali, March 25, 2006, 08:39:59 AM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

claude258

I dont know why but I just happen to see that my site has a red X instead of the confirmation code.
http://claudebriere.net/coppermine/displayimage.php?album=72&pos=2

It was working well before ???.

Can you help?

Thanks.
Claude

claude258

Quote from: claude258 on November 01, 2006, 01:44:18 AM
I dont know why but I just happen to see that my site has a red X instead of the confirmation code.
http://claudebriere.net/coppermine/displayimage.php?album=72&pos=2

It was working well before ???.

Can you help?

Thanks.
Claude

I switched to the plugin version and it is working. But when a wrong code is used it goes to a error page (white page with codes...)
http://claudebriere.net/coppermine/displayimage.php?pos=-1697

Abbas Ali

For plugin version, address your issue on the respective thread i.e. the plugin version thread.
Chief Geek at Ranium Systems

jakejammin

Quote from: darktea on October 31, 2006, 11:41:18 PM
Any suggestions you could make would be wonderful and I have enabled the debug info just in case it is helpful.  www.darktea.co.uk

Thank you


We can not see your phpinfo page.  Make sure the GD Support has FreeType Support listed.  I found out today, just because you see GD Support installed does not mean that GD Support has FreeType installed.

Again it must say FreeType Support enabled.  If it does not ask your host provider if they have FreeType Support enabled on their servers.

Hope that helps ;)

Abbas Ali

Quote from: Abbas Ali on October 31, 2006, 06:16:23 AM
@niks_007: Try removing the below mentioned code from captcha.php file


require("include/init.inc.php");


@Nishant: Did you do what i said?
Chief Geek at Ranium Systems

ceesjoore

Quote from: Abbas Ali on October 30, 2006, 06:31:20 AM
@ceesjoore: Your server doesn't have one of the functions ( imageftbbox() )required by this mod. You need to ask your webhost for this. That function is generally present if freetype is enabled.


Abbas,
My hosting provider told me that they don't have that function, so there is no solution for my problem now.
But thanks for helping.

Abbas Ali

@ceesjoore: There are other captcha mods too (Mods: Comments). Try one of those.
Chief Geek at Ranium Systems

Hein Traag

Quote from: jakejammin on October 31, 2006, 08:03:52 PM
I think there is some confusion in adding this mod for the average user which does not know PHP or how it is coded.

So I'm going to post a clear how to:

I will do this in steps for everyone.

...

Jake

Thanks Jake i will give this a try. Maybe i missed something in editing my files.

Cheers!
Hein

niks_007

Hi...
      I am extreemly Thankfull to Mr. Abbas Ali and others who have helped me
      Yes It has started Working... realy thanks alot to all.

Thanks
Nishant
www.lakesparadise.com

mrdummy

It works, but i have edited in themes.inc.php

After reading this topic, i checked sample theme.php version and there is indeed same code.
The problem that i use igames theme. The theme.php has no function and template input code inside.

I must copy both codes from /sample/theme.php.
First part is template part, found at row 813-867.
copy to theme/theme.php, then add the code what is written in the first topic post.

<!-- begin captcha mod -->
<tr>
<td class="tableb_compact" colspan="2">
{CONFIRM}
</td>
<td class="tableb_compact" colspan="2">
<input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
</td>
</tr>
<!-- end captcha mod -->

behind code

<!-- END input_box_no_smilies -->
    <td class="tableb_compact">
     <input type="hidden" name="event" value="comment" />
     <input type="hidden" name="pid" value="{PIC_ID}" />
     <input type="submit" class="comment_button" name="submit" value="{OK}" />
    </td>
    </tr>

The <!-- xxx --> are just for marking new mods.

Second part, function part, is found at row 2248-2356. Copy whole part to your theme/theme.php, below the code.
Add after
'{COMMENT}' => $lang_display_comments['comment'],
the code
'{CONFIRM}' => $lang_display_comments['confirm'],

You may place both parts below own theme/theme.php without troubles.

The code for db_input.php is found by row 113: case 'comment':
The code for language file is found:
- by 'non_exist_comment' around row 101 (remove the comma because it's last string in array!)
(there are TWO 'non_exist_comment' codes, at row 90 and 101...... :( Forgot to remove it?)
- by 'report_comment_title' around row 1033 or 1034 after adding code, remove also comma.
You may copy same code in another language files and translate it in your language.

I use Dreamweaver to edit the php files without troubles. Even for Dutch language file.
Alle files are from version 1.4.10, but igames theme is perhaps added.
Actually, if you're good with php, you can also copy code from theme.inc.php because it's same code, but don't copy function_exist part, but only between {} in if function_exists code.

mrdummy

There is more.
http://forum.coppermine-gallery.net/index.php?topic=29564.msg168167#msg168167 has good code to switch captcha off when user is logged in. Thanks.

But the template part is too much long (for just small difference). I have much shorter code for template part:

// HTML template for the form to add comments
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <td class="tableb_compact">
                                <input type="hidden" name="event" value="comment" />
                                <input type="hidden" name="pid" value="{PIC_ID}" />
                                <input type="submit" class="comment_button" name="submit" value="{OK}" />
                                </td>
                                </tr>
EOT;
if (!USER_ID) {
$template_add_your_comment .= <<<EOT
<!-- begin captcha mod -->
<tr>
<td class="tableb_compact" colspan="2"></td>
  <td class="tableb_compact">
    {CONFIRM}
  </td>
  <td class="tableb_compact" colspan="2">
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
  </td>
</tr>
<!-- end captcha mod -->
EOT;
}
$template_add_your_comment .= <<<EOT
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;


Look at the part

if (!USER_ID) {
$template_add_your_comment .= <<<EOT
<!-- begin captcha mod -->
<tr>
<td class="tableb_compact" colspan="2"></td>
  <td class="tableb_compact">
    {CONFIRM}
  </td>
  <td class="tableb_compact" colspan="2">
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
  </td>
</tr>
<!-- end captcha mod -->
EOT;
}

and the trick with .= behind the string $template_add_your_comment does the work. This is much shorter and lesser same code repeats.

jakejammin

Quote from: mrdummy on November 01, 2006, 09:24:51 PM
There is more.
http://forum.coppermine-gallery.net/index.php?topic=29564.msg168167#msg168167 has good code to switch captcha off when user is logged in. Thanks.

Why would you want to do that??? The phpBB forum found out that spam bots can now, not only Register but login and post spam all in one quick swoop..... The spam bots I'm sure can do that to coppermine as well.....
I would assume....

darktea

Thanks Nibbler for you quick and accurate response.  I feel quite embarrassed about, but because it is the first time I have changed the code I had assumed that was the problem and I guess I ignore the obvious.  It is all working perfectly now.

Quinttindew

Fatal error: main() [function.require]: Failed opening required 'include/turing.class.php' (include_path='.:/usr/local/lib/php') in /home/admin/domains/movishon.com/public_html/platinum/album/include/init.inc.php on line 195

Hi
I get this Error by init.inc.php  , what can i do

faith fully

Q

Abbas Ali

This mod does not uses any file named turing.class.php Perhaps you posted on the wrong thread.
Chief Geek at Ranium Systems

Sosha

Hi, i successfully installed this mod to my gallery a few weeks back, but all of a sudden it has stopped working and doesn't show (or red x's) the captcha image. Ive just double checked all my files to make sure there's nothing missing or has been reset to default and i cant find anything wrong.
However my site is hosted with hosting-unlimited who are notorious on these boards it seems

the gallery is at http://www.tarannau.com/footballers/gallery/

any help appreciated

Hein Traag

Quote from: Sosha on November 19, 2006, 07:37:55 PM
Hi, i successfully installed this mod to my gallery a few weeks back, but all of a sudden it has stopped working and doesn't show (or red x's) the captcha image. Ive just double checked all my files to make sure there's nothing missing or has been reset to default and i cant find anything wrong.
However my site is hosted with hosting-unlimited who are notorious on these boards it seems

the gallery is at http://www.tarannau.com/footballers/gallery/

any help appreciated

You might want to try this plugin http://forum.coppermine-gallery.net/index.php?topic=36319.0. It's based on this mod and does not involved editing files yourself.

Cheers!
Hein

Sosha

Ok well I installed the plugin and it seemed to work but just like with the mod the captcha image red x'd out

Is there some sort of server mis-configuration that I can bitch to my hosts about?

Hein Traag

Quote from: Sosha on November 20, 2006, 08:48:58 PM
Ok well I installed the plugin and it seemed to work but just like with the mod the captcha image red x'd out

Is there some sort of server mis-configuration that I can bitch to my hosts about?

Search the whole thread of that plugin i mentioned. In there is the solution to your problem iirc.

Cheers!
Hein

Abbas Ali

And for support on that plugin, please post your issue on that thread.
Chief Geek at Ranium Systems