Changeset 6604
- Timestamp:
- Jun 25, 2010, 9:43:44 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/intro.php
r6363 r6604 127 127 $php_current_timestamp = date("Y-m-d H:i:s"); 128 128 $db_version = pwg_get_db_version(); 129 list($db_current_ timestamp) = pwg_db_fetch_row(pwg_query('SELECT CURRENT_TIMESTAMP;'));129 list($db_current_date) = pwg_db_fetch_row(pwg_query('SELECT now();')); 130 130 131 131 $query = ' … … 216 216 'U_PHPINFO' => PHPWG_ROOT_PATH.'admin.php?action=phpinfo', 217 217 'PHP_DATATIME' => $php_current_timestamp, 218 'DB_DATATIME' => $db_current_ timestamp,218 'DB_DATATIME' => $db_current_date, 219 219 ) 220 220 ); -
trunk/include/dblayer/functions_mysql.inc.php
r6578 r6604 561 561 */ 562 562 563 564 563 function pwg_db_get_recent_period_expression($period, $date='CURRENT_DATE') 565 564 { … … 581 580 } 582 581 582 function pwg_db_get_flood_period_expression($seconds) 583 { 584 return 'SUBDATE(now(), INTERVAL '.$seconds.' SECOND)'; 585 } 586 583 587 function pwg_db_get_hour($date) 584 588 { -
trunk/include/dblayer/functions_pdo-sqlite.inc.php
r6580 r6604 500 500 } 501 501 502 function pwg_db_get_flood_period_expression($seconds) 503 { 504 return 'datetime(\'now\', \'localtime\', \''.-$seconds.' seconds\')'; 505 } 506 502 507 function pwg_db_get_hour($date) 503 508 { -
trunk/include/dblayer/functions_pgsql.inc.php
r6591 r6604 547 547 } 548 548 549 function pwg_db_get_flood_period_expression($seconds) 550 { 551 return 'now() - \''.$seconds.' SECOND\'::interval'; 552 } 553 549 554 function pwg_db_get_hour($date) 550 555 { -
trunk/include/dblayer/functions_sqlite.inc.php
r6580 r6604 512 512 } 513 513 514 function pwg_db_get_flood_period_expression($seconds) 515 { 516 return 'datetime(\'now\', \'localtime\', \''.-$seconds.' seconds\')'; 517 } 518 514 519 function pwg_db_get_hour($date) 515 520 { -
trunk/include/functions_comment.inc.php
r6596 r6604 134 134 if ($comment_action!='reject' and $conf['anti-flood_time']>0 ) 135 135 { // anti-flood system 136 $reference_date = date('c', time() - $conf['anti-flood_time']); 136 $reference_date = pwg_db_get_flood_period_expression($conf['anti-flood_time']); 137 137 138 $query = ' 138 SELECT idFROM '.COMMENTS_TABLE.'139 WHERE date > \''.$reference_date.'\'139 SELECT count(1) FROM '.COMMENTS_TABLE.' 140 WHERE date > '.$reference_date.' 140 141 AND author_id = '.$comm['author_id']; 141 if ( pwg_db_num_rows( pwg_query( $query ) ) > 0 ) 142 list($counter) = pwg_db_fetch_row(pwg_query($query)); 143 if ( $counter > 0 ) 142 144 { 143 145 array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
Note: See TracChangeset
for help on using the changeset viewer.