Ignore:
Timestamp:
Feb 4, 2009, 3:30:48 AM (16 years ago)
Author:
rvelices
Message:

optimizations (php only)

  • removed unnecessary call to array_unique in get_image_ids_for_tags
  • put back in smarty exec time counting (debug mode) for each included template
  • prefix some smarty modifiers with @ in some templates
  • do not call format_date (still very slow due to mktime and date even after prev commit) from category_default.inc.php - if used in templates format_date can be used as a smarty modifier
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_default.inc.php

    r3049 r3120  
    107107  $tpl_var =
    108108    array(
    109       'ID'            => $row['id'],
    110       'TN_SRC'         => $thumbnail_url,
    111       'TN_ALT'     => $row['file'],
    112       'TN_TITLE'   => get_thumbnail_title($row),
    113       'ICON_TS'      => get_icon($row['date_available']),
    114       'URL'    => $url,
     109      'ID'        => $row['id'],
     110      'TN_SRC'    => $thumbnail_url,
     111      'TN_ALT'    => $row['file'],
     112      'TN_TITLE'  => get_thumbnail_title($row),
     113      'ICON_TS'   => get_icon($row['date_available']),
     114      'URL'       => $url,
    115115
    116116   /* Fields for template-extension usage */
    117117      'FILE_PATH' => $row['path'],
    118       'FILE_POSTED' => format_date($row['date_available'], 'mysql_datetime'),
    119       'FILE_CREATED' => (empty($row['date_creation'])) ?
    120         '-': format_date($row['date_creation'], 'mysql_date'),
    121       'FILE_DESC' => (empty($row['comment'])) ? '-' : $row['comment'],
    122       'FILE_AUTHOR' => (empty($row['author'])) ? '-' : $row['author'],
     118      'FILE_POSTED' => $row['date_available'],
     119      'FILE_CREATED' => $row['date_creation'],
     120      'FILE_DESC' => $row['comment'],
     121      'FILE_AUTHOR' => $row['author'],
    123122      'FILE_HIT' => $row['hit'],
    124       'FILE_SIZE' => (empty($row['filesize'])) ? '-' : $row['filesize'],
    125       'FILE_WIDTH' => (empty($row['width'])) ? '-' : $row['width'],
    126       'FILE_HEIGHT' => (empty($row['height'])) ? '-' : $row['height'],
    127       'FILE_METADATE' => (empty($row['date_metadata_update'])) ?
    128         '-': format_date($row['date_metadata_update'], 'mysql_date'),
    129       'FILE_RATE' => (empty($row['rate'])) ? '-' : $row['rate'],
    130       'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
     123      'FILE_SIZE' => $row['filesize'],
     124      'FILE_WIDTH' => $row['width'],
     125      'FILE_HEIGHT' => $row['height'],
     126      'FILE_METADATE' => $row['date_metadata_update'],
     127      'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
    131128                true:false, /* lack of include/functions_picture.inc.php */
    132129    );
Note: See TracChangeset for help on using the changeset viewer.