Changeset 587 for trunk/picture.php


Ignore:
Timestamp:
Oct 30, 2004, 5:42:29 PM (20 years ago)
Author:
z0rglub
Message:
  • function mysql_query replaced by pwg_query : the same with debugging features
  • by default, DEBUG is set to 0 (off)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r579 r587  
    3838}
    3939//---------------------------------------- incrementation of the number of hits
    40 $query = 'UPDATE '.IMAGES_TABLE.' SET hit=hit+1';
    41 $query.= ' WHERE id='.$_GET['image_id'];
    42 $query.= ';';
    43 @mysql_query( $query );
     40$query = '
     41UPDATE '.IMAGES_TABLE.'
     42  SET hit = hit+1
     43  WHERE id = '.$_GET['image_id'].'
     44;';
     45@pwg_query( $query );
    4446//-------------------------------------------------------------- initialization
    4547initialize_category( 'picture' );
     
    5254  '.$conf['order_by'].'
    5355;';
    54 $result = mysql_query( $query );
     56$result = pwg_query( $query );
    5557$page['num'] = 0;
    5658$belongs = false;
     
    112114$query.= ';';
    113115
    114 $result = mysql_query( $query );
     116$result = pwg_query( $query );
    115117$indexes = array('prev', 'current', 'next');
    116118
     
    226228    AND element_id = '.$_GET['image_id'].'
    227229;';
    228   mysql_query($query);
     230  pwg_query($query);
    229231  $query = '
    230232INSERT INTO '.RATE_TABLE.'
     
    233235  ('.$user['id'].','.$_GET['image_id'].','.$_GET['rate'].')
    234236;';
    235   mysql_query($query);
     237  pwg_query($query);
    236238
    237239  // update of images.average_rate field
     
    241243  WHERE element_id = '.$_GET['image_id'].'
    242244;';
    243   $row = mysql_fetch_array(mysql_query($query));
     245  $row = mysql_fetch_array(pwg_query($query));
    244246  $query = '
    245247UPDATE '.IMAGES_TABLE.'
     
    247249  WHERE id = '.$_GET['image_id'].'
    248250;';
    249   mysql_query($query);
     251  pwg_query($query);
    250252}
    251253//--------------------------------------------------------- favorite management
     
    256258  $query.= ' AND image_id = '.$picture['current']['id'];
    257259  $query.= ';';
    258   $result = mysql_query( $query );
     260  $result = pwg_query( $query );
    259261 
    260262  if ( $_GET['add_fav'] == 1 )
     
    264266    $query.= ' ('.$picture['current']['id'].','.$user['id'].')';
    265267    $query.= ';';
    266     $result = mysql_query( $query );
     268    $result = pwg_query( $query );
    267269  }
    268270  if ( !$_GET['add_fav'] and $page['cat'] == 'fav' )
     
    302304    $query.= " WHERE username = '".$author."'";
    303305    $query.= ';';
    304     $row = mysql_fetch_array( mysql_query( $query ) );
     306    $row = mysql_fetch_array( pwg_query( $query ) );
    305307    if ( $row['user_exists'] == 1 )
    306308    {
     
    320322    $query.= " AND author = '".$author."'";
    321323    $query.= ';';
    322     if ( mysql_num_rows( mysql_query( $query ) ) == 0
     324    if ( mysql_num_rows( pwg_query( $query ) ) == 0
    323325         or $conf['anti-flood_time'] == 0 )
    324326    {
     
    337339      }
    338340      $query.= ');';
    339       mysql_query( $query );
     341      pwg_query( $query );
    340342      // information message
    341343      $message = $lang['comment_added'];
     
    371373  $query.= ' WHERE id = '.$_GET['del'];
    372374  $query.= ';';
    373   mysql_query( $query );
     375  pwg_query( $query );
    374376}
    375377
     
    503505  $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id'];
    504506  $query.= ' AND user_id = '.$user['id'].';';
    505   $result = mysql_query( $query );
     507  $result = pwg_query( $query );
    506508  $row = mysql_fetch_array( $result );
    507509  if (!$row['nb_fav'])
     
    713715  WHERE element_id = '.$picture['current']['id'].'
    714716;';
    715   $row = mysql_fetch_array(mysql_query($query));
     717  $row = mysql_fetch_array(pwg_query($query));
    716718  if ($row['count'] == 0)
    717719  {
     
    746748$query.= '
    747749;';
    748 $result = mysql_query($query);
     750$result = pwg_query($query);
    749751$categories = '';
    750752while ($row = mysql_fetch_array($result))
     
    871873    AND element_id = '.$_GET['image_id'].'
    872874;';
    873   $result = mysql_query($query);
     875  $result = pwg_query($query);
    874876  if (mysql_num_rows($result) > 0)
    875877  {
     
    922924  $query.= " AND validated = 'true'";
    923925  $query.= ';';
    924   $row = mysql_fetch_array( mysql_query( $query ) );
     926  $row = mysql_fetch_array( pwg_query( $query ) );
    925927 
    926928  // navigation bar creation
     
    951953  $query.= ' ORDER BY date ASC';
    952954  $query.= ' LIMIT '.$page['start'].', '.$conf['nb_comment_page'].';';
    953   $result = mysql_query( $query );
     955  $result = pwg_query( $query );
    954956               
    955957  while ( $row = mysql_fetch_array( $result ) )
Note: See TracChangeset for help on using the changeset viewer.