aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-02-01 02:46:26 +0000
committerrvelices <rv-github@modusoptimus.com>2006-02-01 02:46:26 +0000
commitbb181b04cf3e4984cb1dfbe95e5521ad917fab76 (patch)
tree10199843cd8c12ff06ea1f2e0fb6977d6fa1c46f /tools
parentac5fd23412f64b5b8647574a431e3cc13518538e (diff)
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
Diffstat (limited to 'tools')
-rw-r--r--tools/create_listing_file.php37
1 files changed, 34 insertions, 3 deletions
diff --git a/tools/create_listing_file.php b/tools/create_listing_file.php
index 299e32bab..3ffc525b6 100644
--- a/tools/create_listing_file.php
+++ b/tools/create_listing_file.php
@@ -280,6 +280,31 @@ function get_representative_files($dir)
}
/**
+ * 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
*
* @return void
@@ -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.' ';