Most Simple Comment Spam protection for 1.4.x Most Simple Comment Spam protection for 1.4.x
 

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

Most Simple Comment Spam protection for 1.4.x

Started by pinpoint222, September 14, 2006, 06:24:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pinpoint222

Please read this before you look at rest of the thread

For the First Time readers especially. This Mod/hack has reached a version 1.0 (release date Nov. 11 , 2006). I am attaching the Zipped Folder with this Starting Post. It has all the Instructions, files required and explanations in it. This will save you lots of time and you do not have to read the discussion till the date 10th July, 2007. For discussion/issues post in the thread

The Contents of Zipped Folder are
It contains
1-- Most Simple Comment Spam protection for 1.doc   (MS WORD version Manual)
2-- Most Simple Comment Spam protection.pdf (pdf version Manual)
3-- done.php file
4-- capimage.jpg  File
5-- db_input2.php File ( its is a copy of original db_input.php file. It is renamed to db_input2.php and 3 extra code lines have been added to it)
5-- db_input.php File ( it is the original db_input.php file + 3 extra code lines have been added to it)


Features:

•   This is a CAPTCHA Alternative which is independent of your hosting server setting.
•   It is very simple and only 3 lines are added to the db_input.php file.No other core file is modified.
•   If you want to disable this Hack, simply remove those 3 Lines added to db_input2.php.
•   Other functions of coppermine gallery are not affected.
•   No server side font Support is required.
•   You can create your own image with code written on it and use with this Mod.
•   No server side dynamic image generation support is required.
•   It takes hardly 5-10 minutes to make this work properly.
•   It easy to add and easy to remove and works 100% on any server.
•   Special Thanks to all people who gave the feedback on the mod thread.

Read the instruction in doc Or PDF..and apply the Mod properly. Incase you need help post in this thread



pinpoint222

#1
Read the FIRST POST. Version 1.0 has been released .( dated Nov. 11 , 2006)

You do not need filesneeded02.zip now,so do not download filesneeded02.zip.


tomeq11

Hello pinpoint222

Really good idea, it works good... but....

...I have one problem - this protection also works when I add a new album and I want to write a description of this album (in album properties visible only in admin mode) and there's no field to write this code. Please help

pinpoint222

HI
thank you for contacting..

This HACK/MOD is for comment system. You want to apply this hack for New albums etc.  Applying it for other new albums etc will require new Thread. I am replying to your answer here.

http://forum.coppermine-gallery.net/index.php?topic=37752.0



Please discuss one topic per thread.

newkai

Note: This does apply to this hack, as installation of this hack affects the ability to edit album's properties. In other words, this is a bug report!

What tomeq11 asked, and I'm having the same problem...

Your hack messes up the ability to change album info! When I try to change my album properties, I get the comments error page!

When I edit an album's properties and click "Update Album", I get "Comments Could not be added. Redirecting. Please wait..."

So what we're asking is if you could modify your hack so it doesn't get rid of our ability to edit our albums!  :)

Your hack works great to prevent spam though!

Thanks,

Kai

pinpoint222

#5
This step was dropped. Read the First Post of the Thread. All files and explanations written in that post now

pinpoint222

Oh Please do Not apply the changes i mentioned in my last post

I have made a working tested solution . IT IS CORE HACK FREE Solution. NO More messing with db_input.php file at All.

Here is what you have to do..

1-- Simply make a copy of db_input.php file and name it as db_input2.php. Keep both files in the same folder.

2- Open db_input.php and remove these 3 lines u added before.

Quote
if ($_POST['thenum'] != '6B38'){
header('Location: done.php');
die();
}

Now db_input.php is back to its original form.

3- Now IN the theme.php file find this line
Quote<form method="post" name="post" action="db_input.php">

and now it to

Quote<form method="post" name="post" action="db_input2.php">


Thats it.i have tested it..so it is Working and Now my hack does not involve db_input.php file at all. All the changes will be done in db_input2.php file. SO CORE FILES are NOT CHANGED at all.

The file db_input2.php which we created will be used Only to add comments.

So here is the Summary of this MOD Now for everyone

1-- Change Theme.php as described in the start of this thread
2-- Make a copy of original db_input.php file and name it db_input2.php
3-- Add the 3 LINES to db_input2.php file.
4-- Keep both db_input.php and db_input.php in the same folder
5-- Upload the image and done.php as described at the start of the thread.
6- All check .tested and go.
7-- The end


I think there should be no problem now. if it works or it it doesnt post please

Thanks




newkai

Hmmm, it is now allowing me to post comments no matter what code I put in!

I can edit my photo albums again though!

newkai

Oh, maybe it has to do with the fact that I had already added the greendummy line... duh! I'll check that out and report back!

pinpoint222

yes.. all the steps in the dummygreen post are no longer needed now.

newkai


ceesjoore

I use your spam protection and it looks good.
There is only one thing, why do i have now 2 white squares up and below the "OK" button ?

Thanks

ceesjoore

Quote from: ceesjoore on November 05, 2006, 12:41:05 PM
I use your spam protection and it looks good.
There is only one thing, why do i have now 2 white squares up and below the "OK" button ?

Thanks


Sorry here is the link http://www.ceesjoore.nl/coppermine/displayimage.php?album=lastup&cat=-32&pos=0

pinpoint222

Quote
I use your spam protection and it looks good.
There is only one thing, why do i have now 2 white squares up and below the "OK" button ?

Thanks

Sorry here is the link http://www.ceesjoore.nl/coppermine/displayimage.php?album=lastup&cat=-32&pos=0



Re:

Thats related to template... try this fix

find these lines

Quote
<td align="left">
                                <input type="hidden" name="event" value="comment" />
                                <input type="hidden" name="pid" value="194" />
                                <input type="submit" class="comment_button" name="submit" value="OK" />
                                </td>


and replace them with this


Quote
<td class="tableb_compact" align="left">
                                <input type="hidden" name="event" value="comment" />
                                <input type="hidden" name="pid" value="194" />
                                <input type="submit" class="comment_button" name="submit" value="OK" />
                                </td>



it should work ..let me know..thanks

ceesjoore

Ok that worked fine.
Is there also a way to change the size of the fonts, because they are bigger now and not on one line ?

Thanks

pinpoint222

..Yes ofcos.

font size color etc are controlled by "Class" (CSS) files... in this hack i used "class=tableb_compact"..u can replace it whatever class u like...

For ur website..

find this
Quote<td class="tableb_compact" align="left">

and change it to

Quote<td class="tableh2_compact" align="left">

it will fix the size n color.hope it helps.

ceesjoore

Quote from: pinpoint222 on November 05, 2006, 03:45:59 PM
..Yes ofcos.

font size color etc are controlled by "Class" (CSS) files... in this hack i used "class=tableb_compact"..u can replace it whatever class u like...

For ur website..

find this
and change it to

it will fix the size n color.hope it helps.

The fonts stay the same size with this fix, they change when i change the font size in the menu bar from explorer bij view.
All the other fonts stay the same size only the one added with the captcha hack are react on the exporer option. :-\
example   http://www.ceesjoore.nl/coppermine/displayimage.php?album=32&pos=1

ceesjoore

Quote from: ceesjoore on November 05, 2006, 05:52:24 PM
The fonts stay the same size with this fix, they change when i change the font size in the menu bar from explorer bij view.
All the other fonts stay the same size only the one added with the captcha hack are react on the exporer option. :-\
example   http://www.ceesjoore.nl/coppermine/displayimage.php?album=32&pos=1

I have removed the text behind the box and now it looks good.

Thanks for helping

pinpoint222

No. To make font size permanent and not changing u need simply open theme.php find this

Quote<!-- BEGIN CAPTCHA Image -->
<tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

        <tr bgcolor="#FFFFFF">
          <td class="tableb_compact" align="right"><font size="2" face="Verdana, Arial, Helvetica,

sans-serif"><b>Enter this  Code <img src="http://www.yoursite.com/CPG/Themes/classic/images/capimage.jpg"> in the

Box</b></font></td>
          <td class="tableb_compact" align="left">         
                <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
            <input name="thenum" type="text" id="checkit" > Type Four Letter Code
           </font></td>

                                <td align="left">
                                <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>

</table>
               </td>
        </tr>

<!-- END CAPTCHA Image -->



Then remove this line ( it comes twice)

Quote<font size="2" face="Verdana, Arial, Helvetica, sans-serif">

And now ur font size wont change even if u use explorer.

ceesjoore

@pinpoint222 

Ok now it looks good all text in one line now  :D

Thanks for helping me out.