aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-05-20 21:22:44 +0000
committerz0rglub <z0rglub@piwigo.org>2004-05-20 21:22:44 +0000
commit8db124da81b8f90d6622ae8086ff57010a996355 (patch)
tree4b0b5eceb204eea75d017a2fd895bd752915b691 /picture.php
parent396d68275d6fe79ffdf07a378d7e46ebe60bcc7b (diff)
field comments.date becomes a datetime MySQL field type (instead of int)
git-svn-id: http://piwigo.org/svn/trunk@420 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/picture.php b/picture.php
index 07b72167e..6f1c7c149 100644
--- a/picture.php
+++ b/picture.php
@@ -24,6 +24,7 @@
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
+
//----------------------------------------------------------- include
define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
@@ -224,7 +225,7 @@ if ( isset( $_POST['content'] ) && !empty($_POST['content']) )
// anti-flood system
$reference_date = time() - $conf['anti-flood_time'];
$query = 'SELECT id FROM '.COMMENTS_TABLE;
- $query.= ' WHERE date > '.$reference_date;
+ $query.= ' WHERE date > FROM_UNIXTIME('.$reference_date.')';
$query.= " AND author = '".$author."'";
$query.= ';';
if ( mysql_num_rows( mysql_query( $query ) ) == 0
@@ -233,7 +234,7 @@ if ( isset( $_POST['content'] ) && !empty($_POST['content']) )
$query = 'INSERT INTO '.COMMENTS_TABLE;
$query.= ' (author,date,image_id,content,validated) VALUES (';
$query.= "'".$author."'";
- $query.= ','.time().','.$_GET['image_id'];
+ $query.= ',NOW(),'.$_GET['image_id'];
$query.= ",'".htmlspecialchars( $_POST['content'], ENT_QUOTES)."'";
if ( !$conf['comments_validation'] or $user['status'] == 'admin' )
{
@@ -577,7 +578,7 @@ if ( $conf['show_comments'] )
$template->assign_block_vars('comments.comment', array(
'COMMENT_AUTHOR'=>empty($row['author'])?$lang['guest']:$row['author'],
- 'COMMENT_DATE'=>format_date( $row['date'], 'unix', true ),
+ 'COMMENT_DATE'=>format_date( $row['date'], 'mysql_datetime', true ),
'COMMENT'=>$content
));