aboutsummaryrefslogtreecommitdiffstats
path: root/admin/picture_modify.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/picture_modify.php')
-rw-r--r--admin/picture_modify.php46
1 files changed, 22 insertions, 24 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 033e52139..25c74a8c1 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
@@ -82,7 +82,7 @@ SELECT category_id
array_from_query($query, 'category_id'),
explode(',', calculate_permissions($user['id'], $user['status']))
);
-
+
foreach ($authorizeds as $category_id)
{
redirect(
@@ -104,7 +104,7 @@ SELECT category_id
if (isset($_GET['sync_metadata']))
{
sync_metadata(array( intval($_GET['image_id'])));
- array_push($page['infos'], l10n('Metadata synchronized from file'));
+ $page['infos'][] = l10n('Metadata synchronized from file');
}
//--------------------------------------------------------- update informations
@@ -120,7 +120,7 @@ if (isset($_POST['date_creation_action'])
$_POST['date_creation_year'])
)
{
- array_push($page['errors'], l10n('wrong date'));
+ $page['errors'][] = l10n('wrong date');
}
}
@@ -154,13 +154,10 @@ if (isset($_POST['submit']) and count($page['errors']) == 0)
$data{'date_creation'} = null;
}
- mass_updates(
+ single_update(
IMAGES_TABLE,
- array(
- 'primary' => array('id'),
- 'update' => array_diff(array_keys($data), array('id'))
- ),
- array($data)
+ $data,
+ array('id' => $data['id'])
);
// time to deal with tags
@@ -178,12 +175,14 @@ if (isset($_POST['submit']) and count($page['errors']) == 0)
}
move_images_to_categories(array($_GET['image_id']), $_POST['associate']);
+ invalidate_user_cache();
+
// thumbnail for albums
if (!isset($_POST['represent']))
{
$_POST['represent'] = array();
}
-
+
$no_longer_thumbnail_for = array_diff($represent_options_selected, $_POST['represent']);
if (count($no_longer_thumbnail_for) > 0)
{
@@ -202,8 +201,8 @@ UPDATE '.CATEGORIES_TABLE.'
}
$represent_options_selected = $_POST['represent'];
-
- array_push($page['infos'], l10n('Photo informations updated'));
+
+ $page['infos'][] = l10n('Photo informations updated');
}
// tags
@@ -306,12 +305,12 @@ while ($user_row = pwg_db_fetch_assoc($result))
}
$intro_vars = array(
- 'file' => sprintf(l10n('Original file : %s'), $row['file']),
- 'add_date' => sprintf(l10n('Posted %s on %s'), time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)),
- 'added_by' => sprintf(l10n('Added by %s'), $row['added_by']),
+ 'file' => l10n('Original file : %s', $row['file']),
+ 'add_date' => l10n('Posted %s on %s', time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)),
+ 'added_by' => l10n('Added by %s', $row['added_by']),
'size' => $row['width'].'×'.$row['height'].' pixels, '.sprintf('%.2f', $row['filesize']/1024).'MB',
- 'stats' => sprintf(l10n('Visited %d times'), $row['hit']),
- 'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']),
+ 'stats' => l10n('Visited %d times', $row['hit']),
+ 'id' => l10n('Numeric identifier : %d', $row['id']),
);
if ($conf['rate'] and !empty($row['rating_score']))
@@ -323,12 +322,12 @@ SELECT
WHERE element_id = '.$_GET['image_id'].'
;';
list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query));
-
+
$intro_vars['stats'].= ', '.sprintf(l10n('Rated %d times, score : %.2f'), $row['nb_rates'], $row['rating_score']);
}
$template->assign('INTRO', $intro_vars);
-
+
if (in_array(get_extension($row['path']),$conf['picture_ext']))
{
@@ -373,8 +372,8 @@ ksort($month_list);
$template->assign(
array(
- 'DATE_CREATION_DAY_VALUE' => $day,
- 'DATE_CREATION_MONTH_VALUE' => $month,
+ 'DATE_CREATION_DAY_VALUE' => (int)$day,
+ 'DATE_CREATION_MONTH_VALUE' => (int)$month,
'DATE_CREATION_YEAR_VALUE' => $year,
'DATE_CREATION_TIME_VALUE' => $time,
'month_list' => $month_list,
@@ -395,8 +394,7 @@ while ($row = pwg_db_fetch_assoc($result))
$name =
get_cat_display_name_cache(
$row['uppercats'],
- get_root_url().'admin.php?page=album-',
- false
+ get_root_url().'admin.php?page=album-'
);
if ($row['category_id'] == $storage_category_id)