Ignore:
Timestamp:
Nov 5, 2011, 12:54:12 AM (13 years ago)
Author:
plg
Message:

merge r12545 from branch 2.3 to trunk

feature 2397 added: add details about the album thumbnail for extra templates.

Algorithm changed for FILE_HAS_HD : we don't care about the $userenabled_high

Fields added in category_default : high_filesize, high_width, high_height, rating_score

We send the same fields on category_cats but for album thumbnail only.

File:
1 edited

Legend:

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

    r11739 r12546  
    177177if (count($categories) > 0)
    178178{
    179   $thumbnail_src_of = array();
     179  $infos_of_image = array();
    180180  $new_image_ids = array();
    181181
    182182  $query = '
    183 SELECT id, path, tn_ext, level
     183SELECT *
    184184  FROM '.IMAGES_TABLE.'
    185185  WHERE id IN ('.implode(',', $image_ids).')
     
    190190    if ($row['level'] <= $user['level'])
    191191    {
    192       $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
     192      $row['tn_src'] = get_thumbnail_url($row);
     193      $infos_of_image[$row['id']] = $row;
    193194    }
    194195    else
     
    229230  {
    230231    $query = '
    231 SELECT id, path, tn_ext
     232SELECT *
    232233  FROM '.IMAGES_TABLE.'
    233234  WHERE id IN ('.implode(',', $new_image_ids).')
     
    236237    while ($row = pwg_db_fetch_assoc($result))
    237238    {
    238       $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
     239      $row['tn_src'] = get_thumbnail_url($row);
     240      $infos_of_image[$row['id']] = $row;
    239241    }
    240242  }
     
    305307    }
    306308
     309    $representative_infos = $infos_of_image[ $category['representative_picture_id'] ];
     310
    307311    $tpl_var =
    308312        array(
    309313          'ID'    => $category['id'],
    310           'TN_SRC'   => $thumbnail_src_of[$category['representative_picture_id']],
     314          'TN_SRC'   => $representative_infos['tn_src'],
    311315          'TN_ALT'   => strip_tags($category['name']),
    312316
     
    330334                'subcatify_category_description')),
    331335          'NAME'  => $name,
     336         
     337          // Extra fields for usage in extra themes
     338          'FILE_PATH' => $representative_infos['path'],
     339          'FILE_POSTED' => $representative_infos['date_available'],
     340          'FILE_CREATED' => $representative_infos['date_creation'],
     341          'FILE_DESC' => $representative_infos['comment'],
     342          'FILE_AUTHOR' => $representative_infos['author'],
     343          'FILE_HIT' => $representative_infos['hit'],
     344          'FILE_SIZE' => $representative_infos['filesize'],
     345          'FILE_WIDTH' => $representative_infos['width'],
     346          'FILE_HEIGHT' => $representative_infos['height'],
     347          'FILE_METADATE' => $representative_infos['date_metadata_update'],
     348          'FILE_HAS_HD' => $representative_infos['has_high'],
     349          'FILE_HD_WIDTH' => $representative_infos['high_width'],
     350          'FILE_HD_HEIGHT' => $representative_infos['high_height'],
     351          'FILE_HD_FILESIZE' => $representative_infos['high_filesize'],
     352          'FILE_RATING_SCORE' => $representative_infos['rating_score'],
    332353        );
    333354    if ($conf['index_new_icon'])
Note: See TracChangeset for help on using the changeset viewer.