Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2] 3 4 5

Author Topic: [MOD] Comment box anti spammers v.0.1 (sNews 1.4)  (Read 43149 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #15 on: May 08, 2006, 07:23:47 AM »

;)
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

David

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 7
  • Posts: 580
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #16 on: May 08, 2006, 10:30:32 PM »

Bram, thanks for this mod! I installed it on my site and it works nicely! :)
Logged

ketut

  • Full Member
  • ***
  • Karma: 0
  • Posts: 115
    • Book Bali Hotels
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #17 on: May 09, 2006, 07:06:34 AM »

Nice work, I will apply to my snews site :))
Thanks

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #18 on: May 10, 2006, 07:43:17 AM »

Hey, born4trance... I welcome you first of all to the forum. Hope you'll have a nice stay, and that you keep coming back...We're having a nice time here ;)...

As for SPAM protection, and CAPTCHA's in particular. There might be, or definitivly will come something that will defeat that, but for now it's (in my head, and I don't know much, hehe) the only real shield against SPAM-bots... Live SPAMMERS is harder to protect oneself from, eh ?. I have had CAPTCHA's on my GB for about a year now, I think... and I haven't got one single SPAM post. So, something's good about it still. But then again, there are different versions of CAPTCHA's and some might be easier to crack than others. Hopefully Bram's solution is foolproof ;).

I also await the perfect solution, to this and many other things...But I'm not holding my breath, hehe... I don't look good in blue.

Patric.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

gomisan

  • Full Member
  • ***
  • Karma: 0
  • Posts: 194
    • http://fish-cam.net/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #19 on: May 18, 2006, 06:30:48 AM »

Could mods like this perhaps be made into Stickies? It's REALLY useful, feature complete, and no bugs have been posted by users so it deserves to be heralded.
Logged
Check out my sNews powered Tropical Fishtank site, live Fish-Cam !!

gomisan

  • Full Member
  • ***
  • Karma: 0
  • Posts: 194
    • http://fish-cam.net/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #20 on: May 18, 2006, 08:02:42 AM »

I've just been givingthis a test out on my website and a clients, and I noticed that all the emails come from 'Nobody'.

How do I set a default 'from' address so they look like they've actually come from my domain?
Logged
Check out my sNews powered Tropical Fishtank site, live Fish-Cam !!

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #21 on: May 18, 2006, 09:07:37 AM »

Ehh, "from" adress I don't know. But in order to get to see what website/domain it's coming from, change the setting in the snews.php where it says something bout "Contact form" to...I don't know "From fish-cam.net" or something.

Patric.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

gomisan

  • Full Member
  • ***
  • Karma: 0
  • Posts: 194
    • http://fish-cam.net/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #22 on: May 18, 2006, 09:20:30 AM »

yeah, doen that, that helps, because you can watch for the subject line in your incoming email, but the actual 'From' address still shows as 'Nobody" for me.

actually .. it shows as nobody@myhostservicedomain.com

ALSO....

how do I make the 'Website' field non-required? not everyone is going to want to submit a web url when they fill in a contact form. I'm guessing it's easy, but I'd prefer to be shown the right way rather than 'guess' and remove soemthing I shouldn't. :)

Still not overly confident with unguided editing of PHP :)
Logged
Check out my sNews powered Tropical Fishtank site, live Fish-Cam !!

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #23 on: May 18, 2006, 09:38:03 AM »

I know there is, atleast when using plain HTML, so there must be do-able in PHP aswell. Means altering the snews.php though and I'm not sure on how to achieve this...

We'll have to wait for the Guru's to see this post.

Patric.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

brauck

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 18
  • Posts: 572
    • http://www.hbw-webdesign.nl/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #24 on: May 18, 2006, 01:05:39 PM »

find the function contact() in snews.php

find these lines:


:




comment these lines out with

and you are done. The url-field will stay blank. Piece of cake :)
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

bramsyuur

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 23
  • Posts: 900
    • http://snews.vietbee.net
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #25 on: May 18, 2006, 09:29:44 PM »

For preventing 'nobody' email try to add this into your contact function:
locate this line:
Code: [Select]
if (isset($_POST['contactform'])) {and next to it, add this:
Code: [Select]
       $headers = "From: " . strtolower($_POST['email']) . "\r\n" .
       'X-Mailer: PHP/' . phpversion() . "\r\n" .
       "Return-Path: " . s('website_email') . "\r\n";
next, locate this line:
Code: [Select]
mail($to, $subject, $body);and modify like this:
Code: [Select]
mail($to, $subject, $body, $headers);With this modification you can send email with the email assigned to your snews preferences and it's added a Return-Path sender address, with this moddification, your email don't be considered as anonymous and, too, not spam by others. :)
Thanks,
bram.

Quote from: gomisan
yeah, doen that, that helps, because you can watch for the subject line in your incoming email, but the actual 'From' address still shows as 'Nobody" for me.
actually .. it shows as nobody@myhostservicedomain.com
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Español

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1746
    • http://www.snewscms.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #26 on: May 18, 2006, 09:42:17 PM »

I use this one:

Code: [Select]
// CONTACT FORM
function contact() {
if ($_POST['contactform'] == "") {?>



*







*


 


     



  if (isset($_POST['contactform'])) {
$to = s('website_email');
$subject = s('contact_subject');
$body = $_POST['name']. ", " .$_POST['weblink']. "\n\n" .$_POST['message']. "\n";
$from_header = "From: " . strtolower($_POST['email']);
if (strlen(clean($_POST['name'])) > 1 AND strlen(clean($_POST['message'])) > 1) {
mail($to, $subject, $body, $from_header);
echo "

". l('contact_sent') ."

";
  echo "

". l('backhome') ."

";
} else {
echo "

". l('contact_not_sent') ."

";
echo "

". l('message_error') ."

";
echo "

". l('backhome') ."

";
}}}
Logged

bramsyuur

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 23
  • Posts: 900
    • http://snews.vietbee.net
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #27 on: May 18, 2006, 09:59:45 PM »

@Luka,
Thanks, my bad... the 'From:' header need to be the person that contat to me... :D
I'll modify my post...
Sorry... ;)
bram.
(really, I need to sleep a bit! :D)
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Español

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #28 on: June 05, 2006, 06:02:53 PM »

Just hunted through my site for errors and not validated code, and found this:

http://validator.w3.org/check?uri=http%3A%2F%2Fp-ahlqvist.com%2Fhome%2Fsnews_designs%2F

That is one of the pages I have the SPAM protection on. Is this fixed in the 1.5 version or should we start to look at it ??

Patric.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

bramsyuur

  • sNews Dude
  • Hero Member
  • *****
  • Karma: 23
  • Posts: 900
    • http://snews.vietbee.net
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #29 on: June 06, 2006, 01:49:02 AM »

I've edited my first post with moddified code and, now, the code validates correctly.
Thanks,
bram.
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Español
Pages: 1 [2] 3 4 5