Changeset 21652
- Timestamp:
- Mar 17, 2013, 3:55:39 PM (11 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/autolog_entries.inc.php
r8956 r21652 104 104 elseif ($a == 3) { // Image 105 105 $url_end.= ($url_end == '') ? '' : '&img='.$arg2; 106 $t = mysql_fetch_row(pwg_query("106 $t = pwg_db_fetch_row(pwg_query(" 107 107 SELECT `name`, `file` 108 108 FROM `".IMAGES_TABLE."` -
extensions/event_cats/admin/autolog_new.inc.php
r8956 r21652 111 111 (count($ec_lists['user_ids']) == 0) ? 'style = "display:none;"' : '' 112 112 ); 113 $template->assign('ec_no_assoc', (( mysql_num_rows(pwg_query("113 $template->assign('ec_no_assoc', ((pwg_db_num_rows(pwg_query(" 114 114 SELECT * 115 115 FROM `".IMAGE_CATEGORY_TABLE."` -
extensions/event_cats/admin/evntcats_admin.php
r10030 r21652 101 101 ); 102 102 103 $ec_exist_entries = ( mysql_num_rows(pwg_query("103 $ec_exist_entries = (pwg_db_num_rows(pwg_query(" 104 104 SELECT * FROM `".EVNTCATS_TABLE."` 105 105 WHERE `code` IS NOT NULL ; -
extensions/event_cats/include/ec_conf.inc.php
r8956 r21652 37 37 // following instructions : 38 38 /* 39 $t = mysql_fetch_row(pwg_query("39 $t = pwg_db_fetch_row(pwg_query(" 40 40 SELECT `value` 41 41 FROM `".CONFIG_TABLE."` … … 123 123 124 124 $t = array(); $u = '0'; $v = false; 125 if ($v = ( 126 ($t = mysql_fetch_row(pwg_query("127 SELECT `value`128 FROM `".CONFIG_TABLE."`129 WHERE `param` = 'event_cats';130 "))) !== false) 131 ) { 125 $r = pwg_query(" 126 SELECT `value` 127 FROM `".CONFIG_TABLE."` 128 WHERE `param` = 'event_cats'; 129 "); 130 if (pwg_db_num_rows($r)) { 131 $t = pwg_db_fetch_row($r); 132 132 $v = (count($ec_conf = explode(',', $t[0])) == count($ec_conf_index)); 133 133 $u = $ec_conf[0]; -
extensions/event_cats/include/evntcats_admin_funcs.inc.php
r10457 r21652 79 79 $page['errors'][] = 80 80 sprintf(l10n('ec_DB_problem'), $n). 81 'MySQL error '. mysql_errno().', "'.mysql_error().'"';81 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 82 82 return false; 83 83 } … … 137 137 $t2 = 0; $t3 = false; $t4 = false; 138 138 while ( // The check is executed once at minimum 139 !($t3 = mysql_fetch_row(pwg_query("139 !($t3 = pwg_db_fetch_row(pwg_query(" 140 140 SELECT `id` 141 141 FROM `".GROUPS_TABLE."` … … 154 154 $page['errors'][] = 155 155 sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (1) : '. 156 'MySQL error '. mysql_errno().', "'.mysql_error().'"';156 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 157 157 if ( 158 158 pwg_query(" … … 162 162 ) $page['errors'][] = 163 163 sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (2) : '. 164 'MySQL error '. mysql_errno().', "'.mysql_error().'"';164 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 165 165 else $page['infos'][] = sprintf( 166 166 l10n('ec_group_create_OK2'), … … 176 176 array_key_exists($_POST['ec_in_up_cat'], $ec_lists['categories']) 177 177 ) { 178 if ( mysql_num_rows(pwg_query("178 if (pwg_db_num_rows(pwg_query(" 179 179 SELECT `id` 180 180 FROM `".CATEGORIES_TABLE."` … … 197 197 ); 198 198 mass_inserts(GROUP_ACCESS_TABLE,array('group_id','cat_id'), $inserts); 199 if ( mysql_errno() == 0)199 if (pwg_db_errno() == 0) 200 200 $page['infos'][] = sprintf( 201 201 l10n('ec_group_create_OK2'), … … 206 206 l10n('ec_assoc_pb'), 207 207 $_POST['groupname'],$ec_lists['categories'][$_POST['ec_in_up_cat']] 208 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';208 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 209 209 } 210 210 } … … 241 241 l10n('ec_assoc_pb'), 242 242 $_POST['groupname'],$ec_lists['add_pages'][$_POST['ec_in_up_aps']] 243 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';243 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 244 244 else $page['infos'][] = sprintf( 245 245 l10n('ec_group_create_OK2'), … … 274 274 AND `user_id` = '$ec_user_id'; 275 275 "); 276 while ($row = mysql_fetch_array($result))276 while ($row = pwg_db_fetch_assoc($result)) 277 277 $granteds[$row['cat_id']][] = $row['user_id']; 278 278 $inserts = array(); … … 285 285 if (count($inserts) != 0) { 286 286 mass_inserts(USER_ACCESS_TABLE, array('user_id','cat_id'), $inserts); 287 if ( mysql_errno() == 0)287 if (pwg_db_errno() == 0) 288 288 $page['infos'][] = sprintf( 289 289 l10n('ec_group_create_OK2'), … … 294 294 l10n('ec_assoc_pb'), 295 295 $_POST['login'], $ec_lists['categories'][$_POST['ec_in_up_cat']] 296 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';296 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 297 297 } 298 298 } … … 553 553 $arg2p = ($arg2 == 'NULL') ? 'IS NULL' : ' = '.$arg2; 554 554 $ec_user_idp = ($ec_user_id == 'NULL') ? 'IS NULL' : ' = '.$ec_user_id; 555 if (($t1 = mysql_fetch_row(pwg_query("555 $r = pwg_query(" 556 556 SELECT `id` 557 557 FROM `".EVNTCATS_TABLE."` … … 563 563 AND `forced` = '".$forced."' 564 564 AND `comment` = '".$comment."' 565 "))) !== false) { // print("<pre>$arg1 $arg2<br>$q</pre>"); 565 "); 566 if (pwg_db_num_rows($r)) { // print("<pre>$arg1 $arg2<br>$q</pre>"); 567 $t1 = pwg_db_fetch_row(); 566 568 $page['errors'][] = sprintf(l10n('ec_entry_already_exists'), $t1[0]); 567 569 return false; … … 570 572 // Delete other entries using the same code, if needed 571 573 if ($del_other) { 572 if ((573 $t1 = mysql_fetch_row(pwg_query("574 SELECT `code`575 FROM `".EVNTCATS_TABLE."`576 WHERE `id` = ".$_POST['ec_entry_sel']577 ))) === false578 ) die('Entry not found in DB ?!');574 $r = pwg_query(" 575 SELECT `code` 576 FROM `".EVNTCATS_TABLE."` 577 WHERE `id` = ".$_POST['ec_entry_sel'] 578 ); 579 if (!pwg_db_num_rows($r)) die('Entry not found in DB ?!'); 580 $t1 = pwg_db_fetch_row($r); 579 581 $r = pwg_query(" 580 582 SELECT `id` … … 583 585 AND `id` <> ".$_POST['ec_entry_sel'] 584 586 ); 585 while ($t2 = mysql_fetch_row($r)) if (!ec_delete_entry_OK($t2[0]))587 while ($t2 = pwg_db_fetch_row($r)) if (!ec_delete_entry_OK($t2[0])) 586 588 return false; 587 589 } … … 608 610 $page['errors'][] = 609 611 l10n('ec_entry_create_pb').' : '. 610 'MySQL error '. mysql_errno().', "'.mysql_error().'"'612 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"' 611 613 ; 612 614 $ret = false; … … 616 618 $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced'); 617 619 $page['infos'][] = 618 sprintf(l10n('ec_entry_create_OK'), mysql_insert_id()).620 sprintf(l10n('ec_entry_create_OK'), pwg_db_insert_id()). 619 621 $ec_code.' => '. 620 622 $ec_lists['user_ids'][$ec_user_id].$forced … … 639 641 $page['errors'][] = 640 642 l10n('ec_entry_create_pb').' : '. 641 'MySQL error '. mysql_errno().', "'.mysql_error().'"'643 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"' 642 644 ; 643 645 $ret = false; … … 662 664 function ec_delete_entry_OK($ec_id) { 663 665 global $page; 664 if (count($t = mysql_fetch_row(pwg_query("666 $r = pwg_query(" 665 667 SELECT `code` 666 668 FROM `".EVNTCATS_TABLE."` 667 669 WHERE `id` = $ec_id; 668 "))) == 0) { 670 "); 671 if (!pwg_db_num_rows($r)) { 669 672 $page['errors'][] = sprintf(l10n('ec_entry_dont_exist'), $ec_id); 670 673 return false; 671 674 } 675 $t = pwg_db_fetch_row($r); 672 676 if (pwg_query(" 673 677 DELETE FROM `".EVNTCATS_TABLE."` … … 677 681 sprintf(l10n('ec_entry_del_nok'), 678 682 $ec_id). 679 'MySQL error '. mysql_errno().', "'.mysql_error().'"';683 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 680 684 return false; 681 685 } -
extensions/event_cats/include/evntcats_main_funcs.inc.php
r10052 r21652 77 77 */ 78 78 function ec_image_exists($cat, $img) { 79 return (mysql_fetch_row(pwg_query("79 $r = pwg_query(" 80 80 SELECT * 81 81 FROM `".IMAGE_CATEGORY_TABLE."` 82 82 WHERE `category_id` = ".$cat." 83 83 AND `image_id` = ".$img 84 )) !== false); 84 ); 85 return (bool)pwg_num_rows($r); 85 86 } 86 87 … … 207 208 if (defined('ADD_PAGES_TABLE')) { 208 209 $res = pwg_query("SELECT `id`, `title` FROM `".ADD_PAGES_TABLE."`;"); 209 while ($r = mysql_fetch_array($res)) {210 while ($r = pwg_db_fetch_assoc($res)) { 210 211 $a = (is_in($r['title'], '/user_id=')) ? 211 212 explode('/user_id=' , $r['title']) : array($r['title']); … … 281 282 ORDER BY `id` 282 283 "); 283 while ($r = mysql_fetch_assoc($q))284 while ($r = pwg_db_fetch_assoc($q)) 284 285 $ec_lists['ec_table'][intval($r['id'])] = $r; 285 286 … … 395 396 // certain group (in groups, level (friends, family, contacts), 396 397 // or user status (generic)) 397 $ types_entry_exists = (($t = mysql_fetch_row(pwg_query("398 $r = pwg_query(" 398 399 SELECT `arg2` 399 400 FROM `".EVNTCATS_TABLE."` … … 402 403 AND `arg2` IS NOT NULL 403 404 LIMIT 1; 404 "))) !== false); 405 $ec_lists['types_granted'] = ($types_entry_exists) ? $t[0] : 0; 405 "); 406 if (pwg_db_num_rows($r)) { 407 $types_entry_exists = true; 408 list($ec_lists['types_granted']) = pwg_db_fetch_row($r); 409 } 410 else { 411 $types_entry_exists = false; 412 $ec_lists['types_granted'] = 0; 413 } 406 414 407 415 return $types_entry_exists; … … 495 503 AND `user_id` > 2; 496 504 "); 497 while ($row = mysql_fetch_array($result)) {505 while ($row = pwg_db_fetch_assoc($result)) { 498 506 if (!isset($user_granted_from_type[$row['level']])) { 499 507 $user_granted_from_type[$row['level']] = array(); … … 534 542 AND `user_id` > 2; 535 543 "); 536 while ($row = mysql_fetch_array($result)) {544 while ($row = pwg_db_fetch_assoc($result)) { 537 545 if (!isset($granted_groups[$row['group_id']])) { 538 546 $granted_groups[$row['group_id']] = array(); -
extensions/event_cats/main.inc.php
r10458 r21652 249 249 "); 250 250 $insert = array(); 251 while ($row = mysql_fetch_assoc($result))251 while ($row = pwg_db_fetch_assoc($result)) 252 252 $insert[] = "(".$new_user['id'].",".$row['cat_id'].")"; 253 253 if (!empty($insert)) pwg_query(" … … 263 263 "); 264 264 $insert = array(); 265 while ($row = mysql_fetch_assoc($result))265 while ($row = pwg_db_fetch_assoc($result)) 266 266 $insert[] = "(".$new_user['id'].",".$row['group_id'].")"; 267 267 if (!empty($insert)) pwg_query(" … … 277 277 "); 278 278 $insert = array(); 279 while ($row = mysql_fetch_assoc($result))279 while ($row = pwg_db_fetch_assoc($result)) 280 280 $insert[] = "(".$new_user['id'].",".$row['level'].")"; 281 281 if (!empty($insert)) pwg_query("
Note: See TracChangeset
for help on using the changeset viewer.