aboutsummaryrefslogtreecommitdiffstats
path: root/admin/site_update.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2007-03-09 16:28:49 +0000
committerplegall <plg@piwigo.org>2007-03-09 16:28:49 +0000
commitb0478ef330b8f729554aec55baa81d9e3d02a063 (patch)
tree2be4688f02ba35fe2297f2b7d7de03e8f9eaf5e2 /admin/site_update.php
parent81030a7ab40a481d6d8c93539162a4a035ea09d1 (diff)
New: #images.high_filesize was added so that we can sum the filesizes in the
filtered history. #images.high_filesize is filled during metadata synchronization. Bug fixed: in getAttribute XML function, when asking "filesize", it was returning high_filesize. The regex was too simple. git-svn-id: http://piwigo.org/svn/trunk@1883 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/site_update.php')
-rw-r--r--admin/site_update.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/admin/site_update.php b/admin/site_update.php
index baf7131af..91e4d6238 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -775,9 +775,40 @@ if (isset($_POST['submit']) and preg_match('/^metadata/', $_POST['sync'])
$start = get_moment();
$datas = array();
$tags_of = array();
+
+ $has_high_images = array();
+
+ $image_ids = array();
+ foreach ($files as $id => $file)
+ {
+ array_push($image_ids, $id);
+ }
+
+ if (count($image_ids) > 0)
+ {
+ $query = '
+SELECT id
+ FROM '.IMAGES_TABLE.'
+ WHERE has_high = \'true\'
+ AND id IN (
+'.wordwrap(implode(', ', $image_ids), 80, "\n").'
+)
+;';
+
+ $result = pwg_query($query);
+ while ($row = mysql_fetch_array($result))
+ {
+ array_push($has_high_images, $row['id']);
+ }
+ }
+
foreach ( $files as $id=>$file )
{
- $data = $site_reader->get_element_metadata($file);
+ $data = $site_reader->get_element_metadata(
+ $file,
+ in_array($id, $has_high_images)
+ );
+
if ( is_array($data) )
{
$data['date_metadata_update'] = CURRENT_DATE;
@@ -813,6 +844,8 @@ if (isset($_POST['submit']) and preg_match('/^metadata/', $_POST['sync'])
{
if (count($datas) > 0)
{
+ // echo '<pre>', print_r($datas); echo '</pre>';
+
mass_updates(
IMAGES_TABLE,
// fields