Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 ... 3 4 [5]

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

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #60 on: December 03, 2006, 04:09:08 PM »

Thanks Mika! ;)
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #61 on: December 03, 2006, 04:10:58 PM »

Thanks Mika!

Ups, echo...

You're welcome, girls :D
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

brauck

  • Hero Member
  • *****
  • Karma: 18
  • Posts: 556
    • http://www.hbw-webdesign.nl/
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #62 on: December 03, 2006, 08:41:19 PM »

:D
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

mrOctagon

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
[MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #63 on: May 12, 2007, 01:17:52 PM »

Quote from: Mika
[MOD] Comments and Contact box anti spammers for sNews v1.5

- most of the steps are the same as in bram's first post:
- add two new files audit.php and button.php into your snews installation folder
- create two new language variables
- edit index.php file according to his notes

Changes to sNews 1.5:
- add these blue parts to the snews.php 1.5

contact()
Quote
function contact() {
   if ($_POST['contactform'] == '') {
      echo '

'.l('contact').'

';
      html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', db('website'), '');
      html_input('text', 'name', 'name', '', '* '.l('name'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'email', 'email', '', '* '.l('email'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'weblink', 'weblink', '', l('url'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('textarea', 'message', 'message', '', '* '.l('message'), '', '', '', '', '', '5', '5', '', '', '');
      echo '

'.l('code_validation').'
'.l('code_validation').'

';
      html_input('text', 'userdigit', 'userdigit', '', l('enter_validation_code'), 'text', '', '', '', '', '', '', '', '', '');

      echo '

';
      html_input('hidden', 'ip', 'ip', $_SERVER['REMOTE_ADDR'], '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'time', 'time', time(), '', '', '', '', '', '', '', '', '', '', '');
      html_input('submit', 'contactform', 'contactform', l('submit'), '', '', '', '', '', '', '', '', '', '', '');
      echo '

';
   }
   if (audit() && isset($_POST['contactform']) && $_POST['ip'] == $_SERVER['REMOTE_ADDR'] && (time() - $_POST['time']) > 5) {
...
comment()
Quote
function comment($freeze_status) {
...
...
if (audit() && $_POST['ip'] == $_SERVER['REMOTE_ADDR'] && (time() - $_POST['time']) > 4 && strlen($comment) >= 5 && strlen($name) >= 2 && is_numeric($_POST['id'])) {
...
...
if ($freeze_status != 'freezed') {
      echo '

'.l('addcomment').'

';
      html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', db('website'), '');
      html_input('text', 'name', 'name', '', '* '.l('name'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('text', 'url', 'url', '', l('url'), 'text', '', '', '', '', '', '', '', '', '');
      html_input('textarea', 'text', 'text', '', '* '.l('comment'), '', '', '', '', '', '5', '5', '', '', '');
      echo '

'.l('code_validation').'
'.l('code_validation').'

';
      html_input('text', 'userdigit', 'userdigit', '', l('enter_validation_code'), 'text', '', '', '', '', '', '', '', '', '');

      echo '

';
      html_input('hidden', 'category', 'category', $categorySEF, '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'id', 'id', $articleId, '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'article', 'article', $articleSEF, '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'commentspage', 'commentspage', $back_to_page, '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'ip', 'ip', $_SERVER['REMOTE_ADDR'], '', '', '', '', '', '', '', '', '', '', '');
      html_input('hidden', 'time', 'time', time(), '', '', '', '', '', '', '', '', '', '', '');
      html_input('submit', 'comment', 'comment', l('submit'), '', '', '', '', '', '', '', '', '', '', '');
      echo '

';
...
For snews 1.5.31 i dont know where to put this code:
if (audit() && isset($_POST['contactform']) && $_POST['ip'] == $_SERVER['REMOTE_ADDR'] && (time() - $_POST['time']) > 5) {
Logged

gesa

  • Guest
Re: [MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #64 on: September 28, 2007, 10:06:18 PM »

Oh, the original code seems to be broken.

Can anyone please repost the code?
Logged

gesa

  • Guest
Re: [MOD] Comment box anti spammers v.0.1 (sNews 1.4)
« Reply #65 on: September 28, 2007, 10:36:23 PM »

Bakercad, you saved my day!

Thank you!

It works!  :o
Logged
Pages: 1 ... 3 4 [5]