Changeset 25018


Ignore:
Timestamp:
Oct 19, 2013, 7:43:04 PM (7 years ago)
Author:
mistic100
Message:

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

Location:
trunk
Files:
89 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/album_notification.php

    r25005 r25018  
    114114  list($group_name) = pwg_db_fetch_row(pwg_query($query));
    115115
    116   array_push(
    117     $page['infos'],
    118     l10n(
    119       'An information email was sent to group "%s"',
    120       $group_name
    121       )
    122     );
     116  $page['infos'][] = l10n('An information email was sent to group "%s"', $group_name);
    123117}
    124118
  • trunk/admin/batch_manager.php

    r24835 r25018  
    178178  WHERE user_id = '.$user['id'].'
    179179;';
    180     array_push(
    181       $filter_sets,
    182       array_from_query($query, 'element_id')
    183       );
     180    $filter_sets[] = array_from_query($query, 'element_id');
    184181   
    185182    break;
     
    191188  WHERE user_id = '.$user['id'].'
    192189;';
    193     array_push(
    194       $filter_sets,
    195       array_from_query($query, 'image_id')
    196       );
     190    $filter_sets[] = array_from_query($query, 'image_id');
    197191   
    198192    break;
     
    211205  WHERE date_available BETWEEN '.pwg_db_get_recent_period_expression(1, $row['date']).' AND \''.$row['date'].'\'
    212206;';
    213       array_push(
    214         $filter_sets,
    215         array_from_query($query, 'id')
    216         );
     207      $filter_sets[] = array_from_query($query, 'id');
    217208    }
    218209   
     
    243234    }
    244235
    245     array_push(
    246       $filter_sets,
    247       array_diff($all_elements, $linked_to_virtual)
    248       );
     236    $filter_sets[] = array_diff($all_elements, $linked_to_virtual);
    249237   
    250238    break;
     
    258246  WHERE category_id is null
    259247;';
    260     array_push(
    261       $filter_sets,
    262       array_from_query($query, 'id')
    263       );
     248    $filter_sets[] = array_from_query($query, 'id');
    264249   
    265250    break;
     
    273258  WHERE tag_id is null
    274259;';
    275     array_push(
    276       $filter_sets,
    277       array_from_query($query, 'id')
    278       );
     260    $filter_sets[] = array_from_query($query, 'id');
    279261   
    280262    break;
     
    298280  WHERE file IN (\''.implode("','", $duplicate_files).'\')
    299281;';
    300 
    301     array_push(
    302       $filter_sets,
    303       array_from_query($query, 'id')
    304       );
     282    $filter_sets[] = array_from_query($query, 'id');
    305283   
    306284    break;
     
    338316   WHERE category_id IN ('.implode(',', $categories).')
    339317 ;';
    340   array_push(
    341     $filter_sets,
    342     array_from_query($query, 'image_id')
    343     );
     318  $filter_sets[] = array_from_query($query, 'image_id');
    344319}
    345320
     
    363338if (!empty($_SESSION['bulk_manager_filter']['tags']))
    364339{
    365   array_push(
    366     $filter_sets,
    367     get_image_ids_for_tags(
    368       $_SESSION['bulk_manager_filter']['tags'],
    369       $_SESSION['bulk_manager_filter']['tag_mode'],
    370       null,
    371       null,
    372       false // we don't apply permissions in administration screens
    373       )
     340  $filter_sets[] = get_image_ids_for_tags(
     341    $_SESSION['bulk_manager_filter']['tags'],
     342    $_SESSION['bulk_manager_filter']['tag_mode'],
     343    null,
     344    null,
     345    false // we don't apply permissions in administration screens
    374346    );
    375347}
  • trunk/admin/batch_manager_global.php

    r25005 r25018  
    8383  if (count($collection) == 0)
    8484  {
    85     array_push($page['errors'], l10n('Select at least one photo'));
     85    $page['errors'][] = l10n('Select at least one photo');
    8686  }
    8787
     
    106106    if (empty($_POST['add_tags']))
    107107    {
    108       array_push($page['errors'], l10n('Select at least one tag'));
     108      $page['errors'][] = l10n('Select at least one tag');
    109109    }
    110110    else
     
    134134     else
    135135     {
    136       array_push($page['errors'], l10n('Select at least one tag'));
     136      $page['errors'][] = l10n('Select at least one tag');
    137137     }
    138138  }
     
    242242    foreach ($collection as $image_id)
    243243    {
    244       array_push(
    245         $datas,
    246         array(
    247           'id' => $image_id,
    248           'author' => $_POST['author']
    249           )
     244      $datas[] = array(
     245        'id' => $image_id,
     246        'author' => $_POST['author']
    250247        );
    251248    }
     
    269266    foreach ($collection as $image_id)
    270267    {
    271       array_push(
    272         $datas,
    273         array(
    274           'id' => $image_id,
    275           'name' => $_POST['title']
    276           )
     268      $datas[] = array(
     269        'id' => $image_id,
     270        'name' => $_POST['title']
    277271        );
    278272    }
     
    303297    foreach ($collection as $image_id)
    304298    {
    305       array_push(
    306         $datas,
    307         array(
    308           'id' => $image_id,
    309           'date_creation' => $date_creation
    310           )
     299      $datas[] = array(
     300        'id' => $image_id,
     301        'date_creation' => $date_creation
    311302        );
    312303    }
     
    325316    foreach ($collection as $image_id)
    326317    {
    327       array_push(
    328         $datas,
    329         array(
    330           'id' => $image_id,
    331           'level' => $_POST['level']
    332           )
     318      $datas[] = array(
     319        'id' => $image_id,
     320        'level' => $_POST['level']
    333321        );
    334322    }
     
    363351      if ($deleted_count > 0)
    364352      {
    365         $_SESSION['page_infos'] = array(
    366           sprintf(
    367             l10n_dec(
    368               '%d photo was deleted',
    369               '%d photos were deleted',
    370               $deleted_count
    371               ),
    372             $deleted_count
    373             )
     353        $_SESSION['page_infos'][] = l10n_dec(
     354          '%d photo was deleted', '%d photos were deleted',
     355          $deleted_count
    374356          );
    375357
     
    379361      else
    380362      {
    381         array_push($page['errors'], l10n('No photo can be deleted'));
     363        $page['errors'][] = l10n('No photo can be deleted');
    382364      }
    383365    }
    384366    else
    385367    {
    386       array_push($page['errors'], l10n('You need to confirm deletion'));
     368      $page['errors'][] = l10n('You need to confirm deletion');
    387369    }
    388370  }
     
    392374  {
    393375    sync_metadata($collection);
    394 
    395     array_push(
    396       $page['infos'],
    397       l10n('Metadata synchronized from file')
    398       );
     376    $page['infos'][] = l10n('Metadata synchronized from file');
    399377  }
    400378
     
    416394  {
    417395    if ($_POST['regenerateSuccess'] != '0')
    418       array_push($page['infos'], l10n('%s photos have been regenerated', $_POST['regenerateSuccess']));
    419 
     396    {
     397      $page['infos'][] = l10n('%s photos have been regenerated', $_POST['regenerateSuccess']);
     398    }
    420399    if ($_POST['regenerateError'] != '0')
    421       array_push($page['warnings'], l10n('%s photos can not be regenerated', $_POST['regenerateError']));
    422 
     400    {
     401      $page['warnings'][] = l10n('%s photos can not be regenerated', $_POST['regenerateError']);
     402    }
    423403  }
    424404
     
    445425if ($conf['enable_synchronization'])
    446426{
    447   array_push($prefilters,
    448     array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'))
    449   );
     427  $prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'));
    450428}
    451429
  • trunk/admin/batch_manager_unit.php

    r19703 r25018  
    104104    }
    105105
    106     array_push($datas, $data);
     106    $datas[] = $data;
    107107
    108108    // tags management
     
    124124    );
    125125
    126   array_push($page['infos'], l10n('Photo informations updated'));
     126  $page['infos'][] = l10n('Photo informations updated');
    127127}
    128128
     
    233233  while ($row = pwg_db_fetch_assoc($result))
    234234  {
    235     array_push($element_ids, $row['id']);
     235    $element_ids[] = $row['id'];
    236236
    237237    $src_image = new SrcImage($row);
  • trunk/admin/cat_list.php

    r24985 r25018  
    7979    }
    8080   
    81     array_push($datas, array('id' => $id, 'rank' => $current_rank));
     81    $datas[] = array('id' => $id, 'rank' => $current_rank);
    8282  }
    8383  $fields = array('primary' => array('id'), 'update' => array('rank'));
     
    134134  if (isset($output_create['error']))
    135135  {
    136     array_push($page['errors'], $output_create['error']);
     136    $page['errors'][] = $output_create['error'];
    137137  }
    138138  else
    139139  {
    140     array_push($page['infos'], $output_create['info']);
     140    $page['infos'][] = $output_create['info'];
    141141  }
    142142}
     
    147147  save_categories_order(array_keys($_POST['catOrd']));
    148148
    149   array_push(
    150     $page['infos'],
    151     l10n('Album manual order was saved')
    152     );
     149  $page['infos'][] = l10n('Album manual order was saved');
    153150}
    154151else if (isset($_POST['submitAutoOrder']))
     
    179176  while ($row = pwg_db_fetch_assoc($result))
    180177  {
    181     array_push(
    182       $categories,
    183       array(
    184         'id' => $row['id'],
    185         'id_uppercat' => $row['id_uppercat'],
    186         )
     178    $categories[] = array(
     179      'id' => $row['id'],
     180      'id_uppercat' => $row['id_uppercat'],
    187181      );
    188     array_push(
    189       $names,
    190       $row['name']
    191       );
     182    $names[] = $row['name'];
    192183  }
    193184
     
    200191  save_categories_order($categories);
    201192
    202   array_push(
    203     $page['infos'],
    204     l10n('Albums automatically sorted')
    205     );
     193  $page['infos'][] = l10n('Albums automatically sorted');
    206194}
    207195
  • trunk/admin/cat_move.php

    r19703 r25018  
    5252  else
    5353  {
    54     array_push(
    55       $page['errors'],
    56       l10n('Select at least one album')
    57       );
     54    $page['errors'][] = l10n('Select at least one album');
    5855  }
    5956}
  • trunk/admin/cat_perm.php

    r23430 r25018  
    126126      while ($row = pwg_db_fetch_assoc($result))
    127127      {
    128         array_push($granteds[$row['cat_id']], $row['group_id']);
     128        $granteds[ $row['cat_id'] ][] = $row['group_id'];
    129129      }
    130130
     
    136136        foreach ($group_ids as $group_id)
    137137        {
    138           array_push(
    139             $inserts,
    140             array(
    141               'group_id' => $group_id,
    142               'cat_id' => $cat_id
    143               )
     138          $inserts[] = array(
     139            'group_id' => $group_id,
     140            'cat_id' => $cat_id
    144141            );
    145142        }
     
    191188  }
    192189
    193   array_push($page['infos'], l10n('Album updated successfully'));
     190  $page['infos'][] = l10n('Album updated successfully');
    194191}
    195192
     
    273270  while ($row = pwg_db_fetch_assoc($result))
    274271  {
    275     if (!isset($granted_groups[$row['group_id']]))
    276     {
    277       $granted_groups[$row['group_id']] = array();
    278     }
    279     array_push($granted_groups[$row['group_id']], $row['user_id']);
     272    if (!isset($granted_groups[ $row['group_id'] ]))
     273    {
     274      $granted_groups[ $row['group_id'] ] = array();
     275    }
     276    $granted_groups[ $row['group_id'] ][] = $row['user_id'];
    280277  }
    281278
     
    303300      if (in_array($user_id, $user_granted_indirect_ids))
    304301      {
    305         array_push($group_usernames, $users[$user_id]);
     302        $group_usernames[] = $users[$user_id];
    306303      }
    307304    }
  • trunk/admin/comments.php

    r19703 r25018  
    4242  if (empty($_POST['comments']))
    4343  {
    44     array_push(
    45       $page['errors'],
    46       l10n('Select at least one comment')
    47       );
     44    $page['errors'][] = l10n('Select at least one comment');
    4845  }
    4946  else
     
    5653      validate_user_comment($_POST['comments']);
    5754
    58       array_push(
    59         $page['infos'],
    60         l10n_dec(
    61           '%d user comment validated', '%d user comments validated',
    62           count($_POST['comments'])
    63           )
     55      $page['infos'][] = l10n_dec(
     56        '%d user comment validated', '%d user comments validated',
     57        count($_POST['comments'])
    6458        );
    6559    }
     
    6963      delete_user_comment($_POST['comments']);
    7064
    71       array_push(
    72         $page['infos'],
    73         l10n_dec(
    74           '%d user comment rejected', '%d user comments rejected',
    75           count($_POST['comments'])
    76           )
     65      $page['infos'][] = l10n_dec(
     66        '%d user comment rejected', '%d user comments rejected',
     67        count($_POST['comments'])
    7768        );
    7869    }
     
    149140    );
    150141
    151   array_push($list, $row['id']);
     142  $list[] = $row['id'];
    152143}
    153144
  • trunk/admin/configuration.php

    r23813 r25018  
    155155          if ( !count($_POST['order_by']) )
    156156          {
    157             array_push($page['errors'], l10n('No order field selected'));
     157            $page['errors'][] = l10n('No order field selected');
    158158          }
    159159          else
     
    180180        else
    181181        {
    182           array_push($page['errors'], l10n('No order field selected'));
     182          $page['errors'][] = l10n('No order field selected');
    183183        }
    184184      }
     
    208208           or $_POST['nb_comment_page'] > 50)
    209209      {
    210         array_push($page['errors'], l10n('The number of comments a page must be between 5 and 50 included.'));
     210        $page['errors'][] = l10n('The number of comments a page must be between 5 and 50 included.');
    211211      }
    212212      foreach( $comments_checkboxes as $checkbox)
     
    226226            or $_POST['nb_categories_page'] < 4)
    227227      {
    228         array_push($page['errors'], l10n('The number of albums a page must be above 4.'));
     228        $page['errors'][] = l10n('The number of albums a page must be above 4.');
    229229      }
    230230      foreach( $display_checkboxes as $checkbox)
     
    269269      }
    270270    }
    271     array_push($page['infos'], l10n('Information data registered in database'));
     271    $page['infos'][] = l10n('Information data registered in database');
    272272  }
    273273
     
    283283  clear_derivative_cache();
    284284
    285   array_push(
    286     $page['infos'],
    287     l10n('Your configuration settings are saved')
    288     );
     285  $page['infos'][] = l10n('Your configuration settings are saved');
    289286}
    290287
     
    325322    if (order_by_is_local())
    326323    {
    327       array_push($page['warnings'], l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !'));
     324      $page['warnings'][] = l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !');
    328325    }
    329326
     
    401398      // Reload user
    402399      $edit_user = build_user($conf['guest_id'], false);
    403       array_push($page['infos'], l10n('Information data registered in database'));
     400      $page['infos'][] = l10n('Information data registered in database');
    404401    }
    405402    $page['errors'] = array_merge($page['errors'], $errors);
  • trunk/admin/element_set_ranks.php

    r23813 r25018  
    6565  foreach ($images as $id)
    6666  {
    67     array_push(
    68       $datas,
    69       array(
    70         'category_id' => $category_id,
    71         'image_id' => $id,
    72         'rank' => ++$current_rank,
    73         )
     67    $datas[] = array(
     68      'category_id' => $category_id,
     69      'image_id' => $id,
     70      'rank' => ++$current_rank,
    7471      );
    7572  }
     
    9996      );
    10097
    101     array_push(
    102       $page['infos'],
    103       l10n('Images manual order was saved')
    104       );
     98    $page['infos'][] = l10n('Images manual order was saved');
    10599  }
    106100
     
    144138  }
    145139
    146   array_push($page['infos'], l10n('Your configuration settings are saved'));
     140  $page['infos'][] = l10n('Your configuration settings are saved');
    147141}
    148142
  • trunk/admin/extend_for_templates.php

    r21567 r25018  
    150150  if (pwg_query($query))
    151151  {
    152     array_push($page['infos'],
    153       l10n('Templates configuration has been recorded.'));
     152    $page['infos'][] = l10n('Templates configuration has been recorded.');
    154153  }
    155154}
  • trunk/admin/group_list.php

    r25005 r25018  
    4646  if (empty($_POST['groupname']))
    4747  {
    48     array_push($page['errors'], l10n('The name of a group must not contain " or \' or be empty.'));
     48    $page['errors'][] = l10n('The name of a group must not contain " or \' or be empty.');
    4949  }
    5050  if (count($page['errors']) == 0)
     
    5959    if ($count != 0)
    6060    {
    61       array_push($page['errors'], l10n('This name is already used by another group.'));
     61      $page['errors'][] = l10n('This name is already used by another group.');
    6262    }
    6363  }
     
    8787  if (count($groups) == 0)
    8888  {
    89     array_push($page['errors'], l10n('Select at least one group'));
     89    $page['errors'][] = l10n('Select at least one group');
    9090  }
    9191
     
    170170    if ($count != 0)
    171171    {
    172       array_push($page['errors'], l10n('This name is already used by another group.'));
     172      $page['errors'][] = l10n('This name is already used by another group.');
    173173    }
    174174    else
     
    256256      if ($count != 0)
    257257      {
    258         array_push($page['errors'], l10n('This name is already used by another group.'));
     258        $page['errors'][] = l10n('This name is already used by another group.');
    259259        break;
    260260      }
  • trunk/admin/group_perm.php

    r25005 r25018  
    8282  while ($row = pwg_db_fetch_assoc($result))
    8383  {
    84     array_push($private_uppercats, $row['id']);
     84    $private_uppercats[] = $row['id'];
    8585  }
    8686
     
    9999  while ($row = pwg_db_fetch_assoc($result))
    100100  {
    101     array_push($authorized_ids, $row['cat_id']);
     101    $authorized_ids[] = $row['cat_id'];
    102102  }
    103103
     
    106106  foreach ($to_autorize_ids as $to_autorize_id)
    107107  {
    108     array_push(
    109       $inserts,
    110       array(
    111         'group_id' => $page['group'],
    112         'cat_id' => $to_autorize_id
    113         )
     108    $inserts[] = array(
     109      'group_id' => $page['group'],
     110      'cat_id' => $to_autorize_id
    114111      );
    115112  }
     
    159156while ($row = pwg_db_fetch_assoc($result))
    160157{
    161   array_push($authorized_ids, $row['id']);
     158  $authorized_ids[] = $row['id'];
    162159}
    163160
  • trunk/admin/history.php

    r25005 r25018  
    165165  else
    166166  {
    167     array_push($page['errors'], l10n('Empty query. No criteria has been entered.'));
     167    $page['errors'][] = l10n('Empty query. No criteria has been entered.');
    168168  }
    169169}
  • trunk/admin/include/check_integrity.class.php

    r19703 r25018  
    7272    if (count($this->retrieve_list) > 0)
    7373    {
    74       $header_notes[] =
    75         l10n_dec('%d anomaly has been detected.', '%d anomalies have been detected.',
    76           count($this->retrieve_list));
     74      $header_notes[] = l10n_dec(
     75        '%d anomaly has been detected.', '%d anomalies have been detected.',
     76        count($this->retrieve_list)
     77        );
    7778    }
    7879
     
    117118      if ($corrected_count > 0)
    118119      {
    119         $page['infos'][] =
    120           l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
    121             $corrected_count);
     120        $page['infos'][] = l10n_dec(
     121          '%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
     122          $corrected_count
     123          );
    122124      }
    123125      if ($not_corrected_count > 0)
    124126      {
    125         $page['errors'][] =
    126           l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
    127             $not_corrected_count);
     127        $page['errors'][] = l10n_dec(
     128          '%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
     129          $not_corrected_count
     130          );
    128131      }
    129132    }
     
    146149        if ($ignored_count > 0)
    147150        {
    148           $page['infos'][] =
    149             l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
    150               $ignored_count);
     151          $page['infos'][] = l10n_dec(
     152            '%d anomaly has been ignored.', '%d anomalies have been ignored.',
     153            $ignored_count
     154            );
    151155        }
    152156      }
  • trunk/admin/include/configuration_sizes_process.inc.php

    r19703 r25018  
    255255  }
    256256
    257   array_push(
    258     $page['infos'],
    259     l10n('Your configuration settings are saved')
    260     );
     257  $page['infos'][] = l10n('Your configuration settings are saved');
    261258}
    262259else
  • trunk/admin/include/configuration_watermark_process.inc.php

    r19703 r25018  
    175175  }
    176176
    177   array_push(
    178     $page['infos'],
    179     l10n('Your configuration settings are saved')
    180     );
     177  $page['infos'][] = l10n('Your configuration settings are saved');
    181178}
    182179else
  • trunk/admin/include/functions.php

    r24987 r25018  
    541541            and is_dir($path.'/'.$node))
    542542        {
    543           array_push($dirs, $path.'/'.$node);
     543          $dirs[] = $path.'/'.$node;
    544544          if ($recursive)
    545545          {
     
    748748    list($representative) = pwg_db_fetch_row(pwg_query($query));
    749749
    750     array_push(
    751       $datas,
    752       array(
    753         'id' => $category_id,
    754         'representative_picture_id' => $representative,
    755         )
     750    $datas[] = array(
     751      'id' => $category_id,
     752      'representative_picture_id' => $representative,
    756753      );
    757754  }
     
    863860            if (basename($path) == 'thumbnail')
    864861            {
    865               array_push($fs['thumbnails'], $path.'/'.$node);
     862              $fs['thumbnails'][] = $path.'/'.$node;
    866863            }
    867864            else if (basename($path) == 'pwg_representative')
    868865            {
    869               array_push($fs['representatives'], $path.'/'.$node);
     866              $fs['representatives'][] = $path.'/'.$node;
    870867            }
    871868            else
    872869            {
    873               array_push($fs['elements'], $path.'/'.$node);
     870              $fs['elements'][] = $path.'/'.$node;
    874871            }
    875872          }
     
    877874          else if (isset($conf['flip_file_ext'][$extension]))
    878875          {
    879             array_push($fs['elements'], $path.'/'.$node);
     876            $fs['elements'][] = $path.'/'.$node;
    880877          }
    881878        }
    882879        else if (is_dir($path.'/'.$node) and $node != 'pwg_high' and $recursive)
    883880        {
    884           array_push($subdirs, $node);
     881          $subdirs[] = $node;
    885882        }
    886883      }
     
    996993    while ($uppercat)
    997994    {
    998       array_push($upper_list, $uppercat);
     995      $upper_list[] = $uppercat;
    999996      $uppercat = $cat_map[$uppercat]['id_uppercat'];
    1000997    }
     
    10031000    if ($new_uppercats != $cat['uppercats'])
    10041001    {
    1005       array_push(
    1006         $datas,
    1007         array(
    1008           'id' => $id,
    1009           'uppercats' => $new_uppercats
    1010           )
     1002      $datas[] = array(
     1003        'id' => $id,
     1004        'uppercats' => $new_uppercats
    10111005        );
    10121006    }
     
    10961090      if (preg_match('/^'.$category['uppercats'].'(,|$)/', $new_parent_uppercats))
    10971091      {
    1098         array_push(
    1099           $page['errors'],
    1100           l10n('You cannot move an album in its own sub album')
    1101           );
     1092        $page['errors'][] = l10n('You cannot move an album in its own sub album');
    11021093        return;
    11031094      }
     
    11781169  }
    11791170
    1180   array_push(
    1181     $page['infos'],
    1182     l10n_dec(
    1183       '%d album moved', '%d albums moved',
    1184       count($categories)
    1185       )
     1171  $page['infos'][] = l10n_dec(
     1172    '%d album moved', '%d albums moved',
     1173    count($categories)
    11861174    );
    11871175}
     
    13081296    foreach ($granted_grps as $granted_grp)
    13091297    {
    1310       array_push(
    1311         $inserts,
    1312         array(
    1313           'group_id' => $granted_grp,
    1314           'cat_id' => $inserted_id
    1315           )
     1298      $inserts[] = array(
     1299        'group_id' => $granted_grp,
     1300        'cat_id' => $inserted_id
    13161301        );
    13171302    }
     
    15871572        $rank = ++$current_rank_of[$category_id];
    15881573
    1589         array_push(
    1590           $inserts,
    1591           array(
    1592             'image_id' => $image_id,
    1593             'category_id' => $category_id,
    1594             'rank' => $rank,
    1595             )
     1574        $inserts[] = array(
     1575          'image_id' => $image_id,
     1576          'category_id' => $category_id,
     1577          'rank' => $rank,
    15961578          );
    15971579      }
     
    23162298  while ($row = pwg_db_fetch_assoc($result))
    23172299  {
    2318     array_push($granteds[$row['cat_id']], $row['user_id']);
     2300    $granteds[ $row['cat_id'] ][] = $row['user_id'];
    23192301  }
    23202302
     
    23272309    foreach ($grant_to_users as $user_id)
    23282310    {
    2329       array_push(
    2330         $inserts,
    2331         array(
    2332           'user_id' => $user_id,
    2333           'cat_id' => $cat_id
    2334           )
     2311      $inserts[] = array(
     2312        'user_id' => $user_id,
     2313        'cat_id' => $cat_id
    23352314        );
    23362315    }
     
    25142493          and $file != '.svn')
    25152494      {
    2516         array_push($sub_dirs, $file);
     2495        $sub_dirs[] = $file;
    25172496      }
    25182497    }
  • trunk/admin/include/functions_history.inc.php

    r19703 r25018  
    5959  if (isset($search['fields']['date-after']))
    6060  {
    61     array_push(
    62       $clauses,
    63       "date >= '".$search['fields']['date-after']."'"
    64       );
     61    $clauses[] = "date >= '".$search['fields']['date-after']."'";
    6562  }
    6663
    6764  if (isset($search['fields']['date-before']))
    6865  {
    69     array_push(
    70       $clauses,
    71       "date <= '".$search['fields']['date-before']."'"
    72       );
     66    $clauses[] = "date <= '".$search['fields']['date-before']."'";
    7367  }
    7468
     
    8983        }
    9084       
    91         array_push($local_clauses, $clause);
     85        $local_clauses[] = $clause;
    9286      }
    9387    }
     
    9589    if (count($local_clauses) > 0)
    9690    {
    97       array_push(
    98         $clauses,
    99         implode(' OR ', $local_clauses)
    100         );
     91      $clauses[] = implode(' OR ', $local_clauses);
    10192    }
    10293  }
     
    10596      and $search['fields']['user'] != -1)
    10697  {
    107     array_push(
    108       $clauses,
    109       'user_id = '.$search['fields']['user']
    110       );
     98    $clauses[] = 'user_id = '.$search['fields']['user'];
    11199  }
    112100
    113101  if (isset($search['fields']['image_id']))
    114102  {
    115     array_push(
    116       $clauses,
    117       'image_id = '.$search['fields']['image_id']
    118       );
     103    $clauses[] = 'image_id = '.$search['fields']['image_id'];
    119104  }
    120105 
     
    124109    {
    125110      // a clause that is always false
    126       array_push($clauses, '1 = 2 ');
     111      $clauses[] = '1 = 2 ';
    127112    }
    128113    else
    129114    {
    130       array_push(
    131         $clauses,
    132         'image_id IN ('.implode(', ', $search['image_ids']).')'
    133         );
     115      $clauses[] = 'image_id IN ('.implode(', ', $search['image_ids']).')';
    134116    }
    135117  }
     
    169151  while ($row = pwg_db_fetch_assoc($result))
    170152  {
    171     array_push($data, $row);
     153    $data[] = $row;
    172154  }
    173155
  • trunk/admin/include/functions_install.inc.php

    r20721 r25018  
    9797  catch (Exception $e)
    9898  {
    99     array_push( $errors, l10n($e->getMessage()));
     99    $errors[] = l10n($e->getMessage());
    100100  }
    101101}
  • trunk/admin/include/functions_metadata.php

    r19703 r25018  
    220220        foreach (explode(',', $data[$key]) as $tag_name)
    221221        {
    222           array_push(
    223             $tags_of[$id],
    224             tag_id_from_tag_name($tag_name)
    225             );
     222          $tags_of[$id][] = tag_id_from_tag_name($tag_name);
    226223        }
    227224      }
     
    230227    $data['date_metadata_update'] = CURRENT_DATE;
    231228
    232     array_push($datas, $data);
     229    $datas[] = $data;
    233230  }
    234231
     
    236233  {
    237234    $update_fields = get_sync_metadata_attributes();
    238     array_push($update_fields, 'date_metadata_update');
     235    $update_fields[] = 'date_metadata_update';
    239236
    240237    $update_fields = array_diff(
     
    298295  while ($row = pwg_db_fetch_assoc($result))
    299296  {
    300     array_push($cat_ids, $row['id']);
     297    $cat_ids[] = $row['id'];
    301298  }
    302299
  • trunk/admin/include/functions_notification_by_mail.inc.php

    r19703 r25018  
    170170      while ($nbm_user = pwg_db_fetch_assoc($result))
    171171      {
    172         array_push($data_users, $nbm_user);
     172        $data_users[] = $nbm_user;
    173173      }
    174174    }
     
    286286
    287287  $env_nbm['sent_mail_count'] += 1;
    288   array_push($page['infos'], sprintf($env_nbm['msg_info'], stripslashes($nbm_user['username']), $nbm_user['mail_address']));
     288  $page['infos'][] = sprintf($env_nbm['msg_info'], stripslashes($nbm_user['username']), $nbm_user['mail_address']);
    289289}
    290290
     
    299299
    300300  $env_nbm['error_on_mail_count'] += 1;
    301   array_push($page['errors'], sprintf($env_nbm['msg_error'], stripslashes($nbm_user['username']), $nbm_user['mail_address']));
     301  $page['errors'][] = sprintf($env_nbm['msg_error'], stripslashes($nbm_user['username']), $nbm_user['mail_address']);
    302302}
    303303
     
    313313  if ($env_nbm['error_on_mail_count'] != 0)
    314314  {
    315     array_push($page['errors'], l10n_dec('%d mail was not sent.', '%d mails were not sent.', $env_nbm['error_on_mail_count']));
     315    $page['errors'][] = l10n_dec(
     316      '%d mail was not sent.', '%d mails were not sent.',
     317      $env_nbm['error_on_mail_count']
     318      );
     319     
    316320    if ($env_nbm['sent_mail_count'] != 0)
    317       array_push($page['infos'], l10n_dec('%d mail was sent.', '%d mails were sent.', $env_nbm['sent_mail_count']));
     321    {
     322      $page['infos'][] = l10n_dec(
     323        '%d mail was sent.', '%d mails were sent.',
     324        $env_nbm['sent_mail_count']
     325        );
     326    }
    318327  }
    319328  else
    320329  {
    321330    if ($env_nbm['sent_mail_count'] == 0)
    322       array_push($page['infos'], l10n('No mail to send.'));
     331    {
     332      $page['infos'][] = l10n('No mail to send.');
     333    }
    323334    else
    324       array_push($page['infos'], l10n_dec('%d mail was sent.', '%d mails were sent.', $env_nbm['sent_mail_count']));
     335    {
     336      $page['infos'][] = l10n_dec(
     337        '%d mail was sent.', '%d mails were sent.',
     338        $env_nbm['sent_mail_count']
     339        );
     340    }
    325341  }
    326342}
     
    395411      {
    396412        // Stop fill list on 'send', if the quota is override
    397         array_push($page['errors'], $msg_break_timeout);
     413        $page['errors'][] = $msg_break_timeout;
    398414        break;
    399415      }
    400416
    401417      // Fill return list
    402       array_push($check_key_treated, $nbm_user['check_key']);
     418      $check_key_treated[] = $nbm_user['check_key'];
    403419
    404420      $do_update = true;
     
    454470      if ($do_update)
    455471      {
    456         array_push
    457         (
    458           $updates,
    459           array
    460           (
    461             'check_key' => $nbm_user['check_key'],
    462             'enabled' => $enabled_value
    463           )
    464         );
     472        $updates[] = array(
     473          'check_key' => $nbm_user['check_key'],
     474          'enabled' => $enabled_value
     475          );
    465476        $updated_data_count += 1;
    466         array_push($page['infos'], sprintf($msg_info, stripslashes($nbm_user['username']), $nbm_user['mail_address']));
     477        $page['infos'][] = sprintf($msg_info, stripslashes($nbm_user['username']), $nbm_user['mail_address']);
    467478      }
    468479      else
    469480      {
    470481        $error_on_updated_data_count += 1;
    471         array_push($page['errors'], sprintf($msg_error, stripslashes($nbm_user['username']), $nbm_user['mail_address']));
     482        $page['errors'][] = sprintf($msg_error, stripslashes($nbm_user['username']), $nbm_user['mail_address']);
    472483      }
    473484
     
    490501  }
    491502
    492   array_push($page['infos'], l10n_dec('%d user was updated.', '%d users were updated.', $updated_data_count));
     503  $page['infos'][] = l10n_dec(
     504    '%d user was updated.', '%d users were updated.',
     505    $updated_data_count
     506    );
     507 
    493508  if ($error_on_updated_data_count != 0)
    494509  {
    495     array_push($page['errors'],
    496       l10n_dec('%d user was not updated.',
    497                '%d users were not updated.',
    498                $error_on_updated_data_count));
     510    $page['errors'][] = l10n_dec(
     511      '%d user was not updated.', '%d users were not updated.',
     512      $error_on_updated_data_count
     513      );
    499514  }
    500515
  • trunk/admin/include/functions_plugins.inc.php

    r19703 r25018  
    4040  else if (isset($page['errors']))
    4141  {
    42     array_push($page['errors'], 'PLUGIN ERROR: "'.$file.'" is not a valid file');
     42    $page['errors'][] = 'PLUGIN ERROR: "'.$file.'" is not a valid file';
    4343  }
    4444  return $url;
  • trunk/admin/include/functions_upgrade.php

    r20720 r25018  
    9494  while ($row = pwg_db_fetch_assoc($result))
    9595  {
    96     array_push($plugins, $row['id']);
     96    $plugins[] = $row['id'];
    9797  }
    9898
     
    106106    pwg_query($query);
    107107
    108     array_push($page['infos'],
    109       l10n('As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:').'<p><i>'.implode(', ', $plugins).'</i></p>');
     108    $page['infos'][] = l10n('As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:')
     109                        .'<p><i>'.implode(', ', $plugins).'</i></p>';
    110110  }
    111111}
     
    136136  while ($row = pwg_db_fetch_assoc($result))
    137137  {
    138     array_push($theme_ids, $row['id']);
    139     array_push($theme_names, $row['name']);
     138    $theme_ids[] = $row['id'];
     139    $theme_names[] = $row['name'];
    140140  }
    141141
     
    149149    pwg_query($query);
    150150
    151     array_push($page['infos'],
    152       l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:').'<p><i>'.implode(', ', $theme_names).'</i></p>');
     151    $page['infos'][] = l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:')
     152                        .'<p><i>'.implode(', ', $theme_names).'</i></p>';
    153153
    154154    // what is the default theme?
     
    250250  if (!$conf['password_verify']($password, $row['password']))
    251251  {
    252     array_push($page['errors'], l10n('Invalid password!'));
     252    $page['errors'][] = l10n('Invalid password!');
    253253  }
    254254  elseif ($row['status'] != 'admin' and $row['status'] != 'webmaster')
    255255  {
    256     array_push($page['errors'], l10n('You do not have access rights to run upgrade'));
     256    $page['errors'][] = l10n('You do not have access rights to run upgrade');
    257257  }
    258258  else
     
    280280          and preg_match('/^(.*?)-database\.php$/', $node, $match))
    281281      {
    282         array_push($available_upgrade_ids, $match[1]);
     282        $available_upgrade_ids[] = $match[1];
    283283      }
    284284    }
  • trunk/admin/include/functions_upload.inc.php

    r19703 r25018  
    123123      else
    124124      {
    125         array_push(
    126           $errors,
    127           sprintf(
    128             $upload_form_config[$field]['error_message'],
    129             $min,
    130             $max
    131             )
     125        $errors[] = sprintf(
     126          $upload_form_config[$field]['error_message'],
     127          $min, $max
    132128          );
    133129       
     
    495491function add_upload_error($upload_id, $error_message)
    496492{
    497   if (!isset($_SESSION['uploads_error']))
    498   {
    499     $_SESSION['uploads_error'] = array();
    500   }
    501   if (!isset($_SESSION['uploads_error'][$upload_id]))
    502   {
    503     $_SESSION['uploads_error'][$upload_id] = array();
    504   }
    505 
    506   array_push($_SESSION['uploads_error'][$upload_id], $error_message);
     493  $_SESSION['uploads_error'][$upload_id][] = $error_message;
    507494}
    508495
  • trunk/admin/include/languages.class.php

    r23821 r25018  
    5858        if (isset($crt_db_language))
    5959        {
    60           array_push($errors, 'CANNOT ACTIVATE - LANGUAGE IS ALREADY ACTIVATED');
     60          $errors[] = 'CANNOT ACTIVATE - LANGUAGE IS ALREADY ACTIVATED';
    6161          break;
    6262        }
     
    7575        if (!isset($crt_db_language))
    7676        {
    77           array_push($errors, 'CANNOT DEACTIVATE - LANGUAGE IS ALREADY DEACTIVATED');
     77          $errors[] = 'CANNOT DEACTIVATE - LANGUAGE IS ALREADY DEACTIVATED';
    7878          break;
    7979        }
     
    8181        if ($language_id == get_default_language())
    8282        {
    83           array_push($errors, 'CANNOT DEACTIVATE - LANGUAGE IS DEFAULT LANGUAGE');
     83          $errors[] = 'CANNOT DEACTIVATE - LANGUAGE IS DEFAULT LANGUAGE';
    8484          break;
    8585        }
     
    9696        if (!empty($crt_db_language))
    9797        {
    98           array_push($errors, 'CANNOT DELETE - LANGUAGE IS ACTIVATED');
     98          $errors[] = 'CANNOT DELETE - LANGUAGE IS ACTIVATED';
    9999          break;
    100100        }
    101101        if (!isset($this->fs_languages[$language_id]))
    102102        {
    103           array_push($errors, 'CANNOT DELETE - LANGUAGE DOES NOT EXIST');
     103          $errors[] = 'CANNOT DELETE - LANGUAGE DOES NOT EXIST';
    104104          break;
    105105        }
     
    369369                  and !empty($old_files))
    370370                {
    371                   array_push($old_files, 'obsolete.list');
     371                  $old_files[] = 'obsolete.list';
    372372                  foreach($old_files as $old_file)
    373373                  {
  • trunk/admin/include/photos_add_direct_prepare.inc.php

    r23944 r25018  
    210210if (!empty($error_message))
    211211{
    212   array_push($setup_errors, $error_message);
     212  $setup_errors[] = $error_message;
    213213}
    214214
    215215if (!function_exists('gd_info'))
    216216{
    217   array_push($setup_errors, l10n('GD library is missing'));
     217  $setup_errors[] = l10n('GD library is missing');
    218218}
    219219
     
    236236  if ($conf['use_exif'] and !function_exists('read_exif_data'))
    237237  {
    238     array_push(
    239       $setup_warnings,
    240       l10n('Exif extension not available, admin should disable exif use')
    241       );
     238    $setup_warnings[] = l10n('Exif extension not available, admin should disable exif use');
    242239  }
    243240
    244241  if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
    245242  {
    246     array_push(
    247       $setup_warnings,
    248       sprintf(
    249         l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'),
    250         get_ini_size('upload_max_filesize', false),
    251         get_ini_size('post_max_size', false)
    252         )
     243    $setup_warnings[] = l10n(
     244      'In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting',
     245      get_ini_size('upload_max_filesize', false),
     246      get_ini_size('post_max_size', false)
    253247      );
    254248  }
  • trunk/admin/include/photos_add_direct_process.inc.php

    r19703 r25018  
    3535  if (!isset($_POST['submit_upload']))
    3636  {
    37     array_push(
    38       $page['errors'],
    39       sprintf(
    40         l10n('The uploaded files exceed the post_max_size directive in php.ini: %sB'),
    41         ini_get('post_max_size')
    42         )
     37    $page['errors'][] = l10n(
     38      'The uploaded files exceed the post_max_size directive in php.ini: %sB',
     39      ini_get('post_max_size')
    4340      );
    4441  }
     
    5249    foreach ($_POST['onUploadError'] as $error)
    5350    {
    54       array_push($page['errors'], $error);
     51      $page['errors'][] = $error;
    5552    }
    5653  }
     
    9895            if (is_valid_image_extension(pathinfo($node['filename'], PATHINFO_EXTENSION)))
    9996            {
    100               array_push($indexes_to_extract, $node['index']);
     97              $indexes_to_extract[] = $node['index'];
    10198             
    102               array_push(
    103                 $images_to_add,
    104                 array(
    105                   'source_filepath' => $upload_dir.'/'.$temporary_archive_name.'/'.$node['filename'],
    106                   'original_filename' => basename($node['filename']),
    107                   )
     99              $images_to_add[] = array(
     100                'source_filepath' => $upload_dir.'/'.$temporary_archive_name.'/'.$node['filename'],
     101                'original_filename' => basename($node['filename']),
    108102                );
    109103            }
     
    122116      elseif (is_valid_image_extension($extension))
    123117      {
    124         array_push(
    125           $images_to_add,
    126           array(
    127             'source_filepath' => $_FILES['image_upload']['tmp_name'][$idx],
    128             'original_filename' => $_FILES['image_upload']['name'][$idx],
    129             )
     118        $images_to_add[] = array(
     119          'source_filepath' => $_FILES['image_upload']['tmp_name'][$idx],
     120          'original_filename' => $_FILES['image_upload']['name'][$idx],
    130121          );
    131122      }
     
    140131          );
    141132
    142         array_push($image_ids, $image_id);
     133        $image_ids[] = $image_id;
    143134
    144135        // TODO: if $image_id is not an integer, something went wrong
     
    149140      $error_message = file_upload_error_message($error);
    150141     
    151       array_push(
    152         $page['errors'],
    153         sprintf(
    154           l10n('Error on file "%s" : %s'),
    155           $_FILES['image_upload']['name'][$idx],
    156           $error_message
    157           )
     142      $page['errors'][] = l10n(
     143        'Error on file "%s" : %s',
     144        $_FILES['image_upload']['name'][$idx],
     145        $error_message
    158146        );
    159147    }
     
    173161      foreach ($_SESSION['uploads_error'][ $_POST['upload_id'] ] as $error)
    174162      {
    175         array_push($page['errors'], $error);
     163        $page['errors'][] = $error;
    176164      }
    177165    }
     
    217205    $thumbnail['link'] = get_root_url().'admin.php?page=photo-'.$image_id.'&amp;cat_id='.$category_id;
    218206
    219     array_push($page['thumbnails'], $thumbnail);
     207    $page['thumbnails'][] = $thumbnail;
    220208  }
    221209 
    222210  if (!empty($page['thumbnails']))
    223211  {
    224     array_push(
    225       $page['infos'],
    226       sprintf(
    227         l10n('%d photos uploaded'),
    228         count($page['thumbnails'])
    229         )
    230       );
     212    $page['infos'][] = l10n('%d photos uploaded', count($page['thumbnails']));
    231213   
    232214    if (0 != $_POST['level'])
    233215    {
    234       array_push(
    235         $page['infos'],
    236         sprintf(
    237           l10n('Privacy level set to "%s"'),
    238           l10n(
    239             sprintf('Level %d', $_POST['level'])
    240             )
    241           )
     216      $page['infos'][] = l10n(
     217        'Privacy level set to "%s"',
     218        l10n(sprintf('Level %d', $_POST['level']))
    242219        );
    243220    }
     
    253230   
    254231    // information
    255     array_push(
    256       $page['infos'],
    257       sprintf(
    258         l10n('Album "%s" now contains %d photos'),
    259         '<em>'.$category_name.'</em>',
    260         $count
    261         )
     232    $page['infos'][] = l10n(
     233      'Album "%s" now contains %d photos',
     234      '<em>'.$category_name.'</em>',
     235      $count
    262236      );
    263237   
  • trunk/admin/include/plugins.class.php

    r24159 r25018  
    400400          $server_plugins[$plugin['extension_id']] = array();
    401401        }
    402         array_push($server_plugins[$plugin['extension_id']], $plugin['revision_name']);
     402        $server_plugins[$plugin['extension_id']][] = $plugin['revision_name'];
    403403      }
    404404
     
    504504                and !empty($old_files))
    505505              {
    506                 array_push($old_files, 'obsolete.list');
     506                $old_files[] = 'obsolete.list';
    507507                foreach($old_files as $old_file)
    508508                {
  • trunk/admin/include/themes.class.php

    r23821 r25018  
    7878        if (isset($missing_parent))
    7979        {
    80           array_push(
    81             $errors,
    82             sprintf(
    83               l10n('Impossible to activate this theme, the parent theme is missing: %s'),
    84               $missing_parent
    85               )
     80          $errors[] = l10n(
     81            'Impossible to activate this theme, the parent theme is missing: %s',
     82            $missing_parent
    8683            );
    8784
     
    9491            and $conf['mobile_theme'] != $theme_id)
    9592        {
    96           array_push($errors, l10n('You can activate only one mobile theme.'));
     93          $errors[] = l10n('You can activate only one mobile theme.');
    9794          break;
    9895        }
     
    135132        if (count($this->db_themes_by_id) <= 1)
    136133        {
    137           array_push(
    138             $errors,
    139             l10n('Impossible to deactivate this theme, you need at least one theme.')
    140             );
     134          $errors[] = l10n('Impossible to deactivate this theme, you need at least one theme.');
    141135          break;
    142136        }
     
    191185        if (!empty($crt_db_theme))
    192186        {
    193           array_push($errors, 'CANNOT DELETE - THEME IS INSTALLED');
     187          $errors[] = 'CANNOT DELETE - THEME IS INSTALLED';
    194188          break;
    195189        }
     
    203197        if (count($children) > 0)
    204198        {
    205           array_push(
    206             $errors,
    207             sprintf(
    208               l10n('Impossible to delete this theme. Other themes depends on it: %s'),
    209               implode(', ', $children)
    210               )
     199          $errors[] = l10n(
     200            'Impossible to delete this theme. Other themes depends on it: %s',
     201            implode(', ', $children)
    211202            );
    212203          break;
     
    263254      if (isset($test_child['parent']) and $test_child['parent'] == $theme_id)
    264255      {
    265         array_push($children, $test_child['name']);
     256        $children[] = $test_child['name'];
    266257      }
    267258    }
     
    323314    while ($row = pwg_db_fetch_assoc($result))
    324315    {
    325       array_push($themes, $row);
     316      $themes[] = $row;
    326317    }
    327318    return $themes;
     
    629620                and !empty($old_files))
    630621              {
    631                 array_push($old_files, 'obsolete.list');
     622                $old_files[] = 'obsolete.list';
    632623                foreach($old_files as $old_file)
    633624                {
  • trunk/admin/include/updates.class.php

    r23821 r25018  
    162162            if (in_array($ext_id, $conf['updates_ignored'][$type]))
    163163            {
    164               array_push($ignore_list, $ext_id);
     164              $ignore_list[] = $ext_id;
    165165            }
    166166            else
     
    249249      and !empty($old_files))
    250250    {
    251       array_push($old_files, $file);
     251      $old_files[] = $file;
    252252      foreach($old_files as $old_file)
    253253      {
     
    315315    else
    316316    {
    317       array_push($page['errors'], l10n('Unable to dump database.'));
     317      $page['errors'][] = l10n('Unable to dump database.');
    318318    }
    319319  }
     
    415415            if ($step == 2)
    416416            {
    417               array_push($page['infos'], l10n('Update Complete'), $upgrade_to);
     417              $page['infos'][] = l10n('Update Complete');
     418              $page['infos'][] = $upgrade_to;
    418419              $step = -1;
    419420            }
     
    426427          {
    427428            file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'update/log_error.txt', $error);
    428             array_push(
    429               $page['errors'],
    430               sprintf(
    431                 l10n('An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'),
    432                 get_root_url().$conf['data_location'].'update/log_error.txt'
    433               )
    434             );
     429           
     430            $page['errors'][] = l10n(
     431              'An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.',
     432              get_root_url().$conf['data_location'].'update/log_error.txt'
     433              );
    435434          }
    436435        }
     
    438437        {
    439438          deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update');
    440           array_push($page['errors'], l10n('An error has occured during upgrade.'));
     439          $page['errors'][] = l10n('An error has occured during upgrade.');
    441440        }
    442441      }
    443442      else
    444443      {
    445         array_push($page['errors'], l10n('Piwigo cannot retrieve upgrade file from server'));
     444        $page['errors'][] = l10n('Piwigo cannot retrieve upgrade file from server');
    446445      }
    447446    }
  • trunk/admin/include/uploadify/uploadify.php

    r15598 r25018  
    4848  );
    4949
    50 if (!isset($_SESSION['uploads']))
    51 {
    52   $_SESSION['uploads'] = array();
    53 }
    54 
    55 if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ]))
    56 {
    57   $_SESSION['uploads'][ $_POST['upload_id'] ] = array();
    58 }
    59 
    60 array_push(
    61   $_SESSION['uploads'][ $_POST['upload_id'] ],
    62   $image_id
    63   );
     50$_SESSION['uploads'][ $_POST['upload_id'] ][] = $image_id;
    6451
    6552$query = '
  • trunk/admin/intro.php

    r25005 r25018  
    4646  if (!fetchRemote(PHPWG_URL.'/download/latest_version', $result))
    4747  {
    48     array_push($page['errors'], l10n('Unable to check for upgrade.'));
     48    $page['errors'][] = l10n('Unable to check for upgrade.');
    4949  }
    5050  else
     
    7474    if ('' == $versions['latest'])
    7575    {
    76       array_push(
    77         $page['errors'],
    78         l10n('Check for upgrade failed for unknown reasons.')
    79         );
     76      $page['errors'][] = l10n('Check for upgrade failed for unknown reasons.');
    8077    }
    8178    // concatenation needed to avoid automatic transformation by release
     
    8380    else if ('%'.'PWGVERSION'.'%' == $versions['current'])
    8481    {
    85       array_push(
    86         $page['infos'],
    87         l10n('You are running on development sources, no check possible.')
    88         );
     82      $page['infos'][] = l10n('You are running on development sources, no check possible.');
    8983    }
    9084    else if (version_compare($versions['current'], $versions['latest']) < 0)
    9185    {
    92       array_push(
    93         $page['infos'],
    94         l10n('A new version of Piwigo is available.')
    95         );
     86      $page['infos'][] = l10n('A new version of Piwigo is available.');
    9687    }
    9788    else
    9889    {
    99       array_push(
    100         $page['infos'],
    101         l10n('You are running the latest version of Piwigo.')
    102         );
     90      $page['infos'][] = l10n('You are running the latest version of Piwigo.');
    10391    }
    10492  }
     
    202190    'DB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $nb_elements),
    203191    'DB_CATEGORIES' =>
    204       l10n_dec('%d album including', '%d albums including',
    205         $nb_categories).
    206       l10n_dec('%d physical', '%d physicals',
    207         $nb_physical).
    208       l10n_dec(' and %d virtual', ' and %d virtuals',
    209         $nb_virtual),
     192      l10n_dec('%d album including', '%d albums including', $nb_categories).
     193      l10n_dec('%d physical', '%d physicals', $nb_physical).
     194      l10n_dec(' and %d virtual', ' and %d virtuals', $nb_virtual),
    210195    'DB_IMAGE_CATEGORY' => l10n_dec('%d association', '%d associations', $nb_image_category),
    211196    'DB_TAGS' => l10n_dec('%d tag', '%d tags', $nb_tags),
  • trunk/admin/languages_installed.php

    r10594 r25018  
    8888  {
    8989    $language['is_default'] = false;
    90     array_push($tpl_languages, $language);
     90    $tpl_languages[] = $language;
    9191  }
    9292}
  • trunk/admin/languages_new.php

    r25005 r25018  
    5454  if (!is_webmaster())
    5555  {
    56     array_push($page['errors'], l10n('Webmaster status is required.'));
     56    $page['errors'][] = l10n('Webmaster status is required.');
    5757  }
    5858  else
     
    7474  {
    7575    case 'ok':
    76       array_push($page['infos'],
    77         l10n('Language has been successfully installed')
    78       );
     76      $page['infos'][] = l10n('Language has been successfully installed');
    7977      break;
    8078
    8179    case 'temp_path_error':
    82       array_push($page['errors'], l10n('Can\'t create temporary file.'));
     80      $page['errors'][] = l10n('Can\'t create temporary file.');
    8381      break;
    8482
    8583    case 'dl_archive_error':
    86       array_push($page['errors'], l10n('Can\'t download archive.'));
     84      $page['errors'][] = l10n('Can\'t download archive.');
    8785      break;
    8886
    8987    case 'archive_error':
    90       array_push($page['errors'], l10n('Can\'t read or extract archive.'));
     88      $page['errors'][] = l10n('Can\'t read or extract archive.');
    9189      break;
    9290
    9391    default:
    94       array_push(
    95         $page['errors'],
    96         l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus']))
    97       );
     92      $page['errors'][] = l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus']));
    9893  } 
    9994}
     
    127122else
    128123{
    129   array_push($page['errors'], l10n('Can\'t connect to server.'));
     124  $page['errors'][] = l10n('Can\'t connect to server.');
    130125}
    131126
  • trunk/admin/menubar.php

    r19703 r25018  
    149149  pwg_query($query);
    150150
    151   array_push($page['infos'], l10n('Order of menubar items has been updated successfully.'));
     151  $page['infos'][] = l10n('Order of menubar items has been updated successfully.');
    152152}
    153153
  • trunk/admin/notification_by_mail.php

    r25005 r25018  
    8181
    8282      $must_repost = true;
    83       array_push($page['errors'],
    84         l10n_dec('Execution time is out, treatment must be continue [Estimated time: %d second].',
    85                  'Execution time is out, treatment must be continue [Estimated time: %d seconds].',
    86                   $time_refresh));
     83      $page['errors'][] = l10n_dec(
     84        'Execution time is out, treatment must be continue [Estimated time: %d second].',
     85        'Execution time is out, treatment must be continue [Estimated time: %d seconds].',
     86        $time_refresh
     87        );
    8788    }
    8889  }
     
    157158
    158159      // Save key
    159       array_push($check_key_list, $nbm_user['check_key']);
     160      $check_key_list[] = $nbm_user['check_key'];
    160161
    161162      // Insert new nbm_users
    162       array_push
    163       (
    164         $inserts,
    165         array
    166         (
    167           'user_id' => $nbm_user['user_id'],
    168           'check_key' => $nbm_user['check_key'],
    169           'enabled' => 'false' // By default if false, set to true with specific functions
    170         )
    171       );
    172 
    173       array_push
    174       (
    175         $page['infos'],
    176         l10n(
    177           'User %s [%s] added.',
    178           stripslashes($nbm_user['username']),
    179           get_email_address_as_display_text($nbm_user['mail_address'])
    180         )
    181       );
     163      $inserts[] = array(
     164        'user_id' => $nbm_user['user_id'],
     165        'check_key' => $nbm_user['check_key'],
     166        'enabled' => 'false' // By default if false, set to true with specific functions
     167        );
     168
     169      $page['infos'][] = l10n(
     170        'User %s [%s] added.',
     171        stripslashes($nbm_user['username']),
     172        get_email_address_as_display_text($nbm_user['mail_address'])
     173        );
    182174    }
    183175
     
    283275          {
    284276            // Stop fill list on 'list_to_send', if the quota is override
    285             array_push($page['infos'], $msg_break_timeout);
     277            $page['infos'][] = $msg_break_timeout;
    286278            break;
    287279          }
     
    289281          {
    290282            // Stop fill list on 'send', if the quota is override
    291             array_push($page['errors'], $msg_break_timeout);
     283            $page['errors'][] = $msg_break_timeout;
    292284            break;
    293285          }
     
    300292            set_make_full_url();
    301293            // Fill return list of "treated" check_key for 'send'
    302             array_push($return_list, $nbm_user['check_key']);
     294            $return_list[] = $nbm_user['check_key'];
    303295
    304296            if ($conf['nbm_send_detailed_content'])
     
    403395                inc_mail_sent_success($nbm_user);
    404396
    405                 $data = array('user_id' => $nbm_user['user_id'],
    406                               'last_send' => $dbnow);
    407                 array_push($datas, $data);
     397                $datas[] = array(
     398                  'user_id' => $nbm_user['user_id'],
     399                  'last_send' => $dbnow
     400                  );
    408401              }
    409402              else
     
    420413            {
    421414              // Fill return list of "selected" users for 'list_to_send'
    422               array_push($return_list, $nbm_user);
     415              $return_list[] = $nbm_user;
    423416            }
    424417          }
     
    449442        if ($is_action_send)
    450443        {
    451           array_push($page['errors'], l10n('No user to send notifications by mail.'));
     444          $page['errors'][] = l10n('No user to send notifications by mail.');
    452445        }
    453446      }
     
    530523      }
    531524
    532       array_push($page['infos'],
    533         l10n_dec('%d parameter was updated.', '%d parameters were updated.',
    534           $updated_param_count));
     525      $page['infos'][] = l10n_dec(
     526        '%d parameter was updated.', '%d parameters were updated.',
     527        $updated_param_count
     528        );
    535529
    536530      // Reload conf with new values
  • trunk/admin/permalinks.php

    r19703 r25018  
    6060      elseif (isset($default_field) and !isset($_GET[$get_param]) )
    6161      {
    62         array_push($ret, $field);
     62        $ret[] = $field;
    6363        $disp = '<em>'.$disp.'</em>';
    6464      }
     
    6666    else
    6767    {
    68       array_push($ret, $field);
     68      $ret[] = $field;
    6969      $disp = '<em>'.$disp.'</em>';
    7070    }
     
    101101  $result = pwg_query($query);
    102102  if (pwg_db_changes($result)==0)
    103     array_push($page['errors'], l10n('Cannot delete the old permalink !'));
     103  {
     104    $page['errors'][] = l10n('Cannot delete the old permalink !');
     105  }
    104106}
    105107
  • trunk/admin/photos_add_direct.php

    r24834 r25018  
    4444  foreach (explode(',', $_GET['batch']) as $image_id)
    4545  {
    46     array_push(
    47       $inserts,
    48       array(
    49         'user_id' => $user['id'],
    50         'element_id' => $image_id,
    51         )
     46    $inserts[] = array(
     47      'user_id' => $user['id'],
     48      'element_id' => $image_id,
    5249      );
    5350  }
  • trunk/admin/picture_modify.php

    r25005 r25018  
    105105{
    106106  sync_metadata(array( intval($_GET['image_id'])));
    107   array_push($page['infos'], l10n('Metadata synchronized from file'));
     107  $page['infos'][] = l10n('Metadata synchronized from file');
    108108}
    109109
     
    121121    )
    122122  {
    123     array_push($page['errors'], l10n('wrong date'));
     123    $page['errors'][] = l10n('wrong date');
    124124  }
    125125}
     
    204204  $represent_options_selected = $_POST['represent'];
    205205 
    206   array_push($page['infos'], l10n('Photo informations updated'));
     206  $page['infos'][] = l10n('Photo informations updated');
    207207}
    208208
  • trunk/admin/plugins_installed.php

    r19703 r25018  
    6565  if (!is_webmaster())
    6666  {
    67     array_push($page['errors'], l10n('Webmaster status is required.'));
     67    $page['errors'][] = l10n('Webmaster status is required.');
    6868  }
    6969  else
     
    9191  {
    9292    if ($plugin == '~~expire~~') continue;
    93     array_push($incompatible_plugins, $plugin);
     93    $incompatible_plugins[] = $plugin;
    9494   
    9595  }
     
    153153  }
    154154
    155   array_push($tpl_plugins, $tpl_plugin);
     155  $tpl_plugins[] = $tpl_plugin;
    156156}
    157157
     
    171171if (count($missing_plugin_ids) > 0)
    172172{
    173   foreach($missing_plugin_ids as $plugin_id)
    174   {
    175     array_push(
    176       $tpl_plugins,
    177       array(
    178         'NAME' => $plugin_id,
    179         'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'],
    180         'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'),
    181         'U_ACTION' => sprintf($action_url, $plugin_id),
    182         'STATE' => 'missing',
    183         )
     173  foreach ($missing_plugin_ids as $plugin_id)
     174  {
     175    $tpl_plugins[] = array(
     176      'NAME' => $plugin_id,
     177      'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'],
     178      'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'),
     179      'U_ACTION' => sprintf($action_url, $plugin_id),
     180      'STATE' => 'missing',
    184181      );
    185182  }
  • trunk/admin/plugins_new.php

    r25005 r25018  
    4040  if (!is_webmaster())
    4141  {
    42     array_push($page['errors'], l10n('Webmaster status is required.'));
     42    $page['errors'][] = l10n('Webmaster status is required.');
    4343  }
    4444  else
     
    5858  {
    5959    case 'ok':
    60       array_push($page['infos'],
    61         l10n('Plugin has been successfully copied'),
    62         l10n('You might go to plugin list to install and activate it.'));
     60      $page['infos'][] = l10n('Plugin has been successfully copied');
     61      $page['infos'][] = l10n('You might go to plugin list to install and activate it.');
    6362      break;
    6463
    6564    case 'temp_path_error':
    66       array_push($page['errors'], l10n('Can\'t create temporary file.'));
     65      $page['errors'][] = l10n('Can\'t create temporary file.');
    6766      break;
    6867
    6968    case 'dl_archive_error':
    70       array_push($page['errors'], l10n('Can\'t download archive.'));
     69      $page['errors'][] = l10n('Can\'t download archive.');
    7170      break;
    7271
    7372    case 'archive_error':
    74       array_push($page['errors'], l10n('Can\'t read or extract archive.'));
     73      $page['errors'][] = l10n('Can\'t read or extract archive.');
    7574      break;
    7675
    7776    default:
    78       array_push($page['errors'],
    79         l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])),
    80         l10n('Please check "plugins" folder and sub-folders permissions (CHMOD).'));
     77      $page['errors'][] = l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus']));
     78      $page['errors'][] = l10n('Please check "plugins" folder and sub-folders permissions (CHMOD).');
    8179  } 
    8280}
     
    136134else
    137135{
    138   array_push($page['errors'], l10n('Can\'t connect to server.'));
     136  $page['errors'][] = l10n('Can\'t connect to server.');
    139137}
    140138
  • trunk/admin/rating.php

    r19703 r25018  
    195195while ($row = pwg_db_fetch_assoc($result))
    196196{
    197   array_push($images, $row);
     197  $images[] = $row;
    198198}
    199199
  • trunk/admin/site_manager.php

    r22979 r25018  
    7676  if ($row['count'] > 0)
    7777  {
    78     array_push($page['errors'],
    79       l10n('This site already exists').' ['.$url.']');
     78    $page['errors'][] = l10n('This site already exists').' ['.$url.']';
    8079  }
    8180  if (count($page['errors']) == 0)
     
    8382    if ( ! file_exists($url) )
    8483    {
    85       array_push($page['errors'],
    86         l10n('Directory does not exist').' ['.$url.']');
     84      $page['errors'][] = l10n('Directory does not exist').' ['.$url.']';
    8785    }
    8886  }
     
    9795;';
    9896    pwg_query($query);
    99     array_push($page['infos'],
    100                $url.' '.l10n('created'));
     97    $page['infos'][] = $url.' '.l10n('created');
    10198  }
    10299}
     
    122119    {
    123120      delete_site($page['site']);
    124       array_push($page['infos'],
    125                  $galleries_url.' '.l10n('deleted'));
     121      $page['infos'][] = $galleries_url.' '.l10n('deleted');
    126122      break;
    127123    }
  • trunk/admin/site_reader_local.php

    r19703 r25018  
    5353  if (!is_dir($this->site_url))
    5454  {
    55     array_push(
    56       $errors,
    57       array(
    58         'path' => $this->site_url,
    59         'type' => 'PWG-ERROR-NO-FS'
    60         )
     55    $errors[] = array(
     56      'path' => $this->site_url,
     57      'type' => 'PWG-ERROR-NO-FS'
    6158      );
    6259
     
    109106        }
    110107      }
    111       elseif (is_dir($path.'/'.$node)
     108      else if (is_dir($path.'/'.$node)
    112109               and $node != 'pwg_high'
    113110               and $node != 'pwg_representative'
    114111               and $node != 'thumbnail' )
    115112      {
    116         array_push($subdirs, $node);
     113        $subdirs[] = $node;
    117114      }
    118115    } //end while readdir
  • trunk/admin/site_update.php

    r23430 r25018  
    200200  if (isset($_POST['cat']))
    201201  {
    202     array_push($fs_fulldirs, $basedir);
     202    $fs_fulldirs[] = $basedir;
    203203  }
    204204  // If $_POST['subcats-included'] != 1 ("Search in sub-albums" is unchecked)
     
    254254      }
    255255
    256       array_push($inserts, $insert);
    257       array_push(
    258         $infos,
    259         array(
     256      $inserts[] = $insert;
     257      $infos[] = array(
    260258          'path' => $fulldir,
    261259          'info' => l10n('added')
     
    278276    else
    279277    {
    280       array_push(
    281         $errors,
    282         array(
    283           'path' => $fulldir,
    284           'type' => 'PWG-UPDATE-1'
    285           )
     278      $errors[] = array(
     279        'path' => $fulldir,
     280        'type' => 'PWG-UPDATE-1'
    286281        );
    287282    }
     
    327322              $granted_grps[$row['cat_id']]=array();
    328323            }
     324            // TODO: explanaition
    329325            array_push(
    330326              $granted_grps,
     
    350346              $granted_users[$row['cat_id']]=array();
    351347            }
     348            // TODO: explanaition
    352349            array_push(
    353350              $granted_users,
     
    373370              foreach ($granted_grps[$parent_id] as $granted_grp)
    374371              {
    375                 array_push(
    376                   $insert_granted_grps,
    377                   array(
    378                     'group_id' => $granted_grp,
    379                     'cat_id' => $ids
    380                   )
    381                 );
     372                $insert_granted_grps[] = array(
     373                  'group_id' => $granted_grp,
     374                  'cat_id' => $ids
     375                  );
    382376              }
    383377            }
     
    386380              foreach ($granted_users[$parent_id] as $granted_user)
    387381              {
    388                 array_push(
    389                   $insert_granted_users,
    390                   array(
    391                     'user_id' => $granted_user,
    392                     'cat_id' => $ids
    393                   )
    394                 );
     382                $insert_granted_users[] = array(
     383                  'user_id' => $granted_user,
     384                  'cat_id' => $ids
     385                  );
    395386              }
    396387            }
    397388            foreach (get_admins() as $granted_user)
    398389            {
    399               array_push(
    400                 $insert_granted_users,
    401                 array(
    402                   'user_id' => $granted_user,
    403                   'cat_id' => $ids
    404                 )
    405               );
     390              $insert_granted_users[] = array(
     391                'user_id' => $granted_user,
     392                'cat_id' => $ids
     393                );
    406394            }
    407395          }
     
    421409
    422410  // to delete categories
    423   $to_delete = array(); $to_delete_derivative_dirs = array();
     411  $to_delete = array();
     412  $to_delete_derivative_dirs = array();
     413 
    424414  foreach (array_diff(array_keys($db_fulldirs), $fs_fulldirs) as $fulldir)
    425415  {
    426     array_push($to_delete, $db_fulldirs[$fulldir]);
     416    $to_delete[] = $db_fulldirs[$fulldir];
    427417    unset($db_fulldirs[$fulldir]);
    428     array_push($infos, array('path' => $fulldir,
    429                              'info' => l10n('deleted')));
     418   
     419    $infos[] = array(
     420      'path' => $fulldir,
     421      'info' => l10n('deleted')
     422      );
     423     
    430424    if (substr_compare($fulldir, '../', 0, 3)==0)
    431425    {
     
    434428    $to_delete_derivative_dirs[] = PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$fulldir;
    435429  }
     430 
    436431  if (count($to_delete) > 0)
    437432  {
     
    506501    if (!preg_match($conf['sync_chars_regex'], $filename))
    507502    {
    508       array_push(
    509         $errors,
    510         array(
    511           'path' => $path,
    512           'type' => 'PWG-UPDATE-1'
    513           )
     503      $errors[] = array(
     504        'path' => $path,
     505        'type' => 'PWG-UPDATE-1'
    514506        );
    515507
     
    533525    }
    534526
    535     array_push(
    536       $inserts,
    537       $insert
     527    $inserts[] = $insert;
     528
     529    $insert_links[] = array(
     530      'image_id'    => $insert['id'],
     531      'category_id' => $insert['storage_category_id'],
    538532      );
    539533
    540     array_push(
    541       $insert_links,
    542       array(
    543         'image_id'    => $insert['id'],
    544         'category_id' => $insert['storage_category_id'],
    545         )
    546       );
    547 
    548     array_push(
    549       $infos,
    550       array(
    551         'path' => $insert['path'],
    552         'info' => l10n('added')
    553         )
     534    $infos[] = array(
     535      'path' => $insert['path'],
     536      'info' => l10n('added')
    554537      );
    555538
     
    588571  foreach (array_diff($db_elements, array_keys($fs)) as $path)
    589572  {
    590     array_push($to_delete_elements, array_search($path, $db_elements));
    591     array_push($infos, array('path' => $path,
    592                              'info' => l10n('deleted')));
     573    $to_delete_elements[] = array_search($path, $db_elements);
     574    $infos[] = array(
     575      'path' => $path,
     576      'info' => l10n('deleted')
     577      );
    593578  }
    594579  if (count($to_delete_elements) > 0)
     
    659644
    660645      $data['id']=$id;
    661       array_push($datas, $data);
     646      $datas[] = $data;
    662647    } // end foreach file
    663648
     
    740725      $data['date_metadata_update'] = CURRENT_DATE;
    741726      $data['id']=$id;
    742       array_push($datas, $data);
     727      $datas[] = $data;
    743728
    744729      foreach (array('keywords', 'tags') as $key)
     
    753738          foreach (explode(',', $data[$key]) as $tag_name)
    754739          {
    755             array_push(
    756               $tags_of[$id],
    757               tag_id_from_tag_name($tag_name)
    758               );
     740            $tags_of[$id][] = tag_id_from_tag_name($tag_name);
    759741          }
    760742        }
     
    763745    else
    764746    {
    765       array_push($errors, array('path' => $element_infos['path'], 'type' => 'PWG-ERROR-NO-FS'));
     747      $errors[] = array(
     748        'path' => $element_infos['path'],
     749        'type' => 'PWG-ERROR-NO-FS'
     750        );
    766751    }
    767752  }
  • trunk/admin/stats.php

    r19703 r25018  
    9898  while ($row = pwg_db_fetch_assoc($result))
    9999  {
    100     array_push($output, $row);
     100    $output[] = $row;
    101101  }
    102102
     
    227227    {
    228228      $row['nb_pages'] += $need_update[$key];
    229       array_push($updates, $row);
     229      $updates[] = $row;
    230230      unset($need_update[$key]);
    231231    }
     
    237237  $time_tokens = explode('-', $time_key);
    238238
    239   array_push(
    240       $inserts,
    241       array(
    242         'year'     => $time_tokens[0],
    243         'month'    => @$time_tokens[1],
    244         'day'      => @$time_tokens[2],
    245         'hour'     => @$time_tokens[3],
    246         'nb_pages' => $nb_pages,
    247         )
    248       );
     239  $inserts[] = array(
     240    'year'     => $time_tokens[0],
     241    'month'    => @$time_tokens[1],
     242    'day'      => @$time_tokens[2],
     243    'hour'     => @$time_tokens[3],
     244    'nb_pages' => $nb_pages,
     245    );
    249246}
    250247
     
    324321$url = PHPWG_ROOT_PATH.'admin.php?page=stats';
    325322
    326 array_push(
    327   $title_parts,
    328   '<a href="'.$url.'">'.l10n('Overall').'</a>'
    329   );
     323$title_parts[] = '<a href="'.$url.'">'.l10n('Overall').'</a>';
    330324
    331325$period_label = l10n('Year');
     
    335329  $url.= '&amp;year='.$page['year'];
    336330
    337   array_push(
    338     $title_parts,
    339     '<a href="'.$url.'">'.$page['year'].'</a>'
    340     );
     331  $title_parts[] = '<a href="'.$url.'">'.$page['year'].'</a>';
    341332
    342333  $period_label = l10n('Month');
     
    347338  $url.= '&amp;month='.$page['month'];
    348339
    349   array_push(
    350     $title_parts,
    351     '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>'
    352     );
     340  $title_parts[] = '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>';
    353341
    354342  $period_label = l10n('Day');
     
    367355    );
    368356
    369   array_push(
    370     $title_parts,
    371     '<a href="'.$url.'">'.$day_title.'</a>'
    372     );
     357  $title_parts[] = '<a href="'.$url.'">'.$day_title.'</a>';
    373358
    374359  $period_label = l10n('Hour');
  • trunk/admin/tags.php

    r25005 r25018  
    7070      if (in_array($tag_name, $existing_names))
    7171      {
    72         array_push(
    73           $page['errors'],
    74           l10n(
    75             'Tag "%s" already exists',
    76             $tag_name
    77             )
    78           );
     72        $page['errors'][] = l10n('Tag "%s" already exists', $tag_name);
    7973      }
    8074      else if (!empty($tag_name))
    8175      {
    82         array_push(
    83           $updates,
    84           array(
    85             'id' => $tag_id,
    86             'name' => addslashes($tag_name),
    87             'url_name' => trigger_event('render_tag_url', $tag_name),
    88             )
     76        $updates[] = array(
     77          'id' => $tag_id,
     78          'name' => addslashes($tag_name),
     79          'url_name' => trigger_event('render_tag_url', $tag_name),
    8980          );
    9081      }
     
    135126      if (in_array($tag_name, $existing_names))
    136127      {
    137         array_push(
    138           $page['errors'],
    139           l10n(
    140             'Tag "%s" already exists',
    141             $tag_name
    142             )
    143           );
     128        $page['errors'][] = l10n('Tag "%s" already exists', $tag_name);
    144129      }
    145130      else if (!empty($tag_name))
     
    172157        foreach ($destination_tag_image_ids as $image_id)
    173158        {
    174           array_push(
    175             $inserts,
    176             array(
    177               'tag_id' => $destination_tag_id,
    178               'image_id' => $image_id
    179               )
     159          $inserts[] = array(
     160            'tag_id' => $destination_tag_id,
     161            'image_id' => $image_id
    180162            );
    181163        }
     
    189171            );
    190172        }
    191         array_push(
    192           $page['infos'],
    193           l10n(
    194             'Tag "%s" is now a duplicate of "%s"',
    195             stripslashes($tag_name),
    196             $current_name_of[$tag_id]
    197             )
     173       
     174        $page['infos'][] = l10n(
     175          'Tag "%s" is now a duplicate of "%s"',
     176          stripslashes($tag_name),
     177          $current_name_of[$tag_id]
    198178          );
    199179      }
     
    218198  if (!isset($_POST['destination_tag']))
    219199  {
    220     array_push(
    221       $page['errors'],
    222       l10n('No destination tag selected')
    223       );
     200    $page['errors'][] = l10n('No destination tag selected');
    224201  }
    225202  else
     
    275252      foreach ($image_ids_to_link as $image_id)
    276253      {
    277         array_push(
    278           $inserts,
    279           array(
    280             'tag_id' => $destination_tag_id,
    281             'image_id' => $image_id
    282             )
     254        $inserts[] = array(
     255          'tag_id' => $destination_tag_id,
     256          'image_id' => $image_id
    283257          );
    284258      }
     
    299273      }
    300274
    301       array_push(
    302         $page['infos'],
    303         l10n(
    304           'Tags <em>%s</em> merged into tag <em>%s</em>',
    305           implode(', ', $tags_deleted),
    306           $name_of_tag[$destination_tag_id]
    307           )
     275      $page['infos'][] = l10n(
     276        'Tags <em>%s</em> merged into tag <em>%s</em>',
     277        implode(', ', $tags_deleted),
     278        $name_of_tag[$destination_tag_id]
    308279        );
    309280    }
     
    327298  delete_tags($_POST['tags']);
    328299
    329   array_push(
    330     $page['infos'],
    331     l10n_dec(
    332       'The following tag was deleted',
    333       'The %d following tags were deleted',
    334       count($tag_names)).' : '.
    335       implode(', ', $tag_names)
    336     );
     300  $page['infos'][] = l10n_dec(
     301    'The following tag was deleted', 'The %d following tags were deleted',
     302    count($tag_names)
     303    )
     304  .' : '.implode(', ', $tag_names);
    337305}
    338306
     
    379347      );
    380348
    381     array_push(
    382       $page['infos'],
    383       l10n(
    384         'Tag "%s" was added',
    385         stripslashes($tag_name)
    386         )
    387       );
     349    $page['infos'][] = l10n('Tag "%s" was added', stripslashes($tag_name));
    388350  }
    389351  else
    390352  {
    391     array_push(
    392       $page['errors'],
    393       l10n(
    394         'Tag "%s" already exists',
    395         stripslashes($tag_name)
    396         )
    397       );
     353    $page['errors'][] = l10n('Tag "%s" already exists', stripslashes($tag_name));
    398354  }
    399355}
     
    421377foreach ($orphan_tags as $tag)
    422378{
    423   array_push($orphan_tag_names, trigger_event('render_tag_name', $tag['name']));
     379  $orphan_tag_names[] = trigger_event('render_tag_name', $tag['name']);
    424380}
    425381
    426382if (count($orphan_tag_names) > 0)
    427383{
    428   array_push(
    429     $page['warnings'],
    430     sprintf(
    431       l10n('You have %d orphan tags: %s.').' <a href="%s">'.l10n('Delete orphan tags').'</a>',
    432       count($orphan_tag_names),
    433       implode(', ', $orphan_tag_names),
    434       get_root_url().'admin.php?page=tags&amp;action=delete_orphans&amp;pwg_token='.get_pwg_token()
    435       )
     384  $page['warnings'][] = sprintf(
     385    l10n('You have %d orphan tags: %s.').' <a href="%s">'.l10n('Delete orphan tags').'</a>',
     386    count($orphan_tag_names),
     387    implode(', ', $orphan_tag_names),
     388    get_root_url().'admin.php?page=tags&amp;action=delete_orphans&amp;pwg_token='.get_pwg_token()
    436389    );
    437390}
  • trunk/admin/themes_installed.php

    r25005 r25018  
    6363foreach ($db_themes as $db_theme)
    6464{
    65   array_push($db_theme_ids, $db_theme['id']);
     65  $db_theme_ids[] = $db_theme['id'];
    6666}
    6767
     
    144144  }
    145145 
    146   array_push($tpl_themes, $tpl_theme);
     146  $tpl_themes[] = $tpl_theme;
    147147}
    148148
  • trunk/admin/themes_new.php

    r25005 r25018  
    5151  if (!is_webmaster())
    5252  {
    53     array_push($page['errors'], l10n('Webmaster status is required.'));
     53    $page['errors'][] = l10n('Webmaster status is required.');
    5454  }
    5555  else
     
    7676  {
    7777    case 'ok':
    78       array_push(
    79         $page['infos'],
    80         l10n('Theme has been successfully installed')
    81         );
     78      $page['infos'][] = l10n('Theme has been successfully installed');
    8279      break;
    8380
    8481    case 'temp_path_error':
    85       array_push($page['errors'], l10n('Can\'t create temporary file.'));
     82      $page['errors'][] = l10n('Can\'t create temporary file.');
    8683      break;
    8784
    8885    case 'dl_archive_error':
    89       array_push($page['errors'], l10n('Can\'t download archive.'));
     86      $page['errors'][] = l10n('Can\'t download archive.');
    9087      break;
    9188
    9289    case 'archive_error':
    93       array_push($page['errors'], l10n('Can\'t read or extract archive.'));
     90      $page['errors'][] = l10n('Can\'t read or extract archive.');
    9491      break;
    9592
    9693    default:
    97       array_push(
    98         $page['errors'],
    99         l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus']))
     94      $page['errors'][] = l10n(
     95        'An error occured during extraction (%s).',
     96        htmlspecialchars($_GET['installstatus'])
    10097        );
    10198  } 
     
    131128else
    132129{
    133   array_push($page['errors'], l10n('Can\'t connect to server.'));
     130  $page['errors'][] = l10n('Can\'t connect to server.');
    134131}
    135132
  • trunk/admin/updates_ext.php

    r10596 r25018  
    3333if (!$autoupdate->get_server_extensions())
    3434{
    35   array_push($page['errors'], l10n('Can\'t connect to server.'));
    36   return;
     35  $page['errors'][] = l10n('Can\'t connect to server.');
     36  return; // TODO: remove this return and add a proper "page killer"
    3737}
    3838
  • trunk/admin/updates_pwg.php

    r10511 r25018  
    150150if (!is_webmaster())
    151151{
    152   array_push($page['errors'], l10n('Webmaster status is required.'));
     152  $page['errors'][] = l10n('Webmaster status is required.');
    153153}
    154154
  • trunk/admin/user_list.php

    r25005 r25018  
    120120    $user['groups'] = array();
    121121
    122     array_push($users, $user);
     122    $users[] = $user;
    123123  }
    124124
     
    141141    while ($row = pwg_db_fetch_assoc($result))
    142142    {
    143       array_push(
    144         $users[$user_nums[$row['user_id']]]['groups'],
    145         $row['group_id']
    146         );
     143      $users[ $user_nums[ $row['user_id'] ] ]['groups'][] = $row['group_id'];
    147144    }
    148145  }
     
    192189    if(empty($_POST['password']))
    193190    {
    194       array_push($page['errors'], l10n('Password is missing. Please enter the password.'));
     191      $page['errors'][] = l10n('Password is missing. Please enter the password.');
    195192    }
    196193    else if(empty($_POST['password_conf']))
    197194    {
    198       array_push($page['errors'], l10n('Password confirmation is missing. Please confirm the chosen password.'));
     195      $page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.');
    199196    }
    200197    else if(empty($_POST['email']))
    201198    {
    202       array_push($page['errors'], l10n('Email address is missing. Please specify an email address.'));
     199      $page['errors'][] = l10n('Email address is missing. Please specify an email address.');
    203200    }
    204201    else if ($_POST['password'] != $_POST['password_conf'])
    205202    {
    206       array_push($page['errors'], l10n('The passwords do not match'));
     203      $page['errors'][] = l10n('The passwords do not match');
    207204    }
    208205    else
     
    213210      if (count($page['errors']) == 0)
    214211      {
    215         array_push(
    216           $page['infos'],
    217           l10n(
    218             'user "%s" added',
    219             $_POST['login']
    220           )
    221         );
     212        $page['infos'][] = l10n('user "%s" added', $_POST['login']);
    222213      }
    223214    }
     
    233224    if (count($page['errors']) == 0)
    234225    {
    235       array_push(
    236         $page['infos'],
    237         l10n(
    238           'user "%s" added',
    239           stripslashes($_POST['login'])
    240           )
    241         );
     226      $page['infos'][] = l10n('user "%s" added', stripslashes($_POST['login']));
    242227    }
    243228  }
     
    296281      foreach($page['filtered_users'] as $local_user)
    297282      {
    298         array_push($collection, $local_user['id']);
     283        $collection[] = $local_user['id'];
    299284      }
    300285      break;
     
    312297  if (count($collection) == 0)
    313298  {
    314     array_push($page['errors'], l10n('Select at least one user'));
     299    $page['errors'][] = l10n('Select at least one user');
    315300  }
    316301}
     
    323308  if (in_array($conf['guest_id'], $collection))
    324309  {
    325     array_push($page['errors'], l10n('Guest cannot be deleted'));
     310    $page['errors'][] = l10n('Guest cannot be deleted');
    326311  }
    327312  if (($conf['guest_id'] != $conf['default_user_id']) and
    328313      in_array($conf['default_user_id'], $collection))
    329314  {
    330     array_push($page['errors'], l10n('Default user cannot be deleted'));
     315    $page['errors'][] = l10n('Default user cannot be deleted');
    331316  }
    332317  if (in_array($conf['webmaster_id'], $collection))
    333318  {
    334     array_push($page['errors'], l10n('Webmaster cannot be deleted'));
     319    $page['errors'][] = l10n('Webmaster cannot be deleted');
    335320  }
    336321  if (in_array($user['id'], $collection))
    337322  {
    338     array_push($page['errors'], l10n('You cannot delete your account'));
     323    $page['errors'][] = l10n('You cannot delete your account');
    339324  }
    340325
     
    347332        delete_user($user_id);
    348333      }
    349       array_push(
    350         $page['infos'],
    351         l10n_dec(
    352           '%d user deleted', '%d users deleted',
    353           count($collection)
    354           )
     334     
     335      $page['infos'][] = l10n_dec(
     336        '%d user deleted', '%d users deleted',
     337        count($collection)
    355338        );
     339     
    356340      foreach ($page['filtered_users'] as $filter_key => $filter_user)
    357341      {
     
    364348    else
    365349    {
    366       array_push($page['errors'], l10n('You need to confirm deletion'));
     350      $page['errors'][] = l10n('You need to confirm deletion');
    367351    }
    368352  }
     
    392376      foreach ($associable as $item)
    393377      {
    394         array_push($datas,
    395                    array('group_id'=>$_POST['associate'],
    396                          'user_id'=>$item));
     378        $datas[] = array(
     379          'group_id' => $_POST['associate'],
     380          'user_id' => $item
     381          );
    397382      }
    398383
     
    427412  if ($conf['activate_comments'])
    428413  {
    429     array_push($formfields, 'show_nb_comments');
    430     array_push($true_false_fields, 'show_nb_comments');
     414    $formfields[] = 'show_nb_comments';
     415    $true_false_fields[] = 'show_nb_comments';
    431416  }
    432417
     
    445430    if ($_POST[$test] != 'leave')
    446431    {
    447       array_push($dbfields['update'], $formfield);
     432      $dbfields['update'][] = $formfield;
    448433    }
    449434  }
     
    481466          if (!in_array('level', $dbfields['update']))
    482467          {
    483             array_push($dbfields['update'], 'level');
     468            $dbfields['update'][] = 'level';
    484469          }
    485470        }
     
    508493      }
    509494
    510       array_push($datas, $data);
     495      $datas[] = $data;
    511496    }
    512497
  • trunk/admin/user_perm.php

    r25005 r25018  
    120120  while ($row = pwg_db_fetch_assoc($result))
    121121  {
    122     array_push($cats, $row);
    123     array_push($group_authorized, $row['cat_id']);
     122    $cats[] = $row;
     123    $group_authorized[] = $row['cat_id'];
    124124  }
    125125  usort($cats, 'global_rank_compare');
     
    153153while ($row = pwg_db_fetch_assoc($result))
    154154{
    155   array_push($authorized_ids, $row['id']);
     155  $authorized_ids[] = $row['id'];
    156156}
    157157
  • trunk/comments.php

    r25005 r25018  
    447447while ($row = pwg_db_fetch_assoc($result))
    448448{
    449   array_push($comments, $row);
    450   array_push($element_ids, $row['image_id']);
     449  $comments[] = $row;
     450  $element_ids[] = $row['image_id'];
    451451}
    452452
  • trunk/identification.php

    r20609 r25018  
    4040  if ( is_a_guest() )
    4141  {
    42     array_push($page['errors'], l10n('You are not authorized to access the requested page'));
     42    $page['errors'][] = l10n('You are not authorized to access the requested page');
    4343  }
    4444}
     
    4848  if (!isset($_COOKIE[session_name()]))
    4949  {
    50     array_push(
    51       $page['errors'],
    52       l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.')
    53       );
     50    $page['errors'][] = l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.');
    5451  }
    5552  else
     
    6966    else
    7067    {
    71       array_push($page['errors'], l10n('Invalid password!') );
     68      $page['errors'][] = l10n('Invalid password!');
    7269    }
    7370  }
  • trunk/include/calendar_monthly.class.php

    r19703 r25018  
    389389      }
    390390
    391       array_push( $wday_labels, array_shift($wday_labels) );
     391      $wday_labels[] = array_shift($wday_labels);
    392392    }
    393393
  • trunk/include/calendar_weekly.class.php

    r25005 r25018  
    6969      $this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1';
    7070      $this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field);
    71       array_push( $this->calendar_levels[CDAY]['labels'],
    72                   array_shift( $this->calendar_levels[CDAY]['labels'] ) );
     71      $this->calendar_levels[CDAY]['labels'][] = array_shift($this->calendar_levels[CDAY]['labels']);
    7372    }
    7473  }
  • trunk/include/category_cats.inc.php

    r25005 r25018  
    208208          if (isset($image_id) and !in_array($image_id, $image_ids))
    209209          {
    210             array_push($new_image_ids, $image_id);
     210            $new_image_ids[] = $image_id;
    211211          }
    212212
  • trunk/include/dblayer/functions_mysql.inc.php

    r21088 r25018  
    329329          $column.= " collate '".$row['Collation']."'";
    330330        }
    331         array_push($columns, $column);
     331        $columns[] = $column;
    332332      }
    333333    }
     
    565565  while ($row = pwg_db_fetch_row($result))
    566566  {
    567     array_push($all_tables, $row[0]);
     567    $all_tables[] = $row[0];
    568568  }
    569569
     
    583583      if ($row['Key'] == 'PRI')
    584584      {
    585         array_push($all_primary_key, $row['Field']);
     585        $all_primary_key[] = $row['Field'];
    586586      }
    587587    }
     
    599599  if ($mysql_rc)
    600600  {
    601     array_push(
    602           $page['infos'],
    603           l10n('All optimizations have been successfully completed.')
    604           );
     601    $page['infos'][] = l10n('All optimizations have been successfully completed.');
    605602  }
    606603  else
    607604  {
    608     array_push(
    609           $page['errors'],
    610           l10n('Optimizations have been completed with some errors.')
    611           );
     605    $page['errors'][] = l10n('Optimizations have been completed with some errors.');
    612606  }
    613607}
  • trunk/include/dblayer/functions_mysqli.inc.php

    r24346 r25018  
    366366          $column.= " collate '".$row['Collation']."'";
    367367        }
    368         array_push($columns, $column);
     368        $columns[] = $column;
    369369      }
    370370    }
     
    602602  while ($row = pwg_db_fetch_row($result))
    603603  {
    604     array_push($all_tables, $row[0]);
     604    $all_tables[] = $row[0];
    605605  }
    606606
     
    620620      if ($row['Key'] == 'PRI')
    621621      {
    622         array_push($all_primary_key, $row['Field']);
     622        $all_primary_key[] = $row['Field'];
    623623      }
    624624    }
     
    636636  if ($mysqli_rc)
    637637  {
    638     array_push(
    639           $page['infos'],
    640           l10n('All optimizations have been successfully completed.')
    641           );
     638    $page['infos'][] = l10n('All optimizations have been successfully completed.');
    642639  }
    643640  else
    644641  {
    645     array_push(
    646           $page['errors'],
    647           l10n('Optimizations have been completed with some errors.')
    648           );
     642    $page['errors'][] = l10n('Optimizations have been completed with some errors.');
    649643  }
    650644}
  • trunk/include/filter.inc.php

    r19703 r25018  
    124124  if (get_filter_page_value('add_notes'))
    125125  {
    126     $header_notes[] = l10n_dec('Photos posted within the last %d day.', 'Photos posted within the last %d days.', $filter['recent_period']);
     126    $header_notes[] = l10n_dec(
     127      'Photos posted within the last %d day.', 'Photos posted within the last %d days.',
     128      $filter['recent_period']
     129      );
    127130  }
    128131  include_once(PHPWG_ROOT_PATH.'include/functions_filter.inc.php');
  • trunk/include/functions.inc.php

    r25005 r25018  
    879879  foreach ($caddiables as $caddiable)
    880880  {
    881     array_push($datas, array('element_id' => $caddiable,
    882                              'user_id' => $user['id']));
     881    $datas[] = array(
     882      'element_id' => $caddiable,
     883      'user_id' => $user['id'],
     884      );
    883885  }
    884886
  • trunk/include/functions_calendar.inc.php

    r19703 r25018  
    213213            if ( isset($page['chronology_date'][0]) )
    214214            {
    215               array_push($chronology_date, $page['chronology_date'][0]);
     215              $chronology_date[] = $page['chronology_date'][0];
    216216            }
    217217          }
  • trunk/include/functions_comment.inc.php

    r21817 r25018  
    9494      if ($conf['comments_author_mandatory'])
    9595      {
    96         array_push($infos, l10n('Username is mandatory') );
     96        $infos[] = l10n('Username is mandatory');
    9797        $comment_action='reject';
    9898      }
     
    111111      if ( $row['user_exists'] == 1 )
    112112      {
    113         array_push($infos, l10n('This login is already used by another user') );
     113        $infos[] = l10n('This login is already used by another user');
    114114        $comment_action='reject';
    115115      }
     
    142142    if (!url_check_format($comm['website_url']))
    143143    {
    144       array_push($infos, l10n('Your website URL is invalid'));
     144      $infos[] = l10n('Your website URL is invalid');
    145145      $comment_action='reject';
    146146    }
     
    156156    else if ($conf['comments_email_mandatory'])
    157157    {
    158       array_push($infos, l10n('Email address is missing. Please specify an email address.') );
     158      $infos[] = l10n('Email address is missing. Please specify an email address.');
    159159      $comment_action='reject';
    160160    }
     
    162162  else if (!email_check_format($comm['email']))
    163163  {
    164     array_push($infos, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
     164    $infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
    165165    $comment_action='reject';
    166166  }
     
    193193    if ( $counter > 0 )
    194194    {
    195       array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
     195      $infos[] = l10n('Anti-flood system : please wait for a moment before trying to post another comment');
    196196      $comment_action='reject';
    197197    }
  • trunk/include/functions_mail.inc.php

    r24966 r25018  
    294294      if (!empty($admin['mail_address']))
    295295      {
    296         array_push($admins, format_email($admin['username'], $admin['mail_address']));
     296        $admins[] = format_email($admin['username'], $admin['mail_address']);
    297297      }
    298298    }
     
    420420          if (!empty($row['mail_address']))
    421421          {
    422             array_push($Bcc, format_email(stripslashes($row['username']), $row['mail_address']));
     422            $Bcc[] = format_email(stripslashes($row['username']), $row['mail_address']);
    423423          }
    424424        }
  • trunk/include/functions_notification.inc.php

    r19703 r25018  
    207207    while ($row = pwg_db_fetch_assoc($result))
    208208    {
    209       array_push($infos, $row);
     209      $infos[] = $row;
    210210    }
    211211
     
    370370      $line = '<a href="'.$url.'">'.$line.'</a>';
    371371    }
    372     array_push($news, $line);
     372    $news[] = $line;
    373373  }
    374374}
     
    451451  while ($row = pwg_db_fetch_assoc($result))
    452452  {
    453     array_push($dates, $row);
     453    $dates[] = $row;
    454454  }
    455455
     
    470470      while ($row = pwg_db_fetch_assoc($result))
    471471      {
    472         array_push($dates[$i]['elements'], $row);
     472        $dates[$i]['elements'][] = $row;
    473473      }
    474474    }
     
    490490      while ($row = pwg_db_fetch_assoc($result))
    491491      {
    492         array_push($dates[$i]['categories'], $row);
     492        $dates[$i]['categories'][] = $row;
    493493      }
    494494    }
     
    547547  $description .=
    548548        '<li>'
    549         .l10n_dec('%d album updated', '%d albums updated',
    550                   $date_detail['nb_cats'])
     549        .l10n_dec('%d album updated', '%d albums updated', $date_detail['nb_cats'])
    551550        .'</li>';
    552551
     
    558557          .get_cat_display_name_cache($cat['uppercats'])
    559558          .' ('.
    560           l10n_dec('%d new photo',
    561                    '%d new photos', $cat['img_count']).')'
     559          l10n_dec('%d new photo', '%d new photos', $cat['img_count']).')'
    562560          .'</li>';
    563561  }
  • trunk/include/functions_plugins.inc.php

    r24160 r25018  
    221221  while ($row = pwg_db_fetch_assoc($result))
    222222  {
    223     array_push($plugins, $row);
     223    $plugins[] = $row;
    224224  }
    225225  return $plugins;
  • trunk/include/functions_search.inc.php

    r22175 r25018  
    6969      foreach ($search['fields'][$textfield]['words'] as $word)
    7070      {
    71         array_push($local_clauses, $textfield." LIKE '%".$word."%'");
     71        $local_clauses[] = $textfield." LIKE '%".$word."%'";
    7272      }
    7373
     
    7575      $local_clauses = prepend_append_array_items($local_clauses, '(', ')');
    7676
    77       array_push(
    78         $clauses,
    79         implode(
    80           ' '.$search['fields'][$textfield]['mode'].' ',
    81           $local_clauses
    82           )
     77      $clauses[] = implode(
     78        ' '.$search['fields'][$textfield]['mode'].' ',
     79        $local_clauses
    8380        );
    8481    }
     
    10198      foreach ($fields as $field)
    10299      {
    103         array_push($field_clauses, $field." LIKE '%".$word."%'");
     100        $field_clauses[] = $field." LIKE '%".$word."%'";
    104101      }
    105102      // adds brackets around where clauses
    106       array_push(
    107         $word_clauses,
    108         implode(
    109           "\n          OR ",
    110           $field_clauses
    111           )
     103      $word_clauses[] = implode(
     104        "\n          OR ",
     105        $field_clauses
    112106        );
    113107    }
     
    118112      );
    119113
    120     array_push(
    121       $clauses,
    122       "\n         ".
     114    $clauses[] = "\n         ".
    123115      implode(
    124         "\n         ".
    125               $search['fields']['allwords']['mode'].
    126         "\n         ",
     116        "\n         ". $search['fields']['allwords']['mode']. "\n         ",
    127117        $word_clauses
    128         )
    129       );
     118        );
    130119  }
    131120
     
    134123    if (isset($search['fields'][$datefield]))
    135124    {
    136       array_push(
    137         $clauses,
    138         $datefield." = '".$search['fields'][$datefield]['date']."'"
    139         );
     125      $clauses[] = $datefield." = '".$search['fields'][$datefield]['date']."'"
    140126    }
    141127
     
    146132      if (isset($search['fields'][$key]))
    147133      {
    148         array_push(
    149           $clauses,
    150 
    151           $datefield.
     134        $clauses[] = $datefield.
    152135          ($suffix == 'after'             ? ' >' : ' <').
    153136          ($search['fields'][$key]['inc'] ? '='  : '').
    154           " '".$search['fields'][$key]['date']."'"
    155 
    156           );
     137          " '".$search['fields'][$key]['date']."'";
    157138      }
    158139    }
     
    172153
    173154    $local_clause = 'category_id IN ('.implode(',', $cat_ids).')';
    174     array_push($clauses, $local_clause);
     155    $clauses[] = $local_clause;
    175156  }
    176157
  • trunk/include/functions_tag.inc.php

    r21817 r25018  
    333333  while ($row = pwg_db_fetch_assoc($result))
    334334  {
    335     array_push($tags, $row);
     335    $tags[] = $row;
    336336  }
    337337  return $tags;
  • trunk/include/functions_url.inc.php

    r23822 r25018  
    467467          if (empty($maybe_permalinks))
    468468          {
    469             array_push($maybe_permalinks, $tokens[$current_token]);
     469            $maybe_permalinks[] = $tokens[$current_token];
    470470          }
    471471          else
    472472          {
    473             array_push($maybe_permalinks,
     473            $maybe_permalinks[] =
    474474                $maybe_permalinks[count($maybe_permalinks)-1]
    475                 . '/' . $tokens[$current_token]
    476               );
     475                . '/' . $tokens[$current_token];
    477476          }
    478477          $current_token++;
     
    528527      if ( $conf['tag_url_style'] != 'tag' and preg_match('/^(\d+)(?:-(.*)|)$/', $tokens[$i], $matches) )
    529528      {
    530         array_push($requested_tag_ids, $matches[1]);
     529        $requested_tag_ids[] = $matches[1];
    531530      }
    532531      else
    533532      {
    534         array_push($requested_tag_url_names, $tokens[$i]);
     533        $requested_tag_url_names[] = $tokens[$i];
    535534      }
    536535      $i++;
     
    598597    {
    599598      // Add dummy element list
    600       array_push($page['list'], -1);
     599      $page['list'][] = -1;
    601600    }
    602601    // With pictures list
     
    609608      foreach (explode(',', $tokens[$next_token]) as $image_id)
    610609      {
    611         array_push($page['list'], $image_id);
     610        $page['list'][] = $image_id;
    612611      }
    613612    }
  • trunk/include/picture_comment.inc.php

    r19703 r25018  
    6161  {
    6262    case 'moderate':
    63       array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.') );
     63      $page['infos'][] = l10n('An administrator must authorize your comment before it is visible.');
    6464    case 'validate':
    65       array_push($page['infos'], l10n('Your comment has been registered'));
     65      $page['infos'][] = l10n('Your comment has been registered');
    6666      break;
    6767    case 'reject':
    6868      set_status_header(403);
    69       array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules') );
     69      $page['errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
    7070      break;
    7171    default:
  • trunk/include/section_init.inc.php

    r22283 r25018  
    340340    foreach ($page['tags'] as $tag)
    341341    {
    342       array_push($page['tag_ids'], $tag['id']);
     342      $page['tag_ids'][] = $tag['id'];
    343343    }
    344344
  • trunk/include/ws_functions.inc.php

    r25005 r25018  
    402402  foreach ( array_from_query($query, 'id') as $id )
    403403  {
    404     array_push($datas, array('element_id'=>$id, 'user_id'=>$user['id']) );
     404    $datas[] = array('element_id'=>$id, 'user_id'=>$user['id']);
    405405  }
    406406  if (count($datas))
     
    794794            if (isset($image_id) and !in_array($image_id, $image_ids))
    795795            {
    796               array_push($new_image_ids, $image_id);
     796              $new_image_ids[] = $image_id;
    797797            }
    798798
     
    833833    foreach ($user_representative_updates_for as $cat_id => $image_id)
    834834    {
    835       array_push(
    836         $updates,
    837         array(
    838           'user_id' => $user['id'],
    839           'cat_id' => $cat_id,
    840           'user_representative_picture_id' => $image_id,
    841           )
     835      $updates[] = array(
     836        'user_id' => $user['id'],
     837        'cat_id' => $cat_id,
     838        'user_representative_picture_id' => $image_id,
    842839        );
    843840    }
     
    995992  {
    996993    case 'reject':
    997       array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules') );
     994      $infos[] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
    998995      return new PwgError(403, implode("; ", $infos) );
    999996    case 'validate':
    1000997    case 'moderate':
    1001998      $ret = array(
    1002           'id' => $comm['id'],
    1003           'validation' => $comment_action=='validate',
     999        'id' => $comm['id'],
     1000        'validation' => $comment_action=='validate',
    10041001        );
    10051002      return array( 'comment' =>  new PwgNamedStruct($ret) );
     
    10721069      );
    10731070    $row['id']=(int)$row['id'];
    1074     array_push($related_categories, $row);
     1071    $related_categories[] = $row;
    10751072  }
    10761073  usort($related_categories, 'global_rank_compare');
     
    15451542      {
    15461543        ws_logfile($file);
    1547         array_push($chunks, $upload_dir.'/'.$file);
     1544        $chunks[] = $upload_dir.'/'.$file;
    15481545      }
    15491546    }
     
    16021599      if (preg_match($pattern, $file))
    16031600      {
    1604         array_push($chunks, $upload_dir.'/'.$file);
     1601        $chunks[] = $upload_dir.'/'.$file;
    16051602      }
    16061603    }
     
    19591956      foreach ($params['tags'] as $tag_name)
    19601957      {
    1961         $tag_id = tag_id_from_tag_name($tag_name);
    1962         array_push($tag_ids, $tag_id);
     1958        $tag_ids[] = tag_id_from_tag_name($tag_name);
    19631959      }
    19641960    }
     
    19681964      foreach ($tag_names as $tag_name)
    19691965      {
    1970         $tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
    1971         array_push($tag_ids, $tag_id);
     1966        $tag_ids[] = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
    19721967      }
    19731968    }
     
    26632658    if ($image_id > 0)
    26642659    {
    2665       array_push($image_ids, $image_id);
     2660      $image_ids[] = $image_id;
    26662661    }
    26672662  }
     
    26952690    }
    26962691
    2697     array_push($cat_ids, $cat_id);
     2692    $cat_ids[] = $cat_id;
    26982693
    26992694    if (!isset($rank))
     
    28042799  foreach ($new_cat_ids as $cat_id)
    28052800  {
    2806     array_push(
    2807       $inserts,
    2808       array(
    2809         'image_id' => $image_id,
    2810         'category_id' => $cat_id,
    2811         'rank' => $rank_on_category[$cat_id],
    2812         )
     2801    $inserts[] = array(
     2802      'image_id' => $image_id,
     2803      'category_id' => $cat_id,
     2804      'rank' => $rank_on_category[$cat_id],
    28132805      );
    28142806  }
     
    29962988    if ($category_id > 0)
    29972989    {
    2998       array_push($category_ids, $category_id);
     2990      $category_ids[] = $category_id;
    29992991    }
    30002992  }
     
    30543046    if ($category_id > 0)
    30553047    {
    3056       array_push($category_ids, $category_id);
     3048      $category_ids[] = $category_id;
    30573049    }
    30583050  }
     
    34213413  if (!in_array($params['id'], $conf['updates_ignored'][$params['type']]))
    34223414  {
    3423     array_push($conf['updates_ignored'][$params['type']], $params['id']);
     3415    $conf['updates_ignored'][ $params['type'] ][] = $params['id'];
    34243416  }
    34253417  conf_update_param('updates_ignored', pwg_db_real_escape_string(serialize($conf['updates_ignored'])));
  • trunk/include/ws_protocols/rest_encoder.php

    r22729 r25018  
    6767    $this->_output( '<'.$name );
    6868    $this->_lastTagOpen = true;
    69     array_push( $this->_elementStack, $name);
     69    $this->_elementStack[] = $name;
    7070  }
    7171
  • trunk/install.php

    r25005 r25018  
    253253include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php');
    254254
    255 if ( isset( $_POST['install'] ))
     255if (isset($_POST['install']))
    256256{
    257257  install_db_connect($infos, $errors);
    258258  pwg_db_check_charset();
    259259
    260   $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name ));
    261   if ( empty($webmaster))
    262     array_push( $errors, l10n('enter a login for webmaster') );
    263   else if ( preg_match( '/[\'"]/', $webmaster ) )
    264     array_push( $errors, l10n('webmaster login can\'t contain characters \' or "') );
    265   if ( $admin_pass1 != $admin_pass2 || empty($admin_pass1) )
    266     array_push( $errors, l10n('please enter your password again') );
    267   if ( empty($admin_mail))
    268     array_push( $errors, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)') );
     260  $webmaster = trim(preg_replace('/\s{2,}/', ' ', $admin_name));
     261  if (empty($webmaster))
     262  {
     263    $errors[] = l10n('enter a login for webmaster');
     264  }
     265  else if (preg_match( '/[\'"]/', $webmaster))
     266  {
     267    $errors[] = l10n('webmaster login can\'t contain characters \' or "');
     268  }
     269  if ($admin_pass1 != $admin_pass2 || empty($admin_pass1))
     270  {
     271    $errors[] = l10n('please enter your password again');
     272  }
     273  if (empty($admin_mail))
     274  {
     275    $errors[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
     276  }
    269277  else
    270278  {
    271279    $error_mail_address = validate_mail_address(null, $admin_mail);
    272280    if (!empty($error_mail_address))
    273       array_push( $errors, $error_mail_address );
     281    {
     282      $errors[] = $error_mail_address;
     283    }
    274284  }
    275285
     
    389399    foreach (get_available_upgrade_ids() as $upgrade_id)
    390400    {
    391       array_push(
    392         $datas,
    393         array(
    394           'id'          => $upgrade_id,
    395           'applied'     => CURRENT_DATE,
    396           'description' => 'upgrade included in installation',
    397           )
     401      $datas[] = array(
     402        'id'          => $upgrade_id,
     403        'applied'     => CURRENT_DATE,
     404        'description' => 'upgrade included in installation',
    398405        );
    399406    }
     
    450457else
    451458{
    452   array_push(
    453     $infos,
    454     l10n('Congratulations, Piwigo installation is completed')
    455     );
     459  $infos[] = l10n('Congratulations, Piwigo installation is completed');
    456460
    457461  if (isset($error_copy))
    458462  {
    459     array_push($errors, $error_copy);
     463    $errors[] = $error_copy;
    460464  }
    461465  else
  • trunk/nbm.php

    r20609 r25018  
    4646  subscribe_notification_by_mail(false, array($_GET['subscribe']));
    4747}
    48 else
    49 if (isset($_GET['unsubscribe'])
     48else if (isset($_GET['unsubscribe'])
    5049    and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe']))
    5150{
     
    5453else
    5554{
    56   array_push($page['errors'], l10n('Unknown identifier'));
     55  $page['errors'][] = l10n('Unknown identifier');
    5756}
    5857
  • trunk/password.php

    r25005 r25018  
    5454  if (empty($_POST['username_or_email']))
    5555  {
    56     array_push($page['errors'], l10n('Invalid username or email'));
     56    $page['errors'][] = l10n('Invalid username or email');
    5757    return false;
    5858  }
     
    6767  if (!is_numeric($user_id))
    6868  {
    69     array_push($page['errors'], l10n('Invalid username or email'));
     69    $page['errors'][] = l10n('Invalid username or email');
    7070    return false;
    7171  }
     
    7777  if (is_a_guest($status) or is_generic($status))
    7878  {
    79     array_push($page['errors'], l10n('Password reset is not allowed for this user'));
     79    $page['errors'][] = l10n('Password reset is not allowed for this user');
    8080    return false;
    8181  }
     
    8383  if (empty($userdata['email']))
    8484  {
    85     array_push(
    86       $page['errors'],
    87       l10n(
    88         'User "%s" has no email address, password reset is not possible',
    89         $userdata['username']
    90         )
     85    $page['errors'][] = l10n(
     86      'User "%s" has no email address, password reset is not possible',
     87      $userdata['username']
    9188      );
    9289    return false;
     
    131128  if (pwg_mail($userdata['email'], $email_params))
    132129  {
    133     array_push($page['infos'], l10n('Check your email for the confirmation link'));
     130    $page['infos'][] = l10n('Check your email for the confirmation link');
    134131    return true;
    135132  }
    136133  else
    137134  {
    138     array_push($page['errors'], l10n('Error sending email'));
     135    $page['errors'][] = l10n('Error sending email');
    139136    return false;
    140137  }
     
    153150  if (!preg_match('/^[a-z0-9]{20}$/i', $key))
    154151  {
    155     array_push($page['errors'], l10n('Invalid key'));
     152    $page['errors'][] = l10n('Invalid key');
    156153    return false;
    157154  }
     
    168165  if (pwg_db_num_rows($result) == 0)
    169166  {
    170     array_push($page['errors'], l10n('Invalid key'));
     167    $page['errors'][] = l10n('Invalid key');
    171168    return false;
    172169  }
     
    176173  if (is_a_guest($userdata['status']) or is_generic($userdata['status']))
    177174  {
    178     array_push($page['errors'], l10n('Password reset is not allowed for this user'));
     175    $page['errors'][] = l10n('Password reset is not allowed for this user');
    179176    return false;
    180177  }
     
    195192  if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
    196193  {
    197     array_push($page['errors'], l10n('The passwords do not match'));
     194    $page['errors'][] = l10n('The passwords do not match');
    198195    return false;
    199196  }
     
    204201    if (!is_numeric($user_id))
    205202    {
    206       array_push($page['errors'], l10n('Invalid key'));
     203      $page['errors'][] = l10n('Invalid key');
    207204      return false;
    208205    }
     
    213210    if (is_a_guest() or is_generic())
    214211    {
    215       array_push($page['errors'], l10n('Password reset is not allowed for this user'));
     212      $page['errors'][] = l10n('Password reset is not allowed for this user');
    216213      return false;
    217214    }
     
    226223    );
    227224
    228   array_push($page['infos'], l10n('Your password has been reset'));
     225  $page['infos'][] = l10n('Your password has been reset');
    229226
    230227  if (isset($_GET['key']))
    231228  {
    232     array_push($page['infos'], '<a href="'.get_root_url().'identification.php">'.l10n('Login').'</a>');
     229    $page['infos'][] = '<a href="'.get_root_url().'identification.php">'.l10n('Login').'</a>';
    233230  }
    234231  else
    235232  {
    236     array_push($page['infos'], '<a href="'.get_gallery_home_url().'">'.l10n('Return to home page').'</a>');
     233    $page['infos'][] = '<a href="'.get_gallery_home_url().'">'.l10n('Return to home page').'</a>';
    237234  }
    238235
  • trunk/picture.php

    r25005 r25018  
    103103        if ('best_rated'==$page['section'])
    104104        {
    105           $page['rank_of'][$page['image_id']] = count($page['items']);
    106           array_push($page['items'], $page['image_id'] );
     105          $page['rank_of'][ $page['image_id'] ] = count($page['items']);
     106          $page['items'][] = $page['image_id'];
    107107        }
    108108        else
     
    469469if (isset($page['previous_item']))
    470470{
    471   array_push($ids, $page['previous_item']);
    472   array_push($ids, $page['first_item']);
     471  $ids[] = $page['previous_item'];
     472  $ids[] = $page['first_item'];
    473473}
    474474if (isset($page['next_item']))
    475475{
    476   array_push($ids, $page['next_item']);
    477   array_push($ids, $page['last_item']);
     476  $ids[] = $page['next_item'];
     477  $ids[] = $page['last_item'];
    478478}
    479479
  • trunk/plugins/LocalFilesEditor/admin.php

    r25005 r25018  
    5757{
    5858  $content_file = file_get_contents(get_bak_file($edited_file));
    59   array_push($page['infos'],
    60     l10n('locfiledit_bak_loaded1'),
    61     l10n('locfiledit_bak_loaded2'));
     59  $page['infos'][] = l10n('locfiledit_bak_loaded1'),
     60  $page['infos'][] = l10n('locfiledit_bak_loaded2');
    6261}
    6362
     
    7170  if (!is_webmaster())
    7271  {
    73     array_push($page['errors'], l10n('locfiledit_webmaster_only'));
     72    $page['errors'][] = l10n('locfiledit_webmaster_only');
    7473  }
    7574  else
     
    8281    if ($content_file === false)
    8382    {
    84       array_push($page['errors'], l10n('locfiledit_syntax_error'));
     83      $page['errors'][] = l10n('locfiledit_syntax_error');
    8584    }
    8685    else
     
    9392      {
    9493        @copy($edited_file, get_bak_file($edited_file));
    95         array_push($page['infos'], l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2)));
     94        $page['infos'][] = l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2));
    9695      }
    9796     
     
    105104      else
    106105      {
    107         array_push($page['errors'], l10n('locfiledit_cant_save'));
     106        $page['errors'][] = l10n('locfiledit_cant_save');
    108107      }
    109108    }
  • trunk/plugins/LocalFilesEditor/include/css.inc.php

    r20714 r25018  
    6565foreach ($db_themes as $db_theme)
    6666{
    67   array_push($db_theme_ids, $db_theme['id']);
     67  $db_theme_ids[] = $db_theme['id'];
    6868}
    6969
     
    8686    else
    8787    {
    88       array_push($active_themes, $fs_theme);
     88      $active_themes[] = $fs_theme;
    8989    }
    9090  }
    9191  else
    9292  {
    93     array_push($inactive_themes, $fs_theme);
     93    $inactive_themes[] = $fs_theme;
    9494  }
    9595}
  • trunk/plugins/LocalFilesEditor/include/tpl.inc.php

    r20714 r25018  
    4040  if (empty($filename))
    4141  {
    42     array_push($page['errors'], l10n('locfiledit_empty_filename'));
     42    $page['errors'][] = l10n('locfiledit_empty_filename');
    4343  }
    4444  if (get_extension($filename) != 'tpl')
     
    4848  if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename))
    4949  {
    50     array_push($page['errors'], l10n('locfiledit_filename_error'));
     50    $page['errors'][] = l10n('locfiledit_filename_error');
    5151  }
    5252  if (is_numeric($_POST['tpl_model']) and $_POST['tpl_model'] != '0')
    5353  {
    54     array_push($page['errors'], l10n('locfiledit_model_error'));
     54    $page['errors'][] = l10n('locfiledit_model_error');
    5555  }
    5656  if (file_exists($_POST['tpl_parent'] . '/' . $filename))
    5757  {
    58     array_push($page['errors'], l10n('locfiledit_file_already_exists'));
     58    $page['errors'][] = l10n('locfiledit_file_already_exists');
    5959  }
    6060  if (!empty($page['errors']))
  • trunk/plugins/LocalFilesEditor/main.inc.php

    r24926 r25018  
    3636function localfiles_admin_menu($menu)
    3737{
    38   array_push(
    39     $menu,
    40     array(
    41       'NAME' => 'LocalFiles Editor',
    42       'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
    43       )
     38  $menu[] = array(
     39    'NAME' => 'LocalFiles Editor',
     40    'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
    4441    );
    4542 
  • trunk/profile.php

    r20609 r25018  
    202202      if (!empty($_POST['use_new_pwd']))
    203203      {
    204         array_push($fields, $conf['user_fields']['password']);
     204        $fields[] = $conf['user_fields']['password'];
    205205        // password is hashed with function $conf['password_hash']
    206206        $data{$conf['user_fields']['password']} = $conf['password_hash']($_POST['use_new_pwd']);
     
    212212        if ($_POST['username'] != $userdata['username'] and get_userid($_POST['username']))
    213213        {
    214           array_push($page['errors'], l10n('this login is already used'));
     214          $page['errors'][] = l10n('this login is already used');
    215215          unset($_POST['redirect']);
    216216        }
    217217        else
    218218        {
    219           array_push($fields, $conf['user_fields']['username']);
     219          $fields[] = $conf['user_fields']['username'];
    220220          $data{$conf['user_fields']['username']} = $_POST['username'];
    221221         
     
    263263      if ($conf['activate_comments'])
    264264      {
    265         array_push($fields, 'show_nb_comments');
     265        $fields[] = 'show_nb_comments';
    266266      }
    267267
  • trunk/register.php

    r20609 r25018  
    4545  {
    4646                set_status_header(403);
    47     array_push($page['errors'], 'Invalid/expired form key');
     47    $page['errors'][] = l10n('Invalid/expired form key');
    4848  }
    4949
    5050  if ($_POST['password'] != $_POST['password_conf'])
    5151  {
    52     array_push($page['errors'], l10n('please enter your password again'));
     52    $page['errors'][] = l10n('please enter your password again');
    5353  }
    5454
  • trunk/search.php

    r25005 r25018  
    150150  else
    151151  {
    152     array_push($page['errors'], l10n('Empty query. No criteria has been entered.'));
     152    $page['errors'][] = l10n('Empty query. No criteria has been entered.');
    153153  }
    154154}
  • trunk/search_rules.php

    r25005 r25018  
    139139    while ($row = pwg_db_fetch_assoc($result))
    140140    {
    141       array_push($categories, $row);
     141      $categories[] = $row;
    142142    }
    143143  }
  • trunk/tags.php

    r20609 r25018  
    132132    }
    133133
    134     array_push(
    135       $letter['tags'],
    136       array_merge(
    137         $tag,
    138         array(
    139           'URL' => make_index_url(
    140             array(
    141               'tags' => array($tag),
    142               )
    143             ),
    144           )
     134    $letter['tags'][] = array_merge(
     135      $tag,
     136      array(
     137        'URL' => make_index_url(array('tags' => array($tag))),
    145138        )
    146139      );
  • trunk/upgrade.php

    r25005 r25018  
    7474    if (preg_match('/^'.PREFIX_TABLE.'/', $row[0]))
    7575    {
    76       array_push($tables, $row[0]);
     76      $tables[] = $row[0];
    7777    }
    7878  }
     
    101101    while ($row = pwg_db_fetch_row($result))
    102102    {
    103       array_push($columns_of[$table], $row[0]);
     103      $columns_of[$table][] = $row[0];
    104104    }
    105105  }
     
    390390      if (!@file_put_contents($config_file, $config_file_contents))
    391391      {
    392         array_push(
    393           $page['infos'],
    394           sprintf(
    395             l10n('In <i>%s</i>, before <b>?></b>, insert:'),
    396             PWG_LOCAL_DIR.'config/database.inc.php'
    397             )
    398           .'<p><textarea rows="4" cols="40">'
    399           .implode("\r\n" , $mysql_changes).'</textarea></p>'
    400           );
     392        $page['infos'][] = l10n(
     393          'In <i>%s</i>, before <b>?></b>, insert:',
     394          PWG_LOCAL_DIR.'config/database.inc.php'
     395          )
     396        .'<p><textarea rows="4" cols="40">'
     397        .implode("\r\n" , $mysql_changes).'</textarea></p>';
    401398      }
    402399    }
     
    431428      );
    432429
    433     array_push($page['infos'],
    434       l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.')
    435       );
     430    $page['infos'][] = l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.');
    436431
    437432    // Save $page['infos'] in order to restore after maintenance actions
Note: See TracChangeset for help on using the changeset viewer.