Changeset 20461 for extensions


Ignore:
Timestamp:
Jan 29, 2013, 10:21:43 PM (11 years ago)
Author:
rvelices
Message:

rv* plugins use pwg_db_* instead of mysql_* functions

Location:
extensions
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_db_integrity/check_db.php

    r8897 r20461  
    88  $query = '
    99DESCRIBE '.$reft.' '.$reff;
    10   $row = mysql_fetch_assoc( pwg_query($query) );
     10  $row = pwg_db_fetch_assoc( pwg_query($query) );
    1111  $ref_nullable = ( $row['Null'] != '');
    1212
     
    2121
    2222  $result = pwg_query($query);
    23   return mysql_num_rows($result);
     23  return pwg_db_num_rows($result);
    2424}
    2525
     
    9999  FROM '.CATEGORIES_TABLE.' c INNER JOIN '.OLD_PERMALINKS_TABLE.' op ON c.permalink=op.permalink';
    100100        $result = pwg_query($query);
    101         $tpl_var['result'] = mysql_num_rows($result);
    102         while ($row=mysql_fetch_assoc($result))
     101        $tpl_var['result'] = pwg_db_num_rows($result);
     102        while ($row=pwg_db_fetch_assoc($result))
    103103        {
    104104                $tpl_var['errors'][] = $row['permalink'].' matches categories '.$row['id'].' and '.$row['cat_id'];
     
    122122  WHERE (ic.category_id IS NULL OR ic.image_id IS NULL) AND i.storage_category_id IS NOT NULL';
    123123        $result = pwg_query($query);
    124         $tpl_var['result'] = mysql_num_rows($result);
     124        $tpl_var['result'] = pwg_db_num_rows($result);
    125125        $i=0;
    126         while ($row=mysql_fetch_assoc($result) and $i<=50 )
     126        while ($row=pwg_db_fetch_assoc($result) and $i<=50 )
    127127        {
    128128                $tpl_var['errors'][] = $row['path'].' missing entry ('.$row['id'].','.$row['storage_category_id']. ') in #'.IMAGE_CATEGORY_TABLE;
  • extensions/rv_gmaps/trunk/include/functions.php

    r13092 r20461  
    2828ORDER BY NULL
    2929LIMIT 0,1';
    30         if ( mysql_num_rows(pwg_query($query))> 0)
     30        if ( pwg_db_num_rows(pwg_query($query))> 0)
    3131                return true;
    3232        return false;
  • extensions/rv_gmaps/trunk/include/functions_map.php

    r18928 r20461  
    319319  $uppercats_list = array();
    320320  $cat_bounds = array();
    321   while ($row = mysql_fetch_assoc($result))
    322   {
    323     array_push($uppercats_list, $row['uppercats']);
     321  while ($row = pwg_db_fetch_assoc($result))
     322  {
     323    $uppercats_list[] = $row['uppercats'];
    324324    $cat_id = $row['cat_id'];
    325325    unset( $row['cat_id'], $row['uppercats'] );
     
    363363
    364364
    365 function marray_from_query($query)
    366 {
    367   $ret = array();
    368   $result = pwg_query($query);
    369   while ($row = mysql_fetch_assoc($result))
    370     $ret[] = $row;
    371   return $ret;
    372 }
    373 
    374365define('RVM_BUILD_ARRAY',     0);
    375366define('RVM_BUILD_HASH',      1);
     
    398389  {
    399390    case RVM_BUILD_ARRAY:
    400       $func = 'marray_from_query';
     391      $func = 'array_from_query';
    401392      $group_by = '
    402393  GROUP BY i.id';
     
    408399      break;
    409400    case RVM_BUILD_AGGREGATE:
    410       $func = 'marray_from_query';
     401      $func = 'array_from_query';
    411402      $group_by = '';
    412403      break;
  • extensions/rv_gmaps/trunk/kml.php

    r17513 r20461  
    8282  $categories = array();
    8383  $thumbnail_ids=array();
    84   while ($row = mysql_fetch_assoc($result))
     84  while ($row = pwg_db_fetch_assoc($result))
    8585  {
    86     array_push($categories, $row);
     86    $categories[] = $row;
    8787    if (isset($row['representative_picture_id']) and is_numeric($row['representative_picture_id']))
    88       array_push($thumbnail_ids, $row['representative_picture_id'] );
     88      $thumbnail_ids[] = $row['representative_picture_id'];
    8989  }
    9090  $thumbnail_src_of = array();
     
    9696  WHERE id IN ('.implode(',', $thumbnail_ids).')';
    9797    $result = pwg_query($query);
    98     while ($row = mysql_fetch_assoc($result))
     98    while ($row = pwg_db_fetch_assoc($result))
    9999      $thumbnail_src_of[$row['id']] = DerivativeImage::thumb_url($row);
    100100    unset($thumbnail_ids);
  • extensions/rv_gmaps/trunk/mapl.php

    r18669 r20461  
    7777  LIMIT 0,5
    7878;';
    79 $result = pwg_query($query);
    80 $categories=array();
    81 while ($row=mysql_fetch_assoc($result))
    82   array_push($categories, $row);
     79$categories = array_from_query($query);
    8380$categories = add_level_to_tags($categories);
    8481
  • extensions/rv_sitemap/sitemap.php

    r17516 r20461  
    122122  WHERE max_date_last IS NOT NULL
    123123  ORDER BY global_rank';
    124 $result = pwg_query($query);
    125 $categories = array();
    126 while ($row = mysql_fetch_assoc($result))
    127 {
    128   $categories[] = $row;
    129 }
     124$categories = array_from_query($query);
    130125usort($categories, 'global_rank_compare');
    131126
     
    205200    $result = pwg_query($query);
    206201    $tag_infos = array();
    207     while ($row = mysql_fetch_assoc($result))
     202    while ($row = pwg_db_fetch_assoc($result))
    208203    {
    209204      $tag_infos[$row['tag_id']]= max( $row['da'],$row['dc'],$row['dm']);
     
    241236  LIMIT '.$photo_count;
    242237    $result = pwg_query($query);
    243     while ($row = mysql_fetch_assoc($result))
     238    while ($row = pwg_db_fetch_assoc($result))
    244239    {
    245240      $url = make_picture_url( array(
Note: See TracChangeset for help on using the changeset viewer.