mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 16:53:34 +02:00
replace some mass_updates/inserts by single_update/insert
git-svn-id: http://piwigo.org/svn/trunk@25019 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+11
-15
@@ -114,27 +114,23 @@ if ( !isset( $_GET['cat_id'] ) || !is_numeric( $_GET['cat_id'] ) )
|
||||
//--------------------------------------------------------- form criteria check
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$data =
|
||||
array(
|
||||
'id' => $_GET['cat_id'],
|
||||
'name' => @$_POST['name'],
|
||||
'comment' =>
|
||||
$conf['allow_html_descriptions'] ?
|
||||
@$_POST['comment'] : strip_tags(@$_POST['comment']),
|
||||
);
|
||||
$data = array(
|
||||
'id' => $_GET['cat_id'],
|
||||
'name' => @$_POST['name'],
|
||||
'comment' =>
|
||||
$conf['allow_html_descriptions'] ?
|
||||
@$_POST['comment'] : strip_tags(@$_POST['comment']),
|
||||
);
|
||||
|
||||
if ($conf['activate_comments'])
|
||||
{
|
||||
$data['commentable'] = isset($_POST['commentable'])?$_POST['commentable']:'false';
|
||||
}
|
||||
|
||||
mass_updates(
|
||||
|
||||
single_update(
|
||||
CATEGORIES_TABLE,
|
||||
array(
|
||||
'primary' => array('id'),
|
||||
'update' => array_diff(array_keys($data), array('id'))
|
||||
),
|
||||
array($data)
|
||||
$data,
|
||||
array('id' => $data['id'])
|
||||
);
|
||||
|
||||
// retrieve cat infos before continuing (following updates are expensive)
|
||||
|
||||
Reference in New Issue
Block a user