Changeset 420 for trunk/picture.php


Ignore:
Timestamp:
May 20, 2004, 11:22:44 PM (21 years ago)
Author:
z0rglub
Message:

field comments.date becomes a datetime MySQL field type (instead of int)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r405 r420  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
     27
    2728//----------------------------------------------------------- include
    2829define('PHPWG_ROOT_PATH','./');
     
    225226    $reference_date = time() - $conf['anti-flood_time'];
    226227    $query = 'SELECT id FROM '.COMMENTS_TABLE;
    227     $query.= ' WHERE date > '.$reference_date;
     228    $query.= ' WHERE date > FROM_UNIXTIME('.$reference_date.')';
    228229    $query.= " AND author = '".$author."'";
    229230    $query.= ';';
     
    234235      $query.= ' (author,date,image_id,content,validated) VALUES (';
    235236      $query.= "'".$author."'";
    236       $query.= ','.time().','.$_GET['image_id'];
     237      $query.= ',NOW(),'.$_GET['image_id'];
    237238      $query.= ",'".htmlspecialchars( $_POST['content'], ENT_QUOTES)."'";
    238239      if ( !$conf['comments_validation'] or $user['status'] == 'admin' )
     
    578579    $template->assign_block_vars('comments.comment', array(
    579580    'COMMENT_AUTHOR'=>empty($row['author'])?$lang['guest']:$row['author'],
    580     'COMMENT_DATE'=>format_date( $row['date'], 'unix', true ),
     581    'COMMENT_DATE'=>format_date( $row['date'], 'mysql_datetime', true ),
    581582        'COMMENT'=>$content
    582583        ));
Note: See TracChangeset for help on using the changeset viewer.