Changeset 577 for trunk


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

can display thumbnail for non picture elements

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/infos_images.php

    r570 r577  
    249249  $current_category = get_cat_info($_GET['cat_id']);
    250250  $url = PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id=';
    251   $category_path = get_cat_display_name($current_category['name'], '->', $url);
     251  $category_path = get_cat_display_name($current_category['name'],
     252                                        '->',
     253                                        $url);
    252254 
    253   $form_action = PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id='.$_GET['cat_id'];
     255  $form_action = PHPWG_ROOT_PATH.'admin.php';
     256  $form_action.= '?page=infos_images&cat_id='.$_GET['cat_id'];
    254257  if($page['start'])
    255258  {
     
    322325        get_complete_dir($row['storage_category_id']);
    323326    }
    324     $thumbnail_url = $array_cat_directories[$row['storage_category_id']];
    325     $thumbnail_url.= 'thumbnail/';
    326     $thumbnail_url.= $conf['prefix_thumbnail'];
    327     $thumbnail_url.= get_filename_wo_extension($row['file']);
    328     $thumbnail_url.= '.'.$row['tn_ext'];
     327
     328    // thumbnail url
     329    if (isset($row['tn_ext']) and $row['tn_ext'] != '')
     330    {
     331      $thumbnail_url = $array_cat_directories[$row['storage_category_id']];
     332      $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
     333      $thumbnail_url.= get_filename_wo_extension($row['file']);
     334      $thumbnail_url.= '.'.$row['tn_ext'];
     335    }
     336    else
     337    {
     338      $thumbnail_url = PHPWG_ROOT_PATH;
     339      $thumbnail_url = 'template/'.$user['template'].'/mimetypes/';
     340      $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
     341    }
    329342
    330343    // some fields are nullable in the images table
  • 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.