PROBLEM!!!

Wszystko co tyczy się sprzętu audio. Od Hi-fi po High-end. Wasze doświadczenia, problemy oraz testy.

Moderator: mods

PROBLEM!!!

Postautor: Hetman » marca 28, 2006, 8:37 pm

Witam Wszystkich,
Ot?? mamy taki problem;
Jak si? pozby? niechcianych wpis?w w ksi?dze go?ci.? Codziennie od ponad miesi?ca kasuje ich oko?o 10. Wpisy zawieraj? linki zach?caj?ce do zakupu viagry itd. Kto? si? zawzi?? i chyba nie bardzo chce odpu?ci?. My?la?em da sobie spok?j, ale nic z tego. Wiem, ?e korzysta za ka?dym razem z innego IP co jest pono? wa?n? informacj? ( niekoniecznie dla mnie).Czy kto? z forum mo?e co? na to zaradzi???
Pozdrawiam
S?awek
Awatar użytkownika
Hetman
bluesmaniak
bluesmaniak
 
Posty: 107
Rejestracja: września 21, 2004, 8:39 pm
Lokalizacja: Legnica

Postautor: ewick » marca 28, 2006, 9:14 pm

Cze??, poszpera?am na forum dotycz?cym ksi?gi go?ci, kt?r? macie na stronce i znalaz?am tak? modyfikacj? kodu ksi?gi...

Link do tematu:
http://proxy2.de/forum/viewtopic.php?t=4678

Czy? nie pi?knie to wygl?da ? ? ? Oczywi?cie temat dla webmastera waszej strony :twisted:

Ok after numerous requests I have decided to write this mod to let you add a test to make sure the poster is human. It's not infallible and will not stop human posters from spamming. If you don't fancy trying to edit the files yourself you can find them pre edited at http://carbonize.co.uk/AG/

For Advanced Guestbook 2.3.1 and 2.3.2 (instructions for 2.2 are after)
For 2.3.3 and 2.3.4 follow 2.3.2

there was a small cock up above. In add.class.php it should be
var $bottest = '';
and not
var bottest = '';



Open templates/form.php

Find
Code:
if(document.book.gb_comment.value == "") {


replace that with
Code:
if(document.book.bottest.value == "") {
alert("$LANG[ErrorPost12]");
document.book.bottest.focus();
return false;
}
if(document.book.gb_comment.value == "") {


next find
Code:
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%"><div align="left" class="font2">$HTML_CODE<br>$SMILE_CODE<br>$AG_CODE</div></td>
<td>


Replace that with
Code:
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%" class="font2"><img src="$GB_PG[base_url]/img/user.gif" width="16" height="15" alt=""> Human Verification:</td>
<td class="font2">To prove you are not a bot please type the word ARMADILLO into the box below.<br>
<input type="text" size="42" maxlength="30" name="bottest"></td>
</tr>
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%"><div align="left" class="font2">$HTML_CODE<br>$SMILE_CODE<br>$AG_CODE</div></td>
<td>


Remember to change the question to make it unique to your site.

Save and close the file

Now open addentry.php UNLESS you are using the guestbook as a module in PHP Nuke in which case make these changes to index.php

For 2.3.1 find
Code:
$gb_post->name = (isset($HTTP_POST_VARS["gb_name"])) ? $HTTP_POST_VARS["gb_name"] : '';


replace with
Code:
$gb_post->bottest = (isset($HTTP_POST_VARS["bottest"])) ? $HTTP_POST_VARS["bottest"] : '';
$gb_post->name = (isset($HTTP_POST_VARS["gb_name"])) ? $HTTP_POST_VARS["gb_name"] : '';


For 2.3.2 find
Code:
$gb_post->name = (isset($_POST["gb_name"])) ? $_POST["gb_name"] : '';


replace with
Code:
$gb_post->bottest = (isset($_POST["bottest"])) ? $_POST["bottest"] : '';
$gb_post->name = (isset($_POST["gb_name"])) ? $_POST["gb_name"] : '';


Save and close the file.

Now open lib/add.class.php and find
Code:
var $name = '';


replace that with
Code:
var $name = '';
var $bottest = '';
var $bottestanswer = 'armadillo'; /* this is the answer to the question. It must contain no ' */


Next find
Code:
if ($this->name == "") {


and replace that with
Code:
if (!get_magic_quotes_gpc())
{
$this->bottest = addslashes($this->bottest);
$this->bottestanswer = addslashes($this->bottestanswer);
}
if ($this->name == "") {


Now find
Code:
} else {
$this->url = trim($this->url);


Replace with
Code:
} elseif ($this->bottest == '') {
return $this->db->gb_error($this->db->LANG["ErrorPost12"]);
} elseif (strtolower($this->bottest) != strtolower($this->bottestanswer)) {
return $this->db->gb_error($this->db->LANG["ErrorPost13"]);
} else {
$this->url = trim($this->url);


Next find
Code:
$HIDDEN .= "<input type=\"hidden\" name=\"gb_name\" value=\"".$this->name."\">\n";


and replace it with
Code:
$HIDDEN .= "<input type=\"hidden\" name=\"gb_name\" value=\"".$this->name."\">\n";
$HIDDEN .= "<input type=\"hidden\" name=\"bottest\" value=\"".$this->bottest."\">\n";


Save and close the file.

Finally open lang/english.php (If your guestbook is not in English open the appropriate language file and change the messages into your own language.

Find
Code:
$LANG["ErrorPost11"] = "You forgot to fill in the Comment field. Please correct it and re-submit.";


and replace it with
Code:
$LANG["ErrorPost11"] = "You forgot to fill in the Comment field. Please correct it and re-submit.";
$LANG["ErrorPost12"] = "You forgot to fill in the Human Verification field. Please correct it and re-submit.";
$LANG["ErrorPost13"] = "The Human verification answer you supplied is wrong. Please correct it and re-submit.";


Save and close the file and you are done.

INSTRUCTIONS FOR 2.2

Open templates/form.php

Find
Code:
if(document.book.comment.value == "") {


replace that with
Code:
if(document.book.bottest.value == "") {
alert("$LANG[ErrorPost12]");
document.book.bottest.focus();
return false;
}
if(document.book.comment.value == "") {


next find
Code:
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%"><div align="left" class="font2">$HTML_CODE<br>$SMILE_CODE<br>$AG_CODE</div></td>
<td>


Replace that with
Code:
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%" class="font2"><img src="$GB_PG[base_url]/img/user.gif" width="16" height="15" alt=""> Human Verification:</td>
<td class="font2">To prove you are not a bot please type the word ARMADILLO into the box below.<br>
<input type="text" size="42" maxlength="30" name="bottest"></td>
</tr>
<tr bgcolor="$VARS[tb_color_1]">
<td width="25%"><div align="left" class="font2">$HTML_CODE<br>$SMILE_CODE<br>$AG_CODE</div></td>
<td>


Remember to change the question to make it unique to your site.

Save and close the file

Now open addentry.php

find
Code:
$gb_post->name = (isset($HTTP_POST_VARS["name"])) ? $HTTP_POST_VARS["name"] : '';


replace with
Code:
$gb_post->bottest = (isset($HTTP_POST_VARS["bottest"])) ? $HTTP_POST_VARS["bottest"] : '';
$gb_post->name = (isset($HTTP_POST_VARS["name"])) ? $HTTP_POST_VARS["name"] : '';


Save and close the file.

Now open lib/add.class.php and find
Code:
var $name = '';


replace that with
Code:
var $name = '';
var $bottest = '';
var $bottestanswer = 'armadillo'; /* this is the answer to the question. It must contain no ' */


Next find
Code:
if ($this->name == "") {


and replace that with
Code:
if (!get_magic_quotes_gpc())
{
$this->bottest = addslashes($this->bottest);
$this->bottestanswer = addslashes($this->bottestanswer);
}
if ($this->name == "") {


Now find
Code:
} else {
$this->url = trim($this->url);


Replace with
Code:
} elseif ($this->bottest == '') {
return $this->db->gb_error($this->db->LANG["ErrorPost12"]);
} elseif (strtolower($this->bottest) != strtolower($this->bottestanswer)) {
return $this->db->gb_error($this->db->LANG["ErrorPost13"]);
} else {
$this->url = trim($this->url);


Next find
Code:
$HIDDEN .= "<input type=\"hidden\" name=\"name\" value=\"".$this->name."\">\n";


and replace it with
Code:
$HIDDEN .= "<input type=\"hidden\" name=\"name\" value=\"".$this->name."\">\n";
$HIDDEN .= "<input type=\"hidden\" name=\"bottest\" value=\"".$this->bottest."\">\n";


Save and close the file.

Finally open lang/english.php (If your guestbook is not in English open the appropriate language file and change the messages into your own language.

Find
Code:
$LANG["ErrorPost11"] = "You forgot to fill in the Comment field. Please correct it and re-submit.";


and replace it with
Code:
$LANG["ErrorPost11"] = "You forgot to fill in the Comment field. Please correct it and re-submit.";
$LANG["ErrorPost12"] = "You forgot to fill in the Human Verification field. Please correct it and re-submit.";
$LANG["ErrorPost13"] = "The Human verification answer you supplied is wrong. Please correct it and re-submit.";


Save and close the file and you are done.


UWAGA poprawki do tego co powyzej!!!

there was a small cock up above. In add.class.php it should be
var $bottest = '';
and not
var bottest = '';


I integrated the mod in my guestbook this morning, and it works fine. Thanks! Let's hope that it stops the spam.
However, I had to correct a slight mistake in the last change in lib/add.class.php, otherwise the answer would always be empty:

In the following line, the '$' in front of bottestanswer is wrong.
Code:
elseif (strtolower($this->bottest) != strtolower($this->$bottestanswer))


Correct line:
Code:
elseif (strtolower($this->bottest) != strtolower($this->bottestanswer))
Awatar użytkownika
ewick
bluesmaniak
bluesmaniak
 
Posty: 122
Rejestracja: marca 11, 2006, 12:48 pm
Lokalizacja: WaWA, a tak to z Otwocka

Postautor: Hetman » marca 28, 2006, 9:25 pm

[quote="ewick"]Cze??, poszpera?am na forum dotycz?cym ksi?gi go?ci, kt?r? macie na stronce i znalaz?am tak? modyfikacj? kodu ksi?gi...

:shock: :shock: Cze??- Przka?e Webmasterowi :shock:
dzieki
Awatar użytkownika
Hetman
bluesmaniak
bluesmaniak
 
Posty: 107
Rejestracja: września 21, 2004, 8:39 pm
Lokalizacja: Legnica

Postautor: ewick » marca 28, 2006, 9:29 pm

8)
Awatar użytkownika
ewick
bluesmaniak
bluesmaniak
 
Posty: 122
Rejestracja: marca 11, 2006, 12:48 pm
Lokalizacja: WaWA, a tak to z Otwocka

Postautor: wyderko » marca 28, 2006, 10:47 pm

A moim zdaniem najlepiej zastosowa? filtr, kt?ry sprawdza, czy np s? w tre?ci wiadomo?ci s?owa viagra (and) buy i odrzuca wiadomo?
wyderko
bluesman
bluesman
 
Posty: 387
Rejestracja: sierpnia 9, 2005, 6:57 pm

Postautor: Hetman » kwietnia 7, 2006, 8:16 am

Dzi?ki, webmaster zastosowa? si? do Waszych rad i mamy spokuj.
Pozdrawiam
i zapraszam do "wyleczonej" ksi?gi go?ci na www.obstawaprezydenta.pl
S?awek
Awatar użytkownika
Hetman
bluesmaniak
bluesmaniak
 
Posty: 107
Rejestracja: września 21, 2004, 8:39 pm
Lokalizacja: Legnica

Postautor: ewick » kwietnia 7, 2006, 8:29 am

super!!! :)
Awatar użytkownika
ewick
bluesmaniak
bluesmaniak
 
Posty: 122
Rejestracja: marca 11, 2006, 12:48 pm
Lokalizacja: WaWA, a tak to z Otwocka


nowoczesne kuchnie tarnowskie góry piekary śląskie będzin świętochłowice zawiercie knurów mikołów czeladź myszków czerwionka leszczyny lubliniec łaziska górne bieruń

Wróć do Kącik Audiofila

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 224 gości

cron