mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-11 03:03:01 +02:00
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 git-svn-id: http://piwigo.org/svn/trunk@1020 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -279,6 +279,31 @@ function get_representative_files($dir)
|
||||
return $pictures;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an array with high quality/resolution picture files of a directory
|
||||
* according to $conf['picture_ext']
|
||||
*
|
||||
* @param string $dir
|
||||
* @return array
|
||||
*/
|
||||
function get_high_files($dir)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pictures = array();
|
||||
if ($opendir = @opendir($dir.'/pwg_high'))
|
||||
{
|
||||
while ($file = readdir($opendir))
|
||||
{
|
||||
if (in_array(get_extension($file), $conf['picture_ext']))
|
||||
{
|
||||
array_push($pictures, $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $pictures;
|
||||
}
|
||||
|
||||
/**
|
||||
* search in $basedir the sub-directories and calls get_pictures
|
||||
*
|
||||
@@ -347,6 +372,7 @@ function get_pictures($dir, $indent)
|
||||
$fs_files = get_pwg_files($dir);
|
||||
$fs_thumbnails = get_thumb_files($dir);
|
||||
$fs_representatives = get_representative_files($dir);
|
||||
$fs_highs = get_high_files($dir);
|
||||
|
||||
$elements = array();
|
||||
|
||||
@@ -377,8 +403,8 @@ function get_pictures($dir, $indent)
|
||||
}
|
||||
|
||||
// 2 cases : the element is a picture or not. Indeed, for a picture
|
||||
// thumbnail is mandatory and for non picture element, thumbnail and
|
||||
// representative is optionnal
|
||||
// thumbnail is mandatory, high is optional and for non picture element,
|
||||
// thumbnail and representative is optionnal
|
||||
if (in_array(get_extension($fs_file), $conf['picture_ext']))
|
||||
{
|
||||
// if we found a thumnbnail corresponding to our picture...
|
||||
@@ -389,6 +415,11 @@ function get_pictures($dir, $indent)
|
||||
$element['width'] = $image_size[0];
|
||||
$element['height'] = $image_size[1];
|
||||
}
|
||||
|
||||
if ( in_array($fs_file, $fs_highs) )
|
||||
{
|
||||
$element['has_high'] = 'true';
|
||||
}
|
||||
|
||||
if ($conf['use_exif'])
|
||||
{
|
||||
@@ -452,7 +483,7 @@ function get_pictures($dir, $indent)
|
||||
$xml = "\n".$indent.'<root>';
|
||||
$attributes = array('file','tn_ext','representative_ext','filesize',
|
||||
'width','height','date_creation','author','keywords',
|
||||
'name','comment','path');
|
||||
'name','comment','has_high', 'path');
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
$xml.= "\n".$indent.' ';
|
||||
|
||||
Reference in New Issue
Block a user