remove all array_push (50% slower than []) + some changes missing for feature:2978

git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2013-10-19 17:43:04 +00:00
parent 35ff1b7c1f
commit ae707279a1
89 changed files with 700 additions and 1084 deletions
+6 -9
View File
@@ -81,7 +81,7 @@ SELECT id
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
array_push($private_uppercats, $row['id']);
$private_uppercats[] = $row['id'];
}
// retrying to authorize a category which is already authorized may cause
@@ -98,19 +98,16 @@ SELECT cat_id
while ($row = pwg_db_fetch_assoc($result))
{
array_push($authorized_ids, $row['cat_id']);
$authorized_ids[] = $row['cat_id'];
}
$inserts = array();
$to_autorize_ids = array_diff($private_uppercats, $authorized_ids);
foreach ($to_autorize_ids as $to_autorize_id)
{
array_push(
$inserts,
array(
'group_id' => $page['group'],
'cat_id' => $to_autorize_id
)
$inserts[] = array(
'group_id' => $page['group'],
'cat_id' => $to_autorize_id
);
}
@@ -158,7 +155,7 @@ $result = pwg_query($query_true);
$authorized_ids = array();
while ($row = pwg_db_fetch_assoc($result))
{
array_push($authorized_ids, $row['id']);
$authorized_ids[] = $row['id'];
}
$query_false = '