aboutsummaryrefslogtreecommitdiffstats
path: root/tools/create_listing_file.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
committerplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
commit1bf3753f1449eedc4bd39c79b6ca17dc4f396e76 (patch)
tree7d7443b94356cd18a038b3f104f6e21a35d01279 /tools/create_listing_file.php
parent973e0f8806cd6d569c01977ad5112e16cc7a7f6f (diff)
- images.path column added to reduce database access
- function mass_inserts moved from admin/remote_sites.php to admin/include/function.php - function mass_inserts used in admin/update.php git-svn-id: http://piwigo.org/svn/trunk@606 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'tools/create_listing_file.php')
-rw-r--r--tools/create_listing_file.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/create_listing_file.php b/tools/create_listing_file.php
index 569f5f5d8..63c992cea 100644
--- a/tools/create_listing_file.php
+++ b/tools/create_listing_file.php
@@ -310,7 +310,7 @@ function get_filename_wo_extension($filename)
function get_pictures($dir, $indent)
{
- global $conf;
+ global $conf, $page;
// fs means FileSystem : $fs_files contains files in the filesystem found
// in $dir that can be managed by PhpWebGallery (see get_pwg_files
@@ -321,11 +321,15 @@ function get_pictures($dir, $indent)
$fs_representatives = get_representative_files($dir);
$elements = array();
+
+ $print_dir = preg_replace('/^\.\//', '', $dir);
+ $print_dir = preg_replace('/\/*$/', '/', $print_dir);
foreach ($fs_files as $fs_file)
{
$element = array();
$element['file'] = $fs_file;
+ $element['path'] = $page['url'].$print_dir.$fs_file;
$element['filesize'] = floor(filesize($dir.'/'.$fs_file) / 1024);
$file_wo_ext = get_filename_wo_extension($fs_file);
@@ -420,7 +424,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');
+ 'name','comment','path');
foreach ($elements as $element)
{
$xml.= "\n".$indent.' ';
@@ -463,9 +467,9 @@ switch ($page['action'])
$end = strrpos($_SERVER['PHP_SELF'], '/') + 1;
$local_folder = substr($_SERVER['PHP_SELF'], 0, $end);
- $url = 'http://'.$_SERVER['HTTP_HOST'].$local_folder;
+ $page['url'] = 'http://'.$_SERVER['HTTP_HOST'].$local_folder;
- $listing.= ' url="'.$url.'"';
+ $listing.= ' url="'.$page['url'].'"';
$listing.= '/>'."\n";
$listing.= get_dirs('.', '', 0);