Changeset 27388
- Timestamp:
- Feb 16, 2014, 8:39:19 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/comments.php
r26761 r27388 70 70 $is_inserted = true; 71 71 } 72 72 73 73 $items_number_new[] = $number; 74 74 } … … 89 89 'clause' => '1=1') // stupid but generic 90 90 ); 91 91 92 92 trigger_action('loc_begin_comments'); 93 93 … … 266 266 $_POST['key'] 267 267 ); 268 268 269 269 switch ($comment_action) 270 270 { … … 282 282 } 283 283 } 284 284 285 285 $edit_comment = $_GET['edit']; 286 286 } … … 438 438 WHERE id IN ('.implode(',', $element_ids).') 439 439 ;'; 440 $elements = hash_from_query($query, 'id');440 $elements = query2array($query, 'id'); 441 441 442 442 // retrieving category informations 443 $query = 'SELECT id, name, permalink, uppercats 443 $query = 'SELECT id, name, permalink, uppercats 444 444 FROM '.CATEGORIES_TABLE.' 445 445 WHERE id IN ('.implode(',', $category_ids).')'; 446 $categories = hash_from_query($query, 'id');446 $categories = query2array($query, 'id'); 447 447 448 448 foreach ($comments as $comment) … … 468 468 ) 469 469 ); 470 470 471 471 $email = null; 472 472 if (!empty($comment['user_email'])) … … 489 489 'CONTENT'=>trigger_event('render_comment_content',$comment['content']), 490 490 ); 491 491 492 492 if (is_admin()) 493 493 { -
trunk/include/functions_url.inc.php
r26461 r27388 133 133 134 134 $url_before_params = $url; 135 135 136 136 $url.= make_section_in_url($params); 137 137 $url = add_well_known_params_in_url($url, $params); … … 141 141 $url = get_absolute_root_url( url_is_remote($url) ); 142 142 } 143 143 144 144 return $url; 145 145 } … … 216 216 { 217 217 global $conf; 218 219 isset($params['image_id']) or fatal_error('make_picture_url: image_id is a required parameter');220 218 221 219 $url = get_root_url().'picture'; … … 338 336 else 339 337 { 340 is_array($params['category']) or trigger_error(341 'make_section_in_url wrong type for category', E_USER_WARNING342 );343 is_numeric($params['category']['id']) or trigger_error(344 'make_section_in_url category id not numeric', E_USER_WARNING345 );346 338 isset($params['category']['name']) or trigger_error( 347 339 'make_section_in_url category name not set', E_USER_WARNING … … 371 363 case 'tags' : 372 364 { 373 if (!isset($params['tags']) or count($params['tags']) == 0)374 {375 fatal_error('make_section_in_url: require at least one tag');376 }377 378 365 $section_string.= '/tags'; 379 366 … … 404 391 case 'search' : 405 392 { 406 isset($params['search']) or fatal_error('make_section_in_url: require a search identifier');407 393 $section_string.= '/search/'.$params['search']; 408 394 break; … … 410 396 case 'list' : 411 397 { 412 isset($params['list']) or fatal_error('make_section_in_url: require a list of items');413 398 $section_string.= '/list/'.implode(',', $params['list']); 414 399 break; … … 471 456 else 472 457 { 473 $maybe_permalinks[] = 458 $maybe_permalinks[] = 474 459 $maybe_permalinks[count($maybe_permalinks)-1] 475 460 . '/' . $tokens[$current_token]; … … 679 664 $params['download'] = null; 680 665 } 681 666 682 667 return add_url_params(get_root_url().'action.php', $params); 683 668 } … … 813 798 814 799 $vars = array_diff_key($vars, array_flip($rejects)); 815 800 816 801 return '?' . http_build_query($vars, '', $escape ? '&' : '&'); 817 802 } -
trunk/include/functions_user.inc.php
r27158 r27388 427 427 WHERE category_id NOT IN ('.$userdata['forbidden_categories'].') 428 428 AND level>'.$userdata['level']; 429 $forbidden_ids = array_from_query($query, 'id');429 $forbidden_ids = query2array($query,null, 'id'); 430 430 431 431 if ( empty($forbidden_ids) ) … … 545 545 ).' 546 546 ;'; 547 $authorizeds = array_from_query($query, 'image_id');547 $authorizeds = query2array($query,null, 'image_id'); 548 548 549 549 $query = ' … … 552 552 WHERE user_id = '.$user['id'].' 553 553 ;'; 554 $favorites = array_from_query($query, 'image_id');554 $favorites = query2array($query,null, 'image_id'); 555 555 556 556 $to_deletes = array_diff($favorites, $authorizeds); … … 585 585 WHERE status = \'private\' 586 586 ;'; 587 $private_array = array_from_query($query, 'id');587 $private_array = query2array($query,null, 'id'); 588 588 589 589 // retrieve category ids directly authorized to the user … … 593 593 WHERE user_id = '.$user_id.' 594 594 ;'; 595 $authorized_array = array_from_query($query, 'cat_id');595 $authorized_array = query2array($query,null, 'cat_id'); 596 596 597 597 // retrieve category ids authorized to the groups the user belongs to … … 605 605 array_merge( 606 606 $authorized_array, 607 array_from_query($query, 'cat_id')607 query2array($query,null, 'cat_id') 608 608 ); 609 609 … … 623 623 WHERE visible = \'false\' 624 624 ;'; 625 $result = pwg_query($query); 626 while ($row = pwg_db_fetch_assoc($result)) 627 { 628 $forbidden_array[] = $row['id']; 629 } 625 $forbidden_array = array_merge($forbidden_array, query2array($query, null, 'id') ); 630 626 $forbidden_array = array_unique($forbidden_array); 631 627 } … … 869 865 $level = max( $conf['available_permission_levels'] ); 870 866 } 871 else 867 elseif (($user_id == $conf['guest_id']) or 872 868 ($user_id == $conf['default_user_id'])) 873 869 {
Note: See TracChangeset
for help on using the changeset viewer.