Recent Topics

1 Jun 14, 2008 21:58    

My b2evolution Version: 2.4.2

Today I realized that all my posts had a day ahead date: if I posted today, june 14 at 3:00 pm, the date would appear june 15 at 3:00pm

I checked the Regional settings and I remembered that I once tried to match the servers time with my countries actual time and I put 23:30 hours of difference from server time as the only way to match the hour, I didn't realize I would be changing the date too :oops:

When the server's time is 2:00 PM, my country's local time is 1:30 PM, to make it match, I'm supposed to change the Regionals time difference to -0:30, but that doesn't work. How can I make that change?

But as the title of this post says, I was getting this error when matching the server's hour to mine (I changed to 0 the time difference). From there on I've had more than 3000 visitors online at any given time and when trying to make a comment i get the error:

You can only post a new comment every 30 seconds

I had to change the value in comment_post.php:

{
	/*
	 * Flood-protection
	 * NOTE: devs can override the flood protection delay in /conf/_overrides_TEST.php
	 * TODO: Put time check into query?
	 * TODO: move that as far !!UP!! as possible! We want to waste minimum resources on Floods
	 * TODO: have several thresholds. For example:
	 * 1 comment max every 30 sec + 5 comments max every 10 minutes + 15 comments max every 24 hours
	 * TODO: factorize with trackback
	 */
	$query = 'SELECT MAX(comment_date)
							FROM T_comments
						 WHERE comment_author_IP = '.$DB->quote($Hit->IP).'
								OR comment_author_email = '.$DB->quote($Comment->get_author_email());
	$ok = 1;
	if( $then = $DB->get_var( $query ) )
	{
		$time_lastcomment = mysql2date("U",$then);
		$time_newcomment = mysql2date("U",$now);
		if( ($time_newcomment - $time_lastcomment) < $minimum_comment_interval )
			$ok = 1;
	}
	if( !$ok )
	{
		$Messages->add( sprintf( T_('You can only post a new comment every %d seconds.'), $minimum_comment_interval ), 'error' );
	}
	/* end flood-protection */
}

I changed the value from 0 to 1 in this part:


{
		$time_lastcomment = mysql2date("U",$then);
		$time_newcomment = mysql2date("U",$now);
		if( ($time_newcomment - $time_lastcomment) < $minimum_comment_interval )
			$ok = 1;
	}

Now it works but I guess I disabled flood protection, right?

How can I mend all this mess?


Form is loading...