Changeset 12545


Ignore:
Timestamp:
11/05/11 00:49:03 (8 years ago)
Author:
plg
Message:

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.

Location:
branches/2.3/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/include/category_cats.inc.php

    r11739 r12545  
    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']) 
  • branches/2.3/include/category_default.inc.php

    r12452 r12545  
    112112  $name = get_picture_title($row); 
    113113 
    114   $tpl_var = 
    115     array( 
    116       'ID'        => $row['id'], 
    117       'TN_SRC'    => get_thumbnail_url($row), 
    118       'TN_ALT'    => htmlspecialchars(strip_tags($name)), 
    119       'TN_TITLE'  => get_thumbnail_title($row), 
    120       'URL'       => $url, 
     114  $tpl_var = array( 
     115    'ID' => $row['id'], 
     116    'TN_SRC' => get_thumbnail_url($row), 
     117    'TN_ALT' => htmlspecialchars(strip_tags($name)), 
     118    'TN_TITLE' => get_thumbnail_title($row), 
     119    'URL' => $url, 
    121120 
    122    /* Fields for template-extension usage */ 
    123       'FILE_PATH' => $row['path'], 
    124       'FILE_POSTED' => $row['date_available'], 
    125       'FILE_CREATED' => $row['date_creation'], 
    126       'FILE_DESC' => $row['comment'], 
    127       'FILE_AUTHOR' => $row['author'], 
    128       'FILE_HIT' => $row['hit'], 
    129       'FILE_SIZE' => $row['filesize'], 
    130       'FILE_WIDTH' => $row['width'], 
    131       'FILE_HEIGHT' => $row['height'], 
    132       'FILE_METADATE' => $row['date_metadata_update'], 
    133       'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ? 
    134                 true:false, /* lack of include/functions_picture.inc.php */ 
     121    // Extra fields for usage in extra themes 
     122    'FILE_PATH' => $row['path'], 
     123    'FILE_POSTED' => $row['date_available'], 
     124    'FILE_CREATED' => $row['date_creation'], 
     125    'FILE_DESC' => $row['comment'], 
     126    'FILE_AUTHOR' => $row['author'], 
     127    'FILE_HIT' => $row['hit'], 
     128    'FILE_SIZE' => $row['filesize'], 
     129    'FILE_WIDTH' => $row['width'], 
     130    'FILE_HEIGHT' => $row['height'], 
     131    'FILE_METADATE' => $row['date_metadata_update'], 
     132    'FILE_HAS_HD' => $row['has_high'], 
     133    'FILE_HD_WIDTH' => $row['high_width'], 
     134    'FILE_HD_HEIGHT' => $row['high_height'], 
     135    'FILE_HD_FILESIZE' => $row['high_filesize'], 
     136    'FILE_RATING_SCORE' => $row['rating_score'], 
    135137    ); 
     138   
    136139  if ($conf['index_new_icon']) 
    137140  { 
Note: See TracChangeset for help on using the changeset viewer.