Changeset 31031


Ignore:
Timestamp:
Mar 12, 2015, 8:51:21 PM (10 years ago)
Author:
rvelices
Message:

use query2array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions/pwg.images.php

    r30375 r31031  
    8383  WHERE id IN ('.implode(',', $cat_ids).')
    8484;';
    85   $db_cat_ids = array_from_query($query, 'id');
     85  $db_cat_ids = query2array($query, null, 'id');
    8686
    8787  $unknown_cat_ids = array_diff($cat_ids, $db_cat_ids);
     
    101101  WHERE image_id = '.$image_id.'
    102102;';
    103   $existing_cat_ids = array_from_query($query, 'category_id');
     103  $existing_cat_ids = query2array($query, null, 'category_id');
    104104
    105105  if ($replace_mode)
     
    134134  GROUP BY category_id
    135135;';
    136     $current_rank_of = simple_hash_from_query(
     136    $current_rank_of = query2array(
    137137      $query,
    138138      'category_id',
     
    482482  WHERE '. $where_comments .'
    483483;';
    484   list($nb_comments) = array_from_query($query, 'nb_comments');
     484  list($nb_comments) = query2array($query, null, 'nb_comments');
    485485  $nb_comments = (int)$nb_comments;
    486486
     
    12701270  //   return new PwgError(405, 'The image (file) is missing');
    12711271  // }
    1272  
     1272
    12731273  // file_put_contents('/tmp/plupload.log', "[".date('c')."] ".__FUNCTION__."\n\n", FILE_APPEND);
    12741274  // file_put_contents('/tmp/plupload.log', '$_FILES = '.var_export($_FILES, true)."\n", FILE_APPEND);
     
    13431343  if (!$chunks || $chunk == $chunks - 1)
    13441344  {
    1345     // Strip the temp .part suffix off 
     1345    // Strip the temp .part suffix off
    13461346    rename("{$filePath}.part", $filePath);
    1347  
     1347
    13481348    include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
    1349    
     1349
    13501350    $image_id = add_uploaded_file(
    13511351      $filePath,
     
    13551355      null // image_id = not provided, this is a new photo
    13561356      );
    1357    
     1357
    13581358    $query = '
    13591359SELECT
     
    13761376
    13771377    $category_name = get_cat_display_name_from_id($params['category'][0], null);
    1378    
     1378
    13791379    return array(
    13801380      'image_id' => $image_id,
     
    14211421  WHERE md5sum IN (\''. implode("','", $md5sums) .'\')
    14221422;';
    1423     $id_of_md5 = simple_hash_from_query($query, 'md5sum', 'id');
     1423    $id_of_md5 = query2array($query, 'md5sum', 'id');
    14241424
    14251425    foreach ($md5sums as $md5sum)
     
    14321432    }
    14331433  }
    1434   else if ('filename' == $conf['uniqueness_mode'])
     1434  elseif ('filename' == $conf['uniqueness_mode'])
    14351435  {
    14361436    // search among photos the list of photos already added, based on
     
    14481448  WHERE file IN (\''. implode("','", $filenames) .'\')
    14491449;';
    1450     $id_of_filename = simple_hash_from_query($query, 'file', 'id');
     1450    $id_of_filename = query2array($query, 'file', 'id');
    14511451
    14521452    foreach ($filenames as $filename)
     
    15031503    $compare_type = 'high';
    15041504  }
    1505   else if (isset($params['file_sum']))
     1505  elseif (isset($params['file_sum']))
    15061506  {
    15071507    $compare_type = 'file';
Note: See TracChangeset for help on using the changeset viewer.