| View previous topic :: View next topic |
| Author |
Message |
josephk
Joined: 07 Nov 2005 Posts: 2
|
Posted: Mon Nov 07, 2005 10:58 pm Post subject: |
|
|
Thanx Carbon!!!!
All seems ok!!!
You're Great!
JK |
|
| Back to top |
|
 |
grelli
Joined: 16 Nov 2005 Posts: 3
|
Posted: Wed Nov 16, 2005 4:51 pm Post subject: Random verification text! |
|
|
For those who want to have a random verification text, I made some addtions to the MOD which enables this!
BEFORE MAKING ANY CHANGES, TAKE BACKUP OF ALL THE FILES THAT WILL BE EDITED!
Follow the changes in the original MOD and then follow the following instructions::
Open lang/English.php (or the language file that you are using)
Find
| Code: |
$months[11] = "December";
|
After Add
| Code: |
# BotTest
$randomText = array("ARMADILLA","GUESTBOOK","VERIFICATION","HUMAN","APACHE","PROXY2");
$index = rand(0,count($randomText)-1);
$LANG["randomText"] = $randomText[$index]; |
You can of course choose any words you like for the verification and also add more than 6 of them.
Save and close the file.
Open lib/add.class.php
Find
| Code: |
| var $bottestanswer = 'armadillo'; /* this is the answer to the question. It must contain no ' */ |
Replace that with
| Code: |
| var $randomText = ''; |
Find next
| Code: |
| $this->bottestanswer = addslashes($this->bottestanswer); |
Replace that with
| Code: |
| $this->randomText = addslashes($this->randomText); |
Find next
| Code: |
| } elseif (strtolower($this->bottest) != strtolower($this->bottestanswer)) { |
Replace that with
| Code: |
| } elseif (strtolower($this->bottest) != strtolower($this->randomText)) { |
Find next
| Code: |
| $HIDDEN .= "<input type=\"hidden\" name=\"bottest\" value=\"".$this->bottest."\">\n"; |
After Add
| Code: |
| $HIDDEN .= "<input type=\"hidden\" name=\"randomText\" value=\"".$this->randomText."\">\n"; |
Save and close the file.
Open addentry.php
Find
| Code: |
| $gb_post->bottest = (isset($HTTP_POST_VARS["bottest"])) ? $HTTP_POST_VARS["bottest"] : ''; |
After Add
| Code: |
| $gb_post->randomText = (isset($HTTP_POST_VARS["randomText"])) ? $HTTP_POST_VARS["randomText"] : ''; |
Save and close the file.
Open templates/form.php
Find
| Code: |
| <td class="font2">To prove you are not a bot please type the word ARMADILLO into the box below.<br> |
Replace that with
| Code: |
| <td class="font2">To prove you are not a bot please type the word <SCRIPT LANGUAGE="JavaScript">document.write("$LANG[randomText]")</SCRIPT> into the box below.<br> |
Find
| Code: |
| <input type="text" size="42" maxlength="30" name="bottest"></td> |
Replace that with
| Code: |
<input type="text" size="42" maxlength="30" name="bottest">
<input type="hidden" name="randomText" value="$LANG[randomText]"></td> |
Save and close the file.
Thats all!
These changes worked for me on my 2.3.1 Advanced Guestbook! I will NOT offer any support concerning this addition to the MOD, I just don't have time! So if you have problems with these changes, you are on your own!
/Grelli.
Last edited by grelli on Thu Dec 08, 2005 2:19 pm; edited 1 time in total |
|
| Back to top |
|
 |
Carbonize

Joined: 12 Jun 2003 Posts: 3961 Location: Bristol, UK
|
Posted: Wed Nov 16, 2005 5:20 pm Post subject: |
|
|
your last instruction would end up with there being two input boxes for the anti bot test. _________________ Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
| Back to top |
|
 |
grelli
Joined: 16 Nov 2005 Posts: 3
|
Posted: Wed Nov 16, 2005 5:55 pm Post subject: |
|
|
| Carbonize wrote: |
| your last instruction would end up with there being two input boxes for the anti bot test. |
Thats not true
The second input field...
| Code: |
| <input type="hidden" name="randomText" value="$LANG[randomText]"> |
...is a hidden field and its only purpose is to transfer the random text that was generated to the next step of the posting process to be able to compare it to the text that the user inputs!
/Grelli. |
|
| Back to top |
|
 |
Carbonize

Joined: 12 Jun 2003 Posts: 3961 Location: Bristol, UK
|
Posted: Wed Nov 16, 2005 5:59 pm Post subject: |
|
|
Yeah sorry was speed reading. Nasty habit of mine. Just to make it clear to people that this mod only works if you use the "Type this word into the box below" type of test as opposed to an actual question such as "What colour is the sky". _________________ Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
| Back to top |
|
 |
imhungry
Joined: 18 Nov 2005 Posts: 1
|
Posted: Fri Nov 18, 2005 3:30 am Post subject: |
|
|
hey there, this is an awesome script, im having a smallish problem though, just like someone else did earlyer - i can write whatever i want in the verification box, and it lets me post. checked the code over but i it all seems ok, not sure what ive done wrong, heres a link
http://dj-triquatra.com/guestbook |
|
| Back to top |
|
 |
Carbonize

Joined: 12 Jun 2003 Posts: 3961 Location: Bristol, UK
|
Posted: Fri Nov 18, 2005 6:38 am Post subject: |
|
|
1 - update to 2.3.4 by downloading the full package from this site and replacing all but the config.inc.php file. This patches a couple of exploits. It does mean you will have to edit the templates again though.
2 - I believe the error lies in either addentry.php or add.class.php. Goto www.carbonize.co.uk/AG and have a look at the pre modded files I put there. _________________ Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
| Back to top |
|
 |
testar81
Joined: 22 Oct 2004 Posts: 33
|
Posted: Mon Nov 28, 2005 2:05 pm Post subject: |
|
|
I have downloaded the file to make the changes to my guestbook but now i get an error when i should write messages, it says that i havent write anything in the name filed though i have done that what should i do?
I forgot to take backup of the old files.
Plese help. _________________ Nordiva. |
|
| Back to top |
|
 |
Carbonize

Joined: 12 Jun 2003 Posts: 3961 Location: Bristol, UK
|
Posted: Mon Nov 28, 2005 3:56 pm Post subject: |
|
|
| testar81 wrote: |
I have downloaded the file to make the changes to my guestbook but now i get an error when i should write messages, it says that i havent write anything in the name filed though i have done that what should i do?
I forgot to take backup of the old files.
Plese help. |
You using 2.3.4 ? _________________ Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
| Back to top |
|
 |
mabrychis
Joined: 28 Nov 2005 Posts: 5
|
Posted: Mon Nov 28, 2005 10:22 pm Post subject: |
|
|
I am using version 2.3.1 and tried using the revised code provided here and of course I have done something wrong somewhere I just don't know where! This is the error I am getting only when you click sign the guestbook:
Parse error: parse error, unexpected T_ELSEIF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/jmn1888/public_html/guestbook/lib/add.class.php on line 202
Can I just use the already provided files and upload them? I wasn't sure as it says its for a different version and I didnt know if that would conflict with my current version. Would be much easier
So, here is the link:
http://www.mabrychihuahuas.com/guestbook/index.php
Click sign the guestbook and that is where the error message comes in. Please help! Also, I took no backups of the files, now I am sorry. |
|
| Back to top |
|
 |
JTD

Joined: 08 May 2004 Posts: 529 Location: Arkansas
|
|
| Back to top |
|
 |
mabrychis
Joined: 28 Nov 2005 Posts: 5
|
Posted: Tue Nov 29, 2005 2:22 am Post subject: |
|
|
Thank you, it appears to have worked  |
|
| Back to top |
|
 |
rvargas
Joined: 08 Dec 2005 Posts: 1 Location: Los Angeles, CA
|
Posted: Thu Dec 08, 2005 3:45 am Post subject: error |
|
|
Hi,
I follow the instructions step by step, and I seem to have problems.
when I try to add a new entry on the guest book I get the error that I need to type the word for the human verification,
I tried to change the word and it did not work,
I went through my code several times and I could not find the error.
could you please give me a hand on where I messed up.
Thank you
I'm using version 2.31 |
|
| Back to top |
|
 |
Carbonize

Joined: 12 Jun 2003 Posts: 3961 Location: Bristol, UK
|
Posted: Thu Dec 08, 2005 10:26 am Post subject: |
|
|
Sounds like you messed up something. You really should update to 2.3.4 but anyway you can get the premodded files from www.carbonize.co.uk/AG _________________ Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
| Back to top |
|
 |
grelli
Joined: 16 Nov 2005 Posts: 3
|
Posted: Thu Dec 08, 2005 2:23 pm Post subject: |
|
|
EDIT to the random verification text MOD:
Open lang/English.php (or the language file that you are using)
Find
| Code: |
$months[11] = "December";
|
After Add
| Code: |
# BotTest
$randomText = array("ARMADILLA","GUESTBOOK","VERIFICATION","HUMAN","APACHE","PROXY2");
$index = rand(0,count($randomText)-1);
$LANG["randomText"] = $randomText[$index]; |
You can of course choose any words you like for the verification and also add more than 6 of them.
Save and close the file.
The change is "count($randomText)-1)", this needs to be done to prevent the index to be OutOfBounds when choosing the random index.
/Grelli.
P.s. This has been changed in the instructions in the previous post! |
|
| Back to top |
|
 |
|