Ignore:
Timestamp:
Oct 23, 2004, 7:56:46 PM (20 years ago)
Author:
z0rglub
Message:
  • refactoring of comments.php
  • creation of function get_thumbnail_src used everywhere a thumbnail must be displayed
  • creation of function parse_comment_content (used in comments.php and picture.php)
  • concerning undefined index on arrays retrieved in database, instead of testing possibly unset values, use of @ operator (smarter...)
  • add pre tag in default.css stylesheet for debugging purpose (need to have left aligned text)
File:
1 edited

Legend:

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

    r578 r579  
    6262while ($row = mysql_fetch_array($result))
    6363{
    64   // retrieving the storage dir of the picture
    65   if (!isset($array_cat_directories[$row['storage_category_id']]))
    66   {
    67     $array_cat_directories[$row['storage_category_id']] =
    68       get_complete_dir($row['storage_category_id']);
    69   }
    70   $cat_directory = $array_cat_directories[$row['storage_category_id']];
    71 
    72   $file = get_filename_wo_extension($row['file']);
    7364  // name of the picture
    7465  if (isset($row['name']) and $row['name'] != '')
     
    7869  else
    7970  {
    80     $name = str_replace('_', ' ', $file);
     71    $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    8172  }
    8273  if ($page['cat'] == 'best_rated')
     
    8980    $name = replace_search($name, $_GET['search']);
    9081  }
    91   // thumbnail url
    92   if (isset($row['tn_ext']) and $row['tn_ext'] != '')
    93   {
    94     $thumbnail_url = $cat_directory;
    95     $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
    96     $thumbnail_url.= $file.'.'.$row['tn_ext'];
    97   }
    98   else
    99   {
    100     $thumbnail_url = PHPWG_ROOT_PATH;
    101     $thumbnail_url.= 'template/'.$user['template'].'/mimetypes/';
    102     $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
    103   }
     82 
     83  $thumbnail_url = get_thumbnail_src($row['file'],
     84                                     $row['storage_category_id'],
     85                                     @$row['tn_ext']);
    10486 
    10587  // message in title for the thumbnail
Note: See TracChangeset for help on using the changeset viewer.