Changeset 420 for trunk/comments.php


Ignore:
Timestamp:
May 20, 2004, 11:22:44 PM (20 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/comments.php

    r393 r420  
    9292
    9393foreach ( $conf['last_days'] as $option ) {
    94   $url = $PHP_SELF.'?last_days='.($option - 1);
     94  $url = $_SERVER['PHP_SELF'].'?last_days='.($option - 1);
    9595  if (defined('IN_ADMIN')) $url.= '&page=comments';
    96   $template->assign_block_vars('last_day_option', array (
    97     'OPTION'=>$option,
    98         'T_STYLE'=>(( $option == MAX_DAYS + 1 )?'text-decoration:underline;':''),
    99         'U_OPTION'=>add_session_id( $url )
    100         ));
     96  $template->assign_block_vars(
     97    'last_day_option',
     98    array(
     99      'OPTION'=>$option,
     100      'T_STYLE'=>(( $option == MAX_DAYS + 1 )?'text-decoration:underline;':''),
     101      'U_OPTION'=>add_session_id( $url )
     102      )
     103    );
    101104}
    102105
     
    110113$query.= ', '.IMAGE_CATEGORY_TABLE.' AS ic';
    111114$query.= ' WHERE c.image_id = ic.image_id';
    112 $query.= ' AND date > '.$maxtime;
     115$query.= ' AND date > FROM_UNIXTIME('.$maxtime.')';
    113116if ( $user['status'] != 'admin' )
    114117{
     
    174177    $query = 'SELECT * FROM '.COMMENTS_TABLE;
    175178    $query.= ' WHERE image_id = '.$row['image_id'];
    176     $query.= ' AND date > '.$maxtime;
     179    $query.= ' AND date > FROM_UNIXTIME('.$maxtime.')';
    177180        if ( $user['status'] != 'admin' )
    178181    {
     
    202205      $replacement = '<span style="font-style:italic;">\1</span>';
    203206      $content = preg_replace( $pattern, $replacement, $content );
    204       $template->assign_block_vars('picture.comment',array(
    205             'COMMENT_AUTHOR'=>$author,
    206                 'COMMENT_DATE'=>format_date( $subrow['date'], 'unix', true ),
    207                 'COMMENT'=>$content,
    208                 ));
    209                 if ( $user['status'] == 'admin' )
    210                 {
    211                   $template->assign_block_vars('picture.comment.validation', array(
    212                     'ID'=> $subrow['id'],
    213                         'CHECKED'=>($subrow['validated']=='false')?'checked="checked"': ''
    214                         ));
    215                 }
     207      $template->assign_block_vars(
     208        'picture.comment',array(
     209          'COMMENT_AUTHOR'=>$author,
     210          'COMMENT_DATE'=>format_date( $subrow['date'],'mysql_datetime',true ),
     211          'COMMENT'=>$content,
     212          ));
     213      if ( $user['status'] == 'admin' )
     214      {
     215        $template->assign_block_vars(
     216          'picture.comment.validation', array(
     217            'ID'=> $subrow['id'],
     218            'CHECKED'=>($subrow['validated']=='false')?'checked="checked"': ''
     219            ));
     220      }
    216221    }
    217222  }
Note: See TracChangeset for help on using the changeset viewer.