Ignore:
Timestamp:
Oct 23, 2004, 2:38:34 PM (20 years ago)
Author:
z0rglub
Message:

can display thumbnail for non picture elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/picture_modify.php

    r575 r577  
    189189
    190190// some fields are nullable in the images table
    191 $nullables = array('name','author','keywords','date_creation','comment');
     191$nullables = array('name','author','keywords','date_creation','comment',
     192                   'width','height');
    192193foreach ($nullables as $field)
    193194{
     
    210211$dir_path = get_cat_display_name($current_category['name'], '->', '');
    211212
    212 $thumbnail_url = get_complete_dir($row['storage_category_id']);
    213 $file_wo_ext = get_filename_wo_extension($row['file']);
    214 $thumbnail_url.= '/thumbnail/';
    215 $thumbnail_url.= $conf['prefix_thumbnail'].$file_wo_ext.'.'.$row['tn_ext'];
     213// thumbnail url
     214if (isset($row['tn_ext']) and $row['tn_ext'] != '')
     215{
     216  $thumbnail_url = get_complete_dir($row['storage_category_id']);
     217  $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
     218  $thumbnail_url.= get_filename_wo_extension($row['file']);
     219  $thumbnail_url.= '.'.$row['tn_ext'];
     220}
     221else
     222{
     223  $thumbnail_url = PHPWG_ROOT_PATH;
     224  $thumbnail_url = 'template/'.$user['template'].'/mimetypes/';
     225  $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
     226}
     227
    216228$url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id'];
    217229$url_img .= '&cat='.$row['storage_category_id'];
Note: See TracChangeset for help on using the changeset viewer.