- Timestamp:
- Oct 30, 2004, 5:42:29 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r539 r587 54 54 $query.= ' WHERE id = '.$_GET['group_id']; 55 55 $query.= ';'; 56 $result = mysql_query( $query );56 $result = pwg_query( $query ); 57 57 if ( mysql_num_rows( $result ) > 0 ) 58 58 { … … 142 142 $query.= " WHERE validated='false'"; 143 143 $query.= ';'; 144 $result = mysql_query( $query );144 $result = pwg_query( $query ); 145 145 $nb_waiting = ''; 146 146 if ( mysql_num_rows( $result ) > 0 ) … … 152 152 $query.= " WHERE validated='false'"; 153 153 $query.= ';'; 154 $result = mysql_query( $query );154 $result = pwg_query( $query ); 155 155 $nb_comments = ''; 156 156 if ( mysql_num_rows( $result ) > 0 ) -
trunk/admin/admin_upload.php
r403 r587 51 51 } 52 52 $query.=');'; 53 mysql_query ($query);53 pwg_query ($query); 54 54 } 55 55 … … 59 59 $query.= ' ORDER BY name ASC'; 60 60 $query.= ';'; 61 $result = mysql_query( $query );61 $result = pwg_query( $query ); 62 62 while ( $row = mysql_fetch_assoc( $result ) ) 63 63 { -
trunk/admin/cat_list.php
r580 r587 70 70 WHERE id = '.$parent_id.' 71 71 ;'; 72 $parent_uppercats = array_pop(mysql_fetch_array( mysql_query($query)));72 $parent_uppercats = array_pop(mysql_fetch_array(pwg_query($query))); 73 73 } 74 74 … … 80 80 (\''.$_POST['virtual_name'].'\','.$parent_id.','.$_POST['rank'].') 81 81 ;'; 82 mysql_query($query);82 pwg_query($query); 83 83 84 84 // And last we update the uppercats … … 87 87 FROM '.CATEGORIES_TABLE.' 88 88 ;'; 89 $my_id = array_pop(mysql_fetch_array( mysql_query($query)));89 $my_id = array_pop(mysql_fetch_array(pwg_query($query))); 90 90 91 91 $query = ' … … 100 100 WHERE id = '.$my_id.' 101 101 ;'; 102 mysql_query($query);102 pwg_query($query); 103 103 array_push($infos, $lang['cat_list_virtual_category_added']); 104 104 } … … 123 123 ORDER BY rank ASC 124 124 ;'; 125 $result = mysql_query($query);125 $result = pwg_query($query); 126 126 while ($row = mysql_fetch_assoc($result)) 127 127 { … … 170 170 WHERE id = '.$_GET['up'].' 171 171 ;'; 172 mysql_query($query);172 pwg_query($query); 173 173 $query = ' 174 174 UPDATE '.CATEGORIES_TABLE.' … … 176 176 WHERE id = '.$categories[($current_rank-1)]['id'].' 177 177 ;'; 178 mysql_query($query);178 pwg_query($query); 179 179 // 3. Updating the cache array 180 180 $categories[$current_rank] = $categories[($current_rank-1)]; … … 189 189 WHERE id = '.$_GET['up'].' 190 190 ;'; 191 mysql_query($query);191 pwg_query($query); 192 192 $query = ' 193 193 UPDATE '.CATEGORIES_TABLE.' … … 204 204 $query.= ' 205 205 ;'; 206 mysql_query($query);206 pwg_query($query); 207 207 // 3. Updating the cache array 208 208 array_push($categories, $current); … … 229 229 WHERE id = '.$_GET['down'].' 230 230 ;'; 231 mysql_query($query);231 pwg_query($query); 232 232 $query = ' 233 233 UPDATE '.CATEGORIES_TABLE.' … … 235 235 WHERE id = '.$categories[($current_rank+1)]['id'].' 236 236 ;'; 237 mysql_query($query);237 pwg_query($query); 238 238 // 3. Updating the cache array 239 239 $categories[$current_rank]=$categories[($current_rank+1)]; … … 248 248 WHERE id = '.$_GET['down'].' 249 249 ;'; 250 mysql_query($query);250 pwg_query($query); 251 251 $query = ' 252 252 UPDATE '.CATEGORIES_TABLE.' … … 263 263 $query.= ' 264 264 ;'; 265 mysql_query($query);265 pwg_query($query); 266 266 // 3. Updating the cache array 267 267 array_unshift($categories, $current); … … 351 351 WHERE id_uppercat = '.$category['id'].' 352 352 ;'; 353 $row = mysql_fetch_array( mysql_query($query));353 $row = mysql_fetch_array(pwg_query($query)); 354 354 355 355 if ($row['nb_sub_cats'] > 0) -
trunk/admin/cat_modify.php
r530 r587 49 49 $query.= ' WHERE id = '.$_GET['cat_id']; 50 50 $query.= ';'; 51 $row = mysql_fetch_array( mysql_query( $query ) );51 $row = mysql_fetch_array( pwg_query( $query ) ); 52 52 53 53 $query = 'UPDATE '.CATEGORIES_TABLE; … … 79 79 $query.= ' WHERE id = '.$_GET['cat_id']; 80 80 $query.= ';'; 81 mysql_query( $query );81 pwg_query( $query ); 82 82 83 83 if ( $_POST['status'] != $row['status'] ) … … 87 87 $query.= ' FROM '.GROUP_ACCESS_TABLE; 88 88 $query.= ' WHERE cat_id = '.$_GET['cat_id']; 89 mysql_query( $query );89 pwg_query( $query ); 90 90 // deletion of all access for users concerning this category 91 91 $query = 'DELETE'; 92 92 $query.= ' FROM '.USER_ACCESS_TABLE; 93 93 $query.= ' WHERE cat_id = '.$_GET['cat_id']; 94 mysql_query( $query );94 pwg_query( $query ); 95 95 } 96 96 … … 99 99 $query.= ' FROM '.USERS_TABLE; 100 100 $query.= ';'; 101 $result = mysql_query( $query );101 $result = pwg_query( $query ); 102 102 while ( $row = mysql_fetch_array( $result ) ) 103 103 { … … 112 112 $query.= ' AND a.site_id = b.id'; 113 113 $query.= ';'; 114 $category = mysql_fetch_array( mysql_query( $query ) );114 $category = mysql_fetch_array( pwg_query( $query ) ); 115 115 // nullable fields 116 116 foreach (array('comment','dir') as $nullable) … … 181 181 $query.= ' FROM '.CATEGORIES_TABLE; 182 182 $query.= ';'; 183 $countrow = mysql_fetch_array( mysql_query( $query ) );183 $countrow = mysql_fetch_array( pwg_query( $query ) ); 184 184 if ( $countrow['nb_total_categories'] < $conf['max_LOV_categories'] ) 185 185 { -
trunk/admin/cat_perm.php
r364 r587 52 52 $query.= ' WHERE cat_id = '.$page['cat']; 53 53 $query.= ';'; 54 mysql_query( $query );54 pwg_query( $query ); 55 55 $query = 'SELECT id'; 56 56 $query.= ' FROM '.PREFIX_TABLE.'groups'; 57 57 $query.= ';'; 58 $result = mysql_query( $query );58 $result = pwg_query( $query ); 59 59 while ( $row = mysql_fetch_array( $result ) ) 60 60 { … … 66 66 $query.= ' ('.$page['cat'].','.$row['id'].')'; 67 67 $query.= ';'; 68 mysql_query( $query );68 pwg_query( $query ); 69 69 } 70 70 } … … 74 74 $query.= ' WHERE cat_id = '.$page['cat']; 75 75 $query.= ';'; 76 mysql_query( $query );76 pwg_query( $query ); 77 77 $query = 'SELECT id'; 78 78 $query.= ' FROM '.USERS_TABLE; 79 79 $query.= ';'; 80 $result = mysql_query( $query );80 $result = pwg_query( $query ); 81 81 while ( $row = mysql_fetch_array( $result ) ) 82 82 { … … 88 88 $query.= ' ('.$page['cat'].','.$row['id'].')'; 89 89 $query.= ';'; 90 mysql_query( $query );90 pwg_query( $query ); 91 91 } 92 92 check_favorites( $row['id'] ); … … 99 99 $query.= ' FROM '.PREFIX_TABLE.'groups'; 100 100 $query. ';'; 101 $result = mysql_query( $query );101 $result = pwg_query( $query ); 102 102 if ( mysql_num_rows( $result ) > 0 ) 103 103 { … … 108 108 $query.= ' WHERE cat_id = '.$_GET['cat_id']; 109 109 $query.= ';'; 110 $subresult = mysql_query( $query );110 $subresult = pwg_query( $query ); 111 111 $authorized_groups = array(); 112 112 while ( $subrow = mysql_fetch_array( $subresult ) ) … … 145 145 } 146 146 $query.= ';'; 147 $result = mysql_query( $query );147 $result = pwg_query( $query ); 148 148 while ( $row = mysql_fetch_array( $result ) ) 149 149 { … … 196 196 $query.= ' AND ug.user_id = '.$row['id']; 197 197 $query.= ';'; 198 $subresult = mysql_query( $query );198 $subresult = pwg_query( $query ); 199 199 if ( mysql_num_rows( $subresult ) > 0 ) 200 200 { -
trunk/admin/configuration.php
r555 r587 42 42 } 43 43 //------------------------------------------------------ $conf reinitialization 44 $result = mysql_query('SELECT param,value FROM '.CONFIG_TABLE);44 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE); 45 45 while ($row = mysql_fetch_array($result)) 46 46 { … … 126 126 if (count($errors) == 0) 127 127 { 128 $result = mysql_query('SELECT * FROM '.CONFIG_TABLE);128 $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); 129 129 while ($row = mysql_fetch_array($result)) 130 130 { … … 136 136 WHERE param = \''.$row['param'].'\' 137 137 ;'; 138 mysql_query($query);138 pwg_query($query); 139 139 } 140 140 } -
trunk/admin/group_list.php
r362 r587 40 40 $query.= ' WHERE id = '.$_GET['delete']; 41 41 $query.= ';'; 42 $row = mysql_fetch_array( mysql_query( $query ) );42 $row = mysql_fetch_array( pwg_query( $query ) ); 43 43 // confirm group deletion ? 44 44 if ( !isset( $_GET['confirm'] ) or $_GET['confirm'] != 1 ) … … 61 61 $query.= ' WHERE id = '.$_GET['delete']; 62 62 $query.= ';'; 63 $row2 = mysql_fetch_array( mysql_query( $query ) );63 $row2 = mysql_fetch_array( pwg_query( $query ) ); 64 64 if ( $row2['nb_result'] > 0 ) 65 65 { … … 92 92 $query.= " WHERE name = '".$_POST['name']."'"; 93 93 $query.= ';'; 94 $result = mysql_query( $query );94 $result = pwg_query( $query ); 95 95 if ( mysql_num_rows( $result ) > 0 ) 96 96 { … … 104 104 $query.= " (name) VALUES ('".$_POST['name']."')"; 105 105 $query.= ';'; 106 mysql_query( $query );106 pwg_query( $query ); 107 107 } 108 108 } … … 126 126 $query.= ' ORDER BY id ASC'; 127 127 $query.= ';'; 128 $result = mysql_query( $query );128 $result = pwg_query( $query ); 129 129 while ( $row = mysql_fetch_array( $result ) ) 130 130 { -
trunk/admin/group_perm.php
r364 r587 41 41 $query.= ' WHERE group_id = '.$_GET['group_id']; 42 42 $query.= ';'; 43 mysql_query( $query );43 pwg_query( $query ); 44 44 // selecting all private categories 45 45 $query = 'SELECT id'; … … 47 47 $query.= " WHERE status = 'private'"; 48 48 $query.= ';'; 49 $result = mysql_query( $query );49 $result = pwg_query( $query ); 50 50 while ( $row = mysql_fetch_array( $result ) ) 51 51 { … … 57 57 $query.= ' ('.$_GET['group_id'].','.$row['id'].')'; 58 58 $query.= ';'; 59 mysql_query ( $query );59 pwg_query ( $query ); 60 60 } 61 61 } … … 64 64 $query.= ' FROM '.USERS_TABLE; 65 65 $query.= ';'; 66 $result = mysql_query( $query );66 $result = pwg_query( $query ); 67 67 while ( $row = mysql_fetch_array( $result ) ) 68 68 { … … 86 86 $query.= " WHERE status = 'private'"; 87 87 $query.= ';'; 88 $result = mysql_query( $query );88 $result = pwg_query( $query ); 89 89 while ( $row = mysql_fetch_array( $result ) ) 90 90 { -
trunk/admin/images/global_stats.img.php
r566 r587 73 73 74 74 // Add Values to the bargraph.. 75 $result = mysql_query($sql)75 $result = pwg_query($sql) 76 76 or die(mysql_errno().": ".mysql_error()."<BR>".$sql); 77 77 -
trunk/admin/include/functions.php
r563 r587 168 168 WHERE site_id = '.$id.' 169 169 ;'; 170 $result = mysql_query($query);170 $result = pwg_query($query); 171 171 $category_ids = array(); 172 172 while ($row = mysql_fetch_array($result)) … … 181 181 WHERE id = '.$id.' 182 182 ;'; 183 mysql_query($query);183 pwg_query($query); 184 184 } 185 185 … … 206 206 WHERE storage_category_id IN ('.implode(',', $ids).') 207 207 ;'; 208 $result = mysql_query($query);208 $result = pwg_query($query); 209 209 $element_ids = array(); 210 210 while ($row = mysql_fetch_array($result)) … … 219 219 WHERE category_id IN ('.implode(',', $ids).') 220 220 ;'; 221 mysql_query($query);221 pwg_query($query); 222 222 223 223 // destruction of the access linked to the category … … 226 226 WHERE cat_id IN ('.implode(',', $ids).') 227 227 ;'; 228 mysql_query($query);228 pwg_query($query); 229 229 $query = ' 230 230 DELETE FROM '.GROUP_ACCESS_TABLE.' 231 231 WHERE cat_id IN ('.implode(',', $ids).') 232 232 ;'; 233 mysql_query($query);233 pwg_query($query); 234 234 235 235 // destruction of the sub-categories … … 239 239 WHERE id_uppercat IN ('.implode(',', $ids).') 240 240 ;'; 241 $result = mysql_query($query);241 $result = pwg_query($query); 242 242 $subcat_ids = array(); 243 243 while($row = mysql_fetch_array($result)) … … 255 255 WHERE id IN ('.implode(',', $ids).') 256 256 ;'; 257 mysql_query($query);257 pwg_query($query); 258 258 259 259 if (isset($counts['del_categories'])) … … 283 283 '.wordwrap(implode(', ', $ids), 80, "\n").') 284 284 ;'; 285 mysql_query($query);285 pwg_query($query); 286 286 287 287 // destruction of the links between images and this category … … 291 291 '.wordwrap(implode(', ', $ids), 80, "\n").') 292 292 ;'; 293 mysql_query($query);293 pwg_query($query); 294 294 295 295 // destruction of the favorites associated with the picture … … 299 299 '.wordwrap(implode(', ', $ids), 80, "\n").') 300 300 ;'; 301 mysql_query($query);301 pwg_query($query); 302 302 303 303 // destruction of the rates associated to this element … … 307 307 '.wordwrap(implode(', ', $ids), 80, "\n").') 308 308 ;'; 309 mysql_query($query);309 pwg_query($query); 310 310 311 311 // destruction of the image … … 315 315 '.wordwrap(implode(', ', $ids), 80, "\n").') 316 316 ;'; 317 mysql_query($query);317 pwg_query($query); 318 318 319 319 if (isset($counts['del_elements'])) … … 336 336 $query.= ' WHERE user_id = '.$user_id; 337 337 $query.= ';'; 338 mysql_query( $query );338 pwg_query( $query ); 339 339 340 340 // destruction of the group links for this user … … 342 342 $query.= ' WHERE user_id = '.$user_id; 343 343 $query.= ';'; 344 mysql_query( $query );344 pwg_query( $query ); 345 345 346 346 // destruction of the favorites associated with the user … … 348 348 $query.= ' WHERE user_id = '.$user_id; 349 349 $query.= ';'; 350 mysql_query( $query );350 pwg_query( $query ); 351 351 352 352 // destruction of the sessions linked with the user … … 354 354 $query.= ' WHERE user_id = '.$user_id; 355 355 $query.= ';'; 356 mysql_query( $query );356 pwg_query( $query ); 357 357 358 358 // destruction of the user … … 360 360 $query.= ' WHERE id = '.$user_id; 361 361 $query.= ';'; 362 mysql_query( $query );362 pwg_query( $query ); 363 363 } 364 364 … … 373 373 $query.= ' WHERE group_id = '.$group_id; 374 374 $query.= ';'; 375 mysql_query( $query );375 pwg_query( $query ); 376 376 377 377 // synchronize all users linked to the group … … 382 382 $query.= ' WHERE group_id = '.$group_id; 383 383 $query.= ';'; 384 mysql_query( $query );384 pwg_query( $query ); 385 385 386 386 // destruction of the group … … 388 388 $query.= ' WHERE id = '.$group_id; 389 389 $query.= ';'; 390 mysql_query( $query );390 pwg_query( $query ); 391 391 } 392 392 … … 400 400 $query.= ' WHERE id = '.$user_id; 401 401 $query.= ';'; 402 $row = mysql_fetch_array( mysql_query( $query ) );402 $row = mysql_fetch_array( pwg_query( $query ) ); 403 403 $status = $row['status']; 404 404 // retrieving all the restricted categories for this user … … 413 413 $query.= ' WHERE user_id = '.$user_id; 414 414 $query.= ';'; 415 $result = mysql_query ( $query );415 $result = pwg_query ( $query ); 416 416 while ( $row = mysql_fetch_array( $result ) ) 417 417 { … … 424 424 $query.= ' WHERE image_id = '.$row['image_id']; 425 425 $query.= ';'; 426 $picture_result = mysql_query( $query );426 $picture_result = pwg_query( $query ); 427 427 $picture_cat = array(); 428 428 while ( $picture_row = mysql_fetch_array( $picture_result ) ) … … 436 436 $query.= ' AND user_id = '.$user_id; 437 437 $query.= ';'; 438 mysql_query( $query );438 pwg_query( $query ); 439 439 } 440 440 } … … 465 465 GROUP BY category_id 466 466 ;'; 467 $result = mysql_query( $query );467 $result = pwg_query( $query ); 468 468 while ( $row = mysql_fetch_array( $result ) ) 469 469 { … … 475 475 WHERE id = '.$row['category_id'].' 476 476 ;'; 477 mysql_query($query);477 pwg_query($query); 478 478 } 479 479 … … 486 486 AND id IN ('.implode(',', $cat_ids).') 487 487 ;'; 488 $result = mysql_query( $query );488 $result = pwg_query( $query ); 489 489 while ( $row = mysql_fetch_array( $result ) ) 490 490 { … … 495 495 AND image_id = '.$row['representative_picture_id'].' 496 496 ;'; 497 $result = mysql_query( $query );497 $result = pwg_query( $query ); 498 498 if (mysql_num_rows($result) == 0) 499 499 { … … 503 503 WHERE id = '.$row['id'].' 504 504 ;'; 505 mysql_query( $query );505 pwg_query( $query ); 506 506 } 507 507 } … … 599 599 $query.= " WHERE status = 'private'"; 600 600 $query.= ';'; 601 $result = mysql_query( $query );601 $result = pwg_query( $query ); 602 602 $privates = array(); 603 603 while ( $row = mysql_fetch_array( $result ) ) … … 612 612 $query.= ' WHERE user_id = '.$user_id; 613 613 $query.= ';'; 614 $result = mysql_query( $query );614 $result = pwg_query( $query ); 615 615 while ( $row = mysql_fetch_array( $result ) ) 616 616 { … … 627 627 $query.= ' AND ug.user_id = '.$user_id; 628 628 $query.= ';'; 629 $result = mysql_query( $query );629 $result = pwg_query( $query ); 630 630 while ( $row = mysql_fetch_array( $result ) ) 631 631 { … … 650 650 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 651 651 $query.= " WHERE visible = 'false';"; 652 $result = mysql_query( $query );652 $result = pwg_query( $query ); 653 653 while ( $row = mysql_fetch_array( $result ) ) 654 654 { … … 680 680 $query .= ' WHERE id = '.$user_id; 681 681 $query.= ';'; 682 mysql_query( $query );682 pwg_query( $query ); 683 683 684 684 return $restrictions; … … 699 699 $query.= ' WHERE id = '.$user_id; 700 700 $query.= ';'; 701 $row = mysql_fetch_array( mysql_query( $query ) );701 $row = mysql_fetch_array( pwg_query( $query ) ); 702 702 703 703 $base_restrictions=get_user_restrictions($user_id,$row['status'],true,true); … … 728 728 $query.= ' WHERE id = '.$category_id; 729 729 $query.= ';'; 730 $row = mysql_fetch_array( mysql_query( $query ) );730 $row = mysql_fetch_array( pwg_query( $query ) ); 731 731 $uppercats = explode( ',', $row['uppercats'] ); 732 732 foreach ( $uppercats as $category_id ) { -
trunk/admin/include/functions_metadata.php
r582 r587 129 129 // update queries 130 130 $query = 'SELECT VERSION() AS version;'; 131 $row = mysql_fetch_array( mysql_query($query));131 $row = mysql_fetch_array(pwg_query($query)); 132 132 if (version_compare($row['version'],'4.0.4') < 0) 133 133 { … … 152 152 ;'; 153 153 // echo '<pre>'.$query.'</pre>'; 154 mysql_query($query);154 pwg_query($query); 155 155 } 156 156 } … … 161 161 DESCRIBE '.IMAGES_TABLE.' 162 162 ;'; 163 $result = mysql_query($query);163 $result = pwg_query($query); 164 164 $columns = array(); 165 165 while ($row = mysql_fetch_array($result)) … … 188 188 ;'; 189 189 // echo '<pre>'.$query.'</pre>'; 190 mysql_query($query);190 pwg_query($query); 191 191 // inserts all found pictures 192 192 $query = ' … … 225 225 ;'; 226 226 // echo '<pre>'.$query.'</pre>'; 227 mysql_query($query);227 pwg_query($query); 228 228 // update of images table by joining with temporary table 229 229 $query = ' … … 236 236 ;'; 237 237 echo '<pre>'.$query.'</pre>'; 238 mysql_query($query);238 pwg_query($query); 239 239 } 240 240 } … … 259 259 WHERE dir IS NOT NULL 260 260 ;'; 261 $result = mysql_query($query);261 $result = pwg_query($query); 262 262 $cat_dirs = array(); 263 263 while ($row = mysql_fetch_array($result)) … … 292 292 $query.= ' 293 293 ;'; 294 $result = mysql_query($query);294 $result = pwg_query($query); 295 295 while ($row = mysql_fetch_array($result)) 296 296 { … … 303 303 WHERE id = 1 304 304 '; 305 $row = mysql_fetch_array( mysql_query($query));305 $row = mysql_fetch_array(pwg_query($query)); 306 306 $basedir = $row['galleries_url']; 307 307 … … 329 329 $query.= ' 330 330 ;'; 331 $result = mysql_query($query);331 $result = pwg_query($query); 332 332 while ($row = mysql_fetch_array($result)) 333 333 { -
trunk/admin/infos_images.php
r579 r587 56 56 $query.= ' WHERE id = '.$_POST['associate']; 57 57 $query.= ';'; 58 if (mysql_num_rows( mysql_query($query)) == 0)58 if (mysql_num_rows(pwg_query($query)) == 0) 59 59 array_push($errors, $lang['cat_unknown_id']); 60 60 } … … 67 67 $query.= ' WHERE category_id = '.$page['cat']; 68 68 $query.= ';'; 69 $result = mysql_query($query);69 $result = pwg_query($query); 70 70 while ($row = mysql_fetch_array($result)) 71 71 { … … 109 109 $query.= ' WHERE id = '.$row['id']; 110 110 $query.= ';'; 111 mysql_query($query);111 pwg_query($query); 112 112 } 113 113 // add link to another category … … 118 118 $query.= ' ('.$row['id'].','.$_POST['associate'].')'; 119 119 $query.= ';'; 120 mysql_query($query);120 pwg_query($query); 121 121 $associate = true; 122 122 } … … 131 131 $query = 'SELECT image_id FROM '.IMAGE_CATEGORY_TABLE; 132 132 $query.= ' WHERE category_id = '.$page['cat']; 133 $result = mysql_query($query);133 $result = pwg_query($query); 134 134 while ($row = mysql_fetch_array($result)) 135 135 { … … 146 146 $query.= ' WHERE id = '.$row['image_id']; 147 147 $query.= ';'; 148 mysql_query($query);148 pwg_query($query); 149 149 } 150 150 } … … 156 156 $query = 'SELECT image_id FROM '.IMAGE_CATEGORY_TABLE; 157 157 $query.= ' WHERE category_id = '.$page['cat']; 158 $result = mysql_query($query);158 $result = pwg_query($query); 159 159 while ($row = mysql_fetch_array($result)) 160 160 { … … 170 170 $query.= ' WHERE id = '.$row['image_id']; 171 171 $query.= ';'; 172 mysql_query($query);172 pwg_query($query); 173 173 } 174 174 } … … 184 184 $query.= ' WHERE category_id = '.$page['cat']; 185 185 $query.= ';'; 186 $result = mysql_query($query);186 $result = pwg_query($query); 187 187 while ($row = mysql_fetch_array($result)) 188 188 { … … 223 223 $query.= ' WHERE id = '.$row['id']; 224 224 $query.= ';'; 225 mysql_query($query);225 pwg_query($query); 226 226 } 227 227 } … … 317 317 LIMIT '.$page['start'].','.$conf['info_nb_elements_page'].' 318 318 ;'; 319 $result = mysql_query($query);319 $result = pwg_query($query); 320 320 while ($row = mysql_fetch_array($result)) 321 321 { … … 346 346 $query = 'SELECT COUNT(id) AS nb_total_categories'; 347 347 $query.= ' FROM '.CATEGORIES_TABLE.';'; 348 $row = mysql_fetch_array( mysql_query($query));348 $row = mysql_fetch_array(pwg_query($query)); 349 349 if ($row['nb_total_categories'] < $conf['max_LOV_categories']) 350 350 { -
trunk/admin/picture_modify.php
r579 r587 83 83 $query.= ' WHERE id = '.$_GET['image_id']; 84 84 $query.= ';'; 85 mysql_query($query);85 pwg_query($query); 86 86 // make the picture representative of a category ? 87 87 $query = ' … … 91 91 AND image_id = '.$_GET['image_id'].' 92 92 ;'; 93 $result = mysql_query($query);93 $result = pwg_query($query); 94 94 while ($row = mysql_fetch_array($result)) 95 95 { … … 103 103 $query.= ' WHERE id = '.$row['category_id']; 104 104 $query.= ';'; 105 mysql_query($query);105 pwg_query($query); 106 106 } 107 107 // if the user ask this picture to be not any more the representative, … … 115 115 WHERE id = '.$row['category_id'].' 116 116 ;'; 117 mysql_query($query);117 pwg_query($query); 118 118 } 119 119 } … … 134 134 WHERE id = '.$_POST['associate'].' 135 135 ;'; 136 if (mysql_num_rows( mysql_query($query)) == 0)136 if (mysql_num_rows(pwg_query($query)) == 0) 137 137 array_push($errors, $lang['cat_unknown_id']); 138 138 } … … 148 148 ('.$_POST['associate'].','.$_GET['image_id'].') 149 149 ;'; 150 mysql_query($query);150 pwg_query($query); 151 151 $associate_or_dissociate = true; 152 152 update_category($_POST['associate']); … … 159 159 WHERE image_id = '.$_GET['image_id'].' 160 160 ;'; 161 $result = mysql_query($query);161 $result = pwg_query($query); 162 162 while ($row = mysql_fetch_array($result)) 163 163 { … … 169 169 AND category_id = '.$row['category_id'].' 170 170 ;'; 171 mysql_query($query);171 pwg_query($query); 172 172 $associate_or_dissociate = true; 173 173 update_category($row['category_id']); … … 186 186 WHERE id = '.$_GET['image_id'].' 187 187 ;'; 188 $row = mysql_fetch_array( mysql_query($query));188 $row = mysql_fetch_array(pwg_query($query)); 189 189 190 190 if (empty($row['name'])) … … 217 217 AND category_id = id 218 218 ;'; 219 $result = mysql_query($query);219 $result = pwg_query($query); 220 220 $categories = ''; 221 221 while ($cat_row = mysql_fetch_array($result)) … … 287 287 $query = 'SELECT COUNT(id) AS nb_total_categories'; 288 288 $query.= ' FROM '.CATEGORIES_TABLE.';'; 289 $row = mysql_fetch_array( mysql_query($query));289 $row = mysql_fetch_array(pwg_query($query)); 290 290 if ($row['nb_total_categories'] < $conf['max_LOV_categories']) 291 291 { -
trunk/admin/remote_site.php
r538 r587 103 103 AND dir IS NOT NULL 104 104 ;'; 105 $result = mysql_query($query);105 $result = pwg_query($query); 106 106 while ($row = mysql_fetch_array($result)) 107 107 { … … 156 156 $query.= ' 157 157 ;'; 158 mysql_query($query);158 pwg_query($query); 159 159 } 160 160 … … 234 234 WHERE id = '.$id_uppercat.' 235 235 ;'; 236 $row = mysql_fetch_array( mysql_query($query));236 $row = mysql_fetch_array(pwg_query($query)); 237 237 238 238 $uppercats = $row['uppercats']; … … 325 325 $query.= ' 326 326 ;'; 327 mysql_query($query);327 pwg_query($query); 328 328 } 329 329 … … 368 368 WHERE storage_category_id = '.$category_id.' 369 369 ;'; 370 $result = mysql_query($query);370 $result = pwg_query($query); 371 371 $to_delete = array(); 372 372 while ($row = mysql_fetch_array($result)) … … 391 391 WHERE storage_category_id = '.$category_id.' 392 392 ;'; 393 $result = mysql_query($query);393 $result = pwg_query($query); 394 394 while ($row = mysql_fetch_array($result)) 395 395 { … … 447 447 WHERE storage_category_id = '.$category_id.' 448 448 ;'; 449 $result = mysql_query($query);449 $result = pwg_query($query); 450 450 while ($row = mysql_fetch_array($result)) 451 451 { … … 460 460 AND image_id IN ('.implode(',', $ids).') 461 461 ;'; 462 mysql_query($query);462 pwg_query($query); 463 463 464 464 $query = ' … … 478 478 $query.= ' 479 479 ;'; 480 mysql_query($query);480 pwg_query($query); 481 481 } 482 482 } … … 537 537 WHERE galleries_url = \''.$page['galleries_url'].'\' 538 538 ;'; 539 $row = mysql_fetch_array( mysql_query($query));539 $row = mysql_fetch_array(pwg_query($query)); 540 540 if ($row['count'] > 0) 541 541 { … … 571 571 (\''.$page['galleries_url'].'\') 572 572 ;'; 573 mysql_query($query);573 pwg_query($query); 574 574 575 575 $template->assign_block_vars( … … 597 597 WHERE id = '.$page['site'].' 598 598 ;'; 599 list($galleries_url) = mysql_fetch_array( mysql_query($query));599 list($galleries_url) = mysql_fetch_array(pwg_query($query)); 600 600 } 601 601 … … 647 647 WHERE galleries_url = \''.addslashes($url).'\' 648 648 ;'; 649 $result = mysql_query($query);649 $result = pwg_query($query); 650 650 if (mysql_num_rows($result) == 0) 651 651 { … … 657 657 (\''.$url.'\') 658 658 ;'; 659 mysql_query($query);659 pwg_query($query); 660 660 $site_id = mysql_insert_id(); 661 661 } … … 699 699 WHERE galleries_url = \''.addslashes($url).'\' 700 700 ;'; 701 list($count) = mysql_fetch_array( mysql_query($query));701 list($count) = mysql_fetch_array(pwg_query($query)); 702 702 if ($count == 0) 703 703 { … … 716 716 WHERE id != 1 717 717 ;'; 718 $result = mysql_query($query);718 $result = pwg_query($query); 719 719 while ($row = mysql_fetch_array($result)) 720 720 { -
trunk/admin/search.php
r393 r587 75 75 WHERE username LIKE '" . str_replace("\'", "''", $username_search) . "' 76 76 ORDER BY username"; 77 if ( !($result = mysql_query($sql)) )77 if ( !($result = pwg_query($sql)) ) 78 78 { 79 79 die('Could not obtain search results'); -
trunk/admin/stats.php
r566 r587 53 53 FROM phpwg_history 54 54 GROUP BY DATE_FORMAT(date,'%Y-%m') DESC;"; 55 $result = mysql_query( $query );55 $result = pwg_query( $query ); 56 56 $i=0; 57 57 while ( $row = mysql_fetch_array( $result ) ) … … 67 67 AND FILE = 'picture' 68 68 GROUP BY FILE;"; 69 $pictures = mysql_fetch_array( mysql_query( $query ));69 $pictures = mysql_fetch_array(pwg_query( $query )); 70 70 71 71 // Number of different visitors … … 74 74 WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month' 75 75 GROUP BY login, IP;"; 76 $user_results = mysql_query( $query );76 $user_results = pwg_query( $query ); 77 77 $nb_visitors = 0; 78 78 $auth_users = array(); … … 113 113 $query.= ' ORDER BY date DESC'; 114 114 $query.= ';'; 115 $result = mysql_query( $query );115 $result = pwg_query( $query ); 116 116 $nb_pages_seen = mysql_num_rows( $result ); 117 117 $day['nb_pages_seen'] = $nb_pages_seen; -
trunk/admin/update.php
r581 r587 54 54 ORDER BY id_uppercat,rank,name 55 55 ;'; 56 $result = mysql_query($query);56 $result = pwg_query($query); 57 57 while ($row = mysql_fetch_array($result)) 58 58 { … … 67 67 WHERE id = '.$row['id'].' 68 68 ;'; 69 mysql_query($query);69 pwg_query($query); 70 70 } 71 71 } … … 85 85 $query.= ' WHERE id = '.$id_uppercat; 86 86 $query.= ';'; 87 $row = mysql_fetch_array( mysql_query( $query));87 $row = mysql_fetch_array( pwg_query( $query)); 88 88 $uppercats = $row['uppercats']; 89 89 $name = $row['name']; … … 99 99 WHERE id IN ('.$uppercats.') 100 100 ;'; 101 $result = mysql_query( $query);101 $result = pwg_query( $query); 102 102 while ($row = mysql_fetch_array($result)) 103 103 { … … 144 144 $query.= ' 145 145 ;'; 146 $result = mysql_query($query);146 $result = pwg_query($query); 147 147 while ($row = mysql_fetch_array($result)) 148 148 { … … 209 209 $query.= ' 210 210 ;'; 211 mysql_query($query);211 pwg_query($query); 212 212 213 213 $counts['new_categories']+= count($inserts); … … 236 236 $query.= ' 237 237 ;'; 238 mysql_query($query);238 pwg_query($query); 239 239 } 240 240 … … 257 257 $query.= ' 258 258 ;'; 259 $result = mysql_query($query);259 $result = pwg_query($query); 260 260 while ($row = mysql_fetch_array($result)) 261 261 { … … 292 292 WHERE storage_category_id = '.$category_id.' 293 293 ;'; 294 $result = mysql_query($query);294 $result = pwg_query($query); 295 295 while ($row = mysql_fetch_array($result)) 296 296 { … … 314 314 , $conf['picture_ext'])).') 315 315 ;'; 316 $result = mysql_query($query);316 $result = pwg_query($query); 317 317 while ($row = mysql_fetch_array($result)) 318 318 { … … 340 340 WHERE storage_category_id = '.$category_id.' 341 341 ;'; 342 $result = mysql_query($query);342 $result = pwg_query($query); 343 343 while ($row = mysql_fetch_array($result)) 344 344 { … … 356 356 AND validated = \'false\' 357 357 ;'; 358 $result = mysql_query($query);358 $result = pwg_query($query); 359 359 while ($row = mysql_fetch_array($result)) 360 360 { … … 505 505 ;'; 506 506 507 mysql_query($query);507 pwg_query($query); 508 508 509 509 // what are the ids of the pictures in the $category_id ? … … 515 515 WHERE storage_category_id = '.$category_id.' 516 516 ;'; 517 $result = mysql_query($query);517 $result = pwg_query($query); 518 518 while ($row = mysql_fetch_array($result)) 519 519 { … … 528 528 AND image_id IN ('.implode(',', $ids).') 529 529 ;'; 530 mysql_query($query);530 pwg_query($query); 531 531 532 532 foreach ($ids as $num => $image_id) … … 539 539 '.implode(',', $ids).' 540 540 ;'; 541 mysql_query($query);541 pwg_query($query); 542 542 } 543 543 return $output; -
trunk/admin/user_list.php
r393 r587 68 68 $query.= ' WHERE id = '.$_GET['delete']; 69 69 $query.= ';'; 70 $row = mysql_fetch_array( mysql_query( $query ) );70 $row = mysql_fetch_array( pwg_query( $query ) ); 71 71 // confirm user deletion ? 72 72 if ( !isset( $_GET['confirm'] ) ) … … 92 92 $query.= ' WHERE id = '.$_GET['delete']; 93 93 $query.= ';'; 94 $row2 = mysql_fetch_array( mysql_query( $query ) );94 $row2 = mysql_fetch_array( pwg_query( $query ) ); 95 95 if ( $row2['nb_result'] > 0 ) 96 96 { … … 138 138 $query.= ' ORDER BY status ASC, username ASC'; 139 139 $query.= ';'; 140 $result = mysql_query( $query );140 $result = pwg_query( $query ); 141 141 142 142 $current_status = ''; … … 239 239 $query.= ' FROM '.USERS_TABLE; 240 240 $query.= ';'; 241 $result = mysql_query( $query );241 $result = pwg_query( $query ); 242 242 while ( $row = mysql_fetch_array( $result ) ) 243 243 { -
trunk/admin/user_modify.php
r364 r587 45 45 $query.= ' where id = '.$_GET['user_id']; 46 46 $query.= ';'; 47 $row = mysql_fetch_array( mysql_query( $query ) );47 $row = mysql_fetch_array( pwg_query( $query ) ); 48 48 $page['username'] = $row['username']; 49 49 $page['status'] = $row['status']; … … 91 91 $query.= ' ORDER BY id ASC'; 92 92 $query.= ';'; 93 $result = mysql_query( $query );93 $result = pwg_query( $query ); 94 94 while ( $row = mysql_fetch_array( $result ) ) 95 95 { … … 101 101 $query.= ' AND group_id ='.$row['id']; 102 102 $query.= ';'; 103 mysql_query( $query );103 pwg_query( $query ); 104 104 } 105 105 } … … 109 109 $query.= ' ('.$_GET['user_id'].','.$_POST['associate'].')'; 110 110 $query.= ';'; 111 mysql_query( $query );111 pwg_query( $query ); 112 112 // synchronize category informations for this user 113 113 synchronize_user( $_GET['user_id'] ); … … 180 180 $query.= ' AND user_id = '.$_GET['user_id']; 181 181 $query.= ';'; 182 $result = mysql_query( $query );182 $result = pwg_query( $query ); 183 183 $user_groups = array(); 184 184 if ( mysql_num_rows( $result ) > 0 ) … … 205 205 $query.= ' ORDER BY id ASC'; 206 206 $query.= ';'; 207 $result = mysql_query( $query );207 $result = pwg_query( $query ); 208 208 while ( $row = mysql_fetch_array( $result ) ) 209 209 { -
trunk/admin/user_perm.php
r393 r587 122 122 $query.= ' WHERE user_id = '.$_GET['user_id']; 123 123 $query.= ';'; 124 mysql_query( $query );124 pwg_query( $query ); 125 125 // selecting all private categories 126 126 $query = 'SELECT id'; … … 128 128 $query.= " WHERE status = 'private'"; 129 129 $query.= ';'; 130 $result = mysql_query( $query );130 $result = pwg_query( $query ); 131 131 while ( $row = mysql_fetch_array( $result ) ) 132 132 { … … 138 138 $query.= ' ('.$_GET['user_id'].','.$row['id'].')'; 139 139 $query.= ';'; 140 mysql_query ( $query );140 pwg_query ( $query ); 141 141 } 142 142 } … … 158 158 $query.= ' FROM '.PREFIX_TABLE.'groups'; 159 159 $query.= ';'; 160 $result = mysql_query( $query );160 $result = pwg_query( $query ); 161 161 $groups = array(); 162 162 while ( $row = mysql_fetch_array( $result ) ) … … 169 169 $query.= ' WHERE user_id = '.$_GET['user_id']; 170 170 $query.= ';'; 171 $result = mysql_query( $query );171 $result = pwg_query( $query ); 172 172 $usergroups = array(); 173 173 while ( $row = mysql_fetch_array( $result ) ) … … 180 180 $query.= " WHERE status = 'private'"; 181 181 $query.= ';'; 182 $result = mysql_query( $query );182 $result = pwg_query( $query ); 183 183 while ( $row = mysql_fetch_array( $result ) ) 184 184 { … … 198 198 $query.= ' AND cat_id = '.$row['id']; 199 199 $query.= ';'; 200 $subresult = mysql_query( $query );200 $subresult = pwg_query( $query ); 201 201 $authorized_groups = array(); 202 202 while ( $subrow = mysql_fetch_array( $subresult ) ) -
trunk/admin/user_search.php
r539 r587 46 46 $query.= ' WHERE user_id = '.$_GET['user_id']; 47 47 $query.= ';'; 48 mysql_query( $query );48 pwg_query( $query ); 49 49 // selecting all private categories 50 50 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 51 51 $query.= " WHERE status = 'private'"; 52 52 $query.= ';'; 53 $result = mysql_query( $query );53 $result = pwg_query( $query ); 54 54 while ( $row = mysql_fetch_array( $result ) ) 55 55 { … … 61 61 $query.= ' ('.$_GET['user_id'].','.$row['id'].')'; 62 62 $query.= ';'; 63 mysql_query ( $query );63 pwg_query ( $query ); 64 64 } 65 65 } … … 97 97 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 98 98 $query.= " WHERE status = 'private';"; 99 $result = mysql_query( $query );99 $result = pwg_query( $query ); 100 100 while ( $row = mysql_fetch_array( $result ) ) 101 101 { -
trunk/admin/waiting.php
r520 r587 35 35 $query = 'SELECT * FROM '.WAITING_TABLE; 36 36 $query.= " WHERE validated = 'false';"; 37 $result = mysql_query( $query );37 $result = pwg_query( $query ); 38 38 while ( $row = mysql_fetch_array( $result ) ) 39 39 { … … 49 49 $query.= ' WHERE id = '.$row['id']; 50 50 $query.= ';'; 51 mysql_query( $query );51 pwg_query( $query ); 52 52 // linking logically the picture to its storage category 53 53 $query = 'INSERT INTO'; … … 60 60 $query.= ' WHERE id = '.$row['id']; 61 61 $query.= ';'; 62 mysql_query( $query );62 pwg_query( $query ); 63 63 // deletion of the associated files 64 64 $dir = get_complete_dir( $row['storage_category_id'] ); … … 103 103 $query.= ' ORDER BY storage_category_id'; 104 104 $query.= ';'; 105 $result = mysql_query( $query );105 $result = pwg_query( $query ); 106 106 $i = 0; 107 107 while ( $row = mysql_fetch_array( $result ) ) -
trunk/comments.php
r579 r587 54 54 WHERE id IN ('.implode(',', $_POST['comment_id']).') 55 55 ;'; 56 mysql_query($query);56 pwg_query($query); 57 57 } 58 58 // comments validation … … 64 64 WHERE id IN ('.implode(',', $_POST['comment_id']).') 65 65 ;'; 66 mysql_query($query);66 pwg_query($query); 67 67 } 68 68 // +-----------------------------------------------------------------------+ … … 129 129 ORDER BY ic.image_id DESC 130 130 ;'; 131 $result = mysql_query($query);131 $result = pwg_query($query); 132 132 if ($user['status'] == 'admin') 133 133 { … … 145 145 WHERE id = '.$row['image_id'].' 146 146 ;'; 147 $subresult = mysql_query($query);147 $subresult = pwg_query($query); 148 148 $subrow = mysql_fetch_array($subresult); 149 149 … … 196 196 ORDER BY date DESC 197 197 ;'; 198 $handleresult = mysql_query($query);198 $handleresult = pwg_query($query); 199 199 while ($subrow = mysql_fetch_array($handleresult)) 200 200 { -
trunk/identification.php
r555 r587 40 40 WHERE username = \''.$_POST['username'].'\' 41 41 ;'; 42 $row = mysql_fetch_array( mysql_query($query));42 $row = mysql_fetch_array(pwg_query($query)); 43 43 if ($row['password'] == md5($_POST['password'])) 44 44 { -
trunk/include/category_calendar.inc.php
r579 r587 40 40 GROUP BY year 41 41 ;'; 42 $result = mysql_query($query);42 $result = pwg_query($query); 43 43 $calendar_years = array(); 44 44 while ($row = mysql_fetch_array($result)) … … 93 93 GROUP BY MONTH('.$conf['calendar_datefield'].') 94 94 ;'; 95 $result = mysql_query($query);95 $result = pwg_query($query); 96 96 $calendar_months = array(); 97 97 while ($row = mysql_fetch_array($result)) … … 165 165 GROUP BY day 166 166 ;'; 167 $result = mysql_query($query);167 $result = pwg_query($query); 168 168 $calendar_days = array(); 169 169 while ($row = mysql_fetch_array($result)) … … 189 189 GROUP BY category_id 190 190 ;'; 191 $result = mysql_query($query);191 $result = pwg_query($query); 192 192 $calendar_categories = array(); 193 193 // special category 0 : gathering all available categories (0 cannot be a … … 228 228 LIMIT 0,1 229 229 ;'; 230 $row = mysql_fetch_array( mysql_query($query));230 $row = mysql_fetch_array(pwg_query($query)); 231 231 232 232 $thumbnail_src = get_thumbnail_src($row['file'], … … 276 276 LIMIT 0,1 277 277 ;'; 278 $row = mysql_fetch_array( mysql_query($query));278 $row = mysql_fetch_array(pwg_query($query)); 279 279 280 280 $thumbnail_src = get_thumbnail_src($row['file'], … … 331 331 LIMIT 0,1 332 332 ;'; 333 $row = mysql_fetch_array( mysql_query($query));333 $row = mysql_fetch_array(pwg_query($query)); 334 334 335 335 $thumbnail_src = get_thumbnail_src($row['file'], … … 400 400 LIMIT 0,1 401 401 ;'; 402 $row = mysql_fetch_array( mysql_query($query));402 $row = mysql_fetch_array(pwg_query($query)); 403 403 404 404 $thumbnail_src = get_thumbnail_src($row['file'], -
trunk/include/category_default.inc.php
r579 r587 48 48 ;'; 49 49 // echo '<pre>'.$query.'</pre>'; 50 $result = mysql_query($query);50 $result = pwg_query($query); 51 51 52 52 // template thumbnail initialization … … 129 129 AND validated = \'true\' 130 130 ;'; 131 $row = mysql_fetch_array( mysql_query($query));131 $row = mysql_fetch_array(pwg_query($query)); 132 132 $template->assign_block_vars( 133 133 'thumbnails.line.thumbnail.nb_comments', -
trunk/include/category_recent_cats.inc.php
r579 r587 47 47 $query.= ' 48 48 ;'; 49 $result = mysql_query( $query );49 $result = pwg_query( $query ); 50 50 51 51 // template thumbnail initialization … … 76 76 LIMIT 0,1 77 77 ;'; 78 $subrow = mysql_fetch_array( mysql_query( $query ) );78 $subrow = mysql_fetch_array( pwg_query( $query ) ); 79 79 80 80 $thumbnail_src = get_thumbnail_src($subrow['file'], -
trunk/include/category_subcats.inc.php
r579 r587 51 51 $row_number = 0; 52 52 } 53 53 54 54 foreach ($subcats as $subcat_id => $non_empty_id) 55 55 { … … 62 62 WHERE id = '.$non_empty_id.' 63 63 ;'; 64 $row = mysql_fetch_array( mysql_query($query));64 $row = mysql_fetch_array(pwg_query($query)); 65 65 66 66 $query = ' … … 84 84 $query.= ' 85 85 ;'; 86 $image_result = mysql_query($query);86 $image_result = pwg_query($query); 87 87 $image_row = mysql_fetch_array($image_result); 88 88 -
trunk/include/common.inc.php
r541 r587 172 172 FROM '.CONFIG_TABLE.' 173 173 ;'; 174 if( !( $result = mysql_query( $query ) ) )174 if( !( $result = pwg_query( $query ) ) ) 175 175 { 176 176 die("Could not query config information"); -
trunk/include/config.inc.php
r571 r587 122 122 // calendar_datefield : date field of table "images" used for calendar 123 123 // catgory 124 $conf['calendar_datefield'] = 'date_ available';124 $conf['calendar_datefield'] = 'date_creation'; 125 125 126 126 // rate : enable feature for rating elements -
trunk/include/constants.php
r519 r587 33 33 34 34 // Debug Level 35 define('DEBUG', 1); // Debugging on36 //define('DEBUG', 0); // Debugging off35 //define('DEBUG', 1); // Debugging on 36 define('DEBUG', 0); // Debugging off 37 37 38 38 // User level -
trunk/include/functions.inc.php
r579 r587 52 52 // retrieving the properties of the table. Each line represents a field : 53 53 // columns are 'Field', 'Type' 54 $result= mysql_query("desc $table");54 $result=pwg_query("desc $table"); 55 55 while ( $row = mysql_fetch_array( $result ) ) 56 56 { … … 351 351 $query.= ",'".$_SERVER['REMOTE_ADDR']."'"; 352 352 $query.= ",'".$file."','".$category."','".$picture."');"; 353 mysql_query( $query );353 pwg_query( $query ); 354 354 } 355 355 } … … 409 409 $query.= ' AND mail_address IS NOT NULL'; 410 410 $query.= ';'; 411 $result = mysql_query( $query );411 $result = pwg_query( $query ); 412 412 while ( $row = mysql_fetch_array( $result ) ) 413 413 { … … 445 445 } 446 446 447 function pwg_query( $query ) 448 { 449 global $count_queries,$queries_time; 450 447 function pwg_query($query) 448 { 451 449 $start = get_moment(); 452 $output = ''; 453 454 $count_queries++; 455 $output.= '<br /><br />['.$count_queries.'] '.$query; 456 $result = mysql_query( $query ); 457 $time = get_moment() - $start; 458 $queries_time+= $time; 459 $output.= '<b>('.number_format( $time, 3, '.', ' ').' s)</b>'; 460 $output.= '('.number_format( $queries_time, 3, '.', ' ').' s)'; 461 462 // echo $output; 450 $result = mysql_query($query); 451 452 if (DEBUG) 453 { 454 global $count_queries,$queries_time; 455 456 $time = get_moment() - $start; 457 $count_queries++; 458 459 $output = ''; 460 $output.= '<pre>['.$count_queries.'] '."\n".$query; 461 $queries_time+= $time; 462 $output.= "\n".'(this query time : '.number_format( $time, 3, '.', ' ').' s)</b>'; 463 $output.= "\n".'(total SQL time : '.number_format( $queries_time, 3, '.', ' ').' s)'; 464 $output.= '</pre>'; 465 echo $output; 466 } 463 467 464 468 return $result; -
trunk/include/functions_category.inc.php
r579 r587 89 89 $query = 'SELECT id'; 90 90 $query.= ' FROM '.CATEGORIES_TABLE.' WHERE id = '.$cat.';'; 91 $result = mysql_query( $query );91 $result = pwg_query( $query ); 92 92 if ( mysql_num_rows( $result ) != 0 ) 93 93 { … … 140 140 141 141 $plain_structure = array(); 142 $result = mysql_query( $query );142 $result = pwg_query( $query ); 143 143 while ( $row = mysql_fetch_array( $result ) ) 144 144 { … … 271 271 // ;'; 272 272 273 $row = mysql_fetch_array( mysql_query( $query ) );273 $row = mysql_fetch_array( pwg_query( $query ) ); 274 274 275 275 if ( !isset( $row['total'] ) ) $row['total'] = 0; … … 307 307 $query.= ' AND a.site_id = b.id'; 308 308 $query.= ';'; 309 $row = mysql_fetch_array( mysql_query( $query ) );309 $row = mysql_fetch_array( pwg_query( $query ) ); 310 310 311 311 $cat = array(); … … 330 330 $query.= ' ORDER BY id ASC'; 331 331 $query.= ';'; 332 $result = mysql_query( $query );332 $result = pwg_query( $query ); 333 333 while( $row = mysql_fetch_array( $result ) ) 334 334 { … … 369 369 $query.= ' FROM '.CATEGORIES_TABLE.' WHERE id = '.$category_id; 370 370 $query.= ';'; 371 $row = mysql_fetch_array( mysql_query( $query ) );371 $row = mysql_fetch_array( pwg_query( $query ) ); 372 372 $uppercats = $row['uppercats']; 373 373 } … … 379 379 $query.= ' FROM '.CATEGORIES_TABLE.' WHERE id IN ('.$uppercats.')'; 380 380 $query.= ';'; 381 $result = mysql_query( $query );381 $result = pwg_query( $query ); 382 382 while( $row = mysql_fetch_array( $result ) ) 383 383 { … … 404 404 AND c.id = '.$category_id.' 405 405 ;'; 406 $row = mysql_fetch_array( mysql_query($query));406 $row = mysql_fetch_array(pwg_query($query)); 407 407 return $row['galleries_url']; 408 408 } … … 594 594 WHERE '.implode(' OR ', $search_cat_clauses).' 595 595 ;'; 596 $result = mysql_query($query);596 $result = pwg_query($query); 597 597 $cat_ids = array(); 598 598 while ($row = mysql_fetch_array($result)) … … 669 669 { 670 670 $page['title'] = $conf['top_number'].' '.$lang['most_visited_cat']; 671 672 if ( isset( $forbidden ) ) $page['where'] = ' WHERE '.$forbidden; 673 else $page['where'] = ''; 671 672 $page['where'] = 'WHERE hit > 0'; 673 if (isset($forbidden)) 674 { 675 $page['where'] = "\n".' AND '.$forbidden; 676 } 677 674 678 $conf['order_by'] = ' ORDER BY hit DESC, file ASC'; 675 679 $page['cat_nb_images'] = $conf['top_number']; … … 750 754 '.$page['where'].' 751 755 ;'; 752 $row = mysql_fetch_array( mysql_query($query));756 $row = mysql_fetch_array(pwg_query($query)); 753 757 if ($row['count'] < $conf['top_number']) 754 758 { … … 789 793 if (isset($query)) 790 794 { 791 $result = mysql_query( $query );795 $result = pwg_query( $query ); 792 796 $row = mysql_fetch_array( $result ); 793 797 $page['cat_nb_images'] = $row['nb_total_images']; … … 844 848 $query.= ';'; 845 849 846 $result = mysql_query( $query );850 $result = pwg_query( $query ); 847 851 while ( $row = mysql_fetch_array( $result ) ) 848 852 { … … 875 879 $query.= ' ORDER BY RAND()'; 876 880 $query.= ';'; 877 $result = mysql_query( $query );881 $result = pwg_query( $query ); 878 882 while ( $row = mysql_fetch_array( $result ) ) 879 883 { … … 883 887 } 884 888 } 885 $result = mysql_query( $query );889 $result = pwg_query( $query ); 886 890 while ( $row = mysql_fetch_array( $result ) ) 887 891 { -
trunk/include/functions_group.inc.php
r362 r587 35 35 $query.= " WHERE status = 'private'"; 36 36 $query.= ';'; 37 $result = mysql_query( $query );37 $result = pwg_query( $query ); 38 38 $privates = array(); 39 39 while ( $row = mysql_fetch_array( $result ) ) … … 47 47 $query.= ' WHERE group_id = '.$group_id; 48 48 $query.= ';'; 49 $result = mysql_query( $query );49 $result = pwg_query( $query ); 50 50 while ( $row = mysql_fetch_array( $result ) ) 51 51 { … … 93 93 $query.= ' WHERE id = '.$category_id; 94 94 $query.= ';'; 95 $row = mysql_fetch_array( mysql_query( $query ) );95 $row = mysql_fetch_array( pwg_query( $query ) ); 96 96 if ( !isset( $row['id_uppercat'] ) ) $row['id_uppercat'] = ''; 97 97 if ( $row['id_uppercat'] == '' ) $is_root = true; -
trunk/include/functions_session.inc.php
r555 r587 80 80 WHERE id = \''.$generated_id.'\' 81 81 ;'; 82 $result = mysql_query($query);82 $result = pwg_query($query); 83 83 if (mysql_num_rows($result) == 0) 84 84 { … … 95 95 \''.$_SERVER['REMOTE_ADDR'].'\') 96 96 ;'; 97 mysql_query($query);97 pwg_query($query); 98 98 99 99 setcookie('id', $generated_id, $expiration, cookie_path()); -
trunk/include/functions_user.inc.php
r532 r587 70 70 $query.= " WHERE username = '".$login."'"; 71 71 $query.= ';'; 72 $result = mysql_query( $query );72 $result = pwg_query( $query ); 73 73 if ( mysql_num_rows($result) > 0 ) $error[$i++] = $lang['reg_err_login5']; 74 74 } … … 95 95 $query.= " WHERE username = 'guest'"; 96 96 $query.= ';'; 97 $row = mysql_fetch_array( mysql_query( $query ) );97 $row = mysql_fetch_array( pwg_query( $query ) ); 98 98 // 2. adding new user 99 99 $query = 'INSERT INTO '.USERS_TABLE; … … 116 116 } 117 117 $query.= ');'; 118 mysql_query( $query );118 pwg_query( $query ); 119 119 // 3. retrieving the id of the newly created user 120 120 $query = 'SELECT id'; 121 121 $query.= ' FROM '.USERS_TABLE; 122 122 $query.= " WHERE username = '".$login."';"; 123 $row = mysql_fetch_array( mysql_query( $query ) );123 $row = mysql_fetch_array( pwg_query( $query ) ); 124 124 $user_id = $row['id']; 125 125 // 4. adding access to the new user, the same as the user "guest" … … 129 129 $query.= ' where u.id = ua.user_id'; 130 130 $query.= " and u.username = 'guest';"; 131 $result = mysql_query( $query );131 $result = pwg_query( $query ); 132 132 while( $row = mysql_fetch_array( $result ) ) 133 133 { … … 135 135 $query.= ' (user_id,cat_id) VALUES'; 136 136 $query.= ' ('.$user_id.','.$row['cat_id'].');'; 137 mysql_query ( $query );137 pwg_query ( $query ); 138 138 } 139 139 // 5. associate new user to the same groups that the guest … … 144 144 $query.= ' AND ug.user_id = u.id'; 145 145 $query.= ';'; 146 $result = mysql_query( $query );146 $result = pwg_query( $query ); 147 147 while( $row = mysql_fetch_array( $result ) ) 148 148 { … … 151 151 $query.= ' ('.$user_id.','.$row['group_id'].')'; 152 152 $query.= ';'; 153 mysql_query ( $query );153 pwg_query ( $query ); 154 154 } 155 155 } … … 188 188 $query.= ' WHERE id = '.$user_id; 189 189 $query.= ';'; 190 mysql_query( $query );190 pwg_query( $query ); 191 191 } 192 192 return $error; … … 271 271 $sql.= " WHERE "; 272 272 $sql .= ( ( is_integer($user) ) ? "id = $user" : "username = '" . str_replace("\'", "''", $user) . "'" ) . " AND id <> " . ANONYMOUS; 273 $result = mysql_query($sql);273 $result = pwg_query($sql); 274 274 return ( $row = mysql_fetch_array($result) ) ? $row : false; 275 275 } -
trunk/include/user.inc.php
r555 r587 64 64 WHERE id = \''.$page['session_id'].'\' 65 65 ;'; 66 $result = mysql_query($query);66 $result = pwg_query($query); 67 67 if (mysql_num_rows($result) > 0) 68 68 { … … 77 77 $delete_query.= " WHERE id = '".$page['session_id']."'"; 78 78 $delete_query.= ';'; 79 mysql_query($delete_query);79 pwg_query($delete_query); 80 80 } 81 81 else if ($_SERVER['REMOTE_ADDR'] == $row['ip']) … … 98 98 } 99 99 $query_user .= ';'; 100 $row = mysql_fetch_array( mysql_query($query_user));100 $row = mysql_fetch_array(pwg_query($query_user)); 101 101 102 102 // affectation of each value retrieved in the users table into a variable -
trunk/picture.php
r579 r587 38 38 } 39 39 //---------------------------------------- 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 = ' 41 UPDATE '.IMAGES_TABLE.' 42 SET hit = hit+1 43 WHERE id = '.$_GET['image_id'].' 44 ;'; 45 @pwg_query( $query ); 44 46 //-------------------------------------------------------------- initialization 45 47 initialize_category( 'picture' ); … … 52 54 '.$conf['order_by'].' 53 55 ;'; 54 $result = mysql_query( $query );56 $result = pwg_query( $query ); 55 57 $page['num'] = 0; 56 58 $belongs = false; … … 112 114 $query.= ';'; 113 115 114 $result = mysql_query( $query );116 $result = pwg_query( $query ); 115 117 $indexes = array('prev', 'current', 'next'); 116 118 … … 226 228 AND element_id = '.$_GET['image_id'].' 227 229 ;'; 228 mysql_query($query);230 pwg_query($query); 229 231 $query = ' 230 232 INSERT INTO '.RATE_TABLE.' … … 233 235 ('.$user['id'].','.$_GET['image_id'].','.$_GET['rate'].') 234 236 ;'; 235 mysql_query($query);237 pwg_query($query); 236 238 237 239 // update of images.average_rate field … … 241 243 WHERE element_id = '.$_GET['image_id'].' 242 244 ;'; 243 $row = mysql_fetch_array( mysql_query($query));245 $row = mysql_fetch_array(pwg_query($query)); 244 246 $query = ' 245 247 UPDATE '.IMAGES_TABLE.' … … 247 249 WHERE id = '.$_GET['image_id'].' 248 250 ;'; 249 mysql_query($query);251 pwg_query($query); 250 252 } 251 253 //--------------------------------------------------------- favorite management … … 256 258 $query.= ' AND image_id = '.$picture['current']['id']; 257 259 $query.= ';'; 258 $result = mysql_query( $query );260 $result = pwg_query( $query ); 259 261 260 262 if ( $_GET['add_fav'] == 1 ) … … 264 266 $query.= ' ('.$picture['current']['id'].','.$user['id'].')'; 265 267 $query.= ';'; 266 $result = mysql_query( $query );268 $result = pwg_query( $query ); 267 269 } 268 270 if ( !$_GET['add_fav'] and $page['cat'] == 'fav' ) … … 302 304 $query.= " WHERE username = '".$author."'"; 303 305 $query.= ';'; 304 $row = mysql_fetch_array( mysql_query( $query ) );306 $row = mysql_fetch_array( pwg_query( $query ) ); 305 307 if ( $row['user_exists'] == 1 ) 306 308 { … … 320 322 $query.= " AND author = '".$author."'"; 321 323 $query.= ';'; 322 if ( mysql_num_rows( mysql_query( $query ) ) == 0324 if ( mysql_num_rows( pwg_query( $query ) ) == 0 323 325 or $conf['anti-flood_time'] == 0 ) 324 326 { … … 337 339 } 338 340 $query.= ');'; 339 mysql_query( $query );341 pwg_query( $query ); 340 342 // information message 341 343 $message = $lang['comment_added']; … … 371 373 $query.= ' WHERE id = '.$_GET['del']; 372 374 $query.= ';'; 373 mysql_query( $query );375 pwg_query( $query ); 374 376 } 375 377 … … 503 505 $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id']; 504 506 $query.= ' AND user_id = '.$user['id'].';'; 505 $result = mysql_query( $query );507 $result = pwg_query( $query ); 506 508 $row = mysql_fetch_array( $result ); 507 509 if (!$row['nb_fav']) … … 713 715 WHERE element_id = '.$picture['current']['id'].' 714 716 ;'; 715 $row = mysql_fetch_array( mysql_query($query));717 $row = mysql_fetch_array(pwg_query($query)); 716 718 if ($row['count'] == 0) 717 719 { … … 746 748 $query.= ' 747 749 ;'; 748 $result = mysql_query($query);750 $result = pwg_query($query); 749 751 $categories = ''; 750 752 while ($row = mysql_fetch_array($result)) … … 871 873 AND element_id = '.$_GET['image_id'].' 872 874 ;'; 873 $result = mysql_query($query);875 $result = pwg_query($query); 874 876 if (mysql_num_rows($result) > 0) 875 877 { … … 922 924 $query.= " AND validated = 'true'"; 923 925 $query.= ';'; 924 $row = mysql_fetch_array( mysql_query( $query ) );926 $row = mysql_fetch_array( pwg_query( $query ) ); 925 927 926 928 // navigation bar creation … … 951 953 $query.= ' ORDER BY date ASC'; 952 954 $query.= ' LIMIT '.$page['start'].', '.$conf['nb_comment_page'].';'; 953 $result = mysql_query( $query );955 $result = pwg_query( $query ); 954 956 955 957 while ( $row = mysql_fetch_array( $result ) ) -
trunk/profile.php
r527 r587 88 88 $query.= ' WHERE id = '.$user['id']; 89 89 $query.= ';'; 90 mysql_query( $query );90 pwg_query( $query ); 91 91 92 92 if ( isset( $_POST['use_new_pwd'] ) ) … … 96 96 $query.= ' WHERE id = '.$user['id']; 97 97 $query.= ';'; 98 mysql_query( $query );98 pwg_query( $query ); 99 99 } 100 100 if ( isset( $_POST['create_cookie'] ) ) … … 107 107 $query.= " WHERE id = '".$page['session_id']."'"; 108 108 $query.= ';'; 109 mysql_query( $query );109 pwg_query( $query ); 110 110 } 111 111 // redirection -
trunk/upload.php
r585 r587 107 107 else 108 108 { 109 109 @chmod( $temp_name, 0644); 110 110 } 111 111 return $result; … … 213 213 $query.= ",'".$_POST['mail_address']."',".time().",'".$xml_infos."')"; 214 214 $query.= ';'; 215 mysql_query( $query );215 pwg_query( $query ); 216 216 $page['waiting_id'] = mysql_insert_id(); 217 217 // mail notification for administrators … … 231 231 $query.= ' where id = '.$_GET['waiting_id']; 232 232 $query.= ';'; 233 $result= mysql_query( $query );233 $result= pwg_query( $query ); 234 234 $row = mysql_fetch_array( $result ); 235 235 $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); … … 250 250 $query.= ' where id = '.$_GET['waiting_id']; 251 251 $query.= ';'; 252 mysql_query( $query );252 pwg_query( $query ); 253 253 $page['upload_successful'] = true; 254 254 }
Note: See TracChangeset
for help on using the changeset viewer.