Changeset 1020 for trunk/tools


Ignore:
Timestamp:
Feb 1, 2006, 3:46:26 AM (18 years ago)
Author:
rvelices
Message:

feature 280: Allow visitors/users to choose image ordering inside a category

improvement 82: Viewing pictures from remote galleries does not check anymore
for the high pictures (existence flag added to create_listing_file and db)

correction: link element in picture is in the head instead of body (w3c spec)

correction: in profile.php the current template was not selected by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/create_listing_file.php

    r954 r1020  
    281281
    282282/**
     283 * returns an array with high quality/resolution picture files of a directory
     284 * according to $conf['picture_ext']
     285 *
     286 * @param string $dir
     287 * @return array
     288 */
     289function get_high_files($dir)
     290{
     291  global $conf;
     292
     293  $pictures = array();
     294  if ($opendir = @opendir($dir.'/pwg_high'))
     295  {
     296    while ($file = readdir($opendir))
     297    {
     298      if (in_array(get_extension($file), $conf['picture_ext']))
     299      {
     300        array_push($pictures, $file);
     301      }
     302    }
     303  }
     304  return $pictures;
     305}
     306
     307/**
    283308 * search in $basedir the sub-directories and calls get_pictures
    284309 *
     
    348373  $fs_thumbnails = get_thumb_files($dir);
    349374  $fs_representatives = get_representative_files($dir);
     375  $fs_highs = get_high_files($dir);
    350376
    351377  $elements = array();
     
    378404
    379405    // 2 cases : the element is a picture or not. Indeed, for a picture
    380     // thumbnail is mandatory and for non picture element, thumbnail and
    381     // representative is optionnal
     406    // thumbnail is mandatory, high is optional and for non picture element,
     407    // thumbnail and representative is optionnal
    382408    if (in_array(get_extension($fs_file), $conf['picture_ext']))
    383409    {
     
    389415          $element['width'] = $image_size[0];
    390416          $element['height'] = $image_size[1];
     417        }
     418       
     419        if ( in_array($fs_file, $fs_highs) )
     420        {
     421          $element['has_high'] = 'true';
    391422        }
    392423
     
    453484  $attributes = array('file','tn_ext','representative_ext','filesize',
    454485                      'width','height','date_creation','author','keywords',
    455                       'name','comment','path');
     486                      'name','comment','has_high', 'path');
    456487  foreach ($elements as $element)
    457488  {
Note: See TracChangeset for help on using the changeset viewer.