Changeset 18628 for trunk/admin/include/functions.php
- Timestamp:
- Oct 12, 2012, 9:56:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r17980 r18628 34 34 WHERE site_id = '.$id.' 35 35 ;'; 36 $result = pwg_query($query); 37 $category_ids = array(); 38 while ($row = pwg_db_fetch_assoc($result)) 39 { 40 array_push($category_ids, $row['id']); 41 } 36 $category_ids = array_from_query($query, 'id'); 42 37 delete_categories($category_ids); 43 38 … … 80 75 '.wordwrap(implode(', ', $ids), 80, "\n").') 81 76 ;'; 82 $result = pwg_query($query); 83 $element_ids = array(); 84 while ($row = pwg_db_fetch_assoc($result)) 85 { 86 array_push($element_ids, $row['id']); 87 } 77 $element_ids = array_from_query($query, 'id'); 88 78 delete_elements($element_ids); 89 79 … … 396 386 foreach ($orphan_tags as $tag) 397 387 { 398 array_push($orphan_tag_ids, $tag['id']);388 $orphan_tag_ids[] = $tag['id']; 399 389 } 400 390 … … 413 403 function get_orphan_tags() 414 404 { 415 $orphan_tags = array();416 417 405 $query = ' 418 406 SELECT … … 423 411 WHERE tag_id IS NULL 424 412 ;'; 425 $result = pwg_query($query); 426 while ($row = pwg_db_fetch_assoc($result)) 427 { 428 array_push($orphan_tags, $row); 429 } 430 431 return $orphan_tags; 413 return array_from_query($query); 432 414 } 433 415 … … 786 768 787 769 // categories : id, site_id, uppercats 788 $categories = array();789 790 770 $query = ' 791 771 SELECT id, uppercats, site_id … … 795 775 '.wordwrap(implode(', ', $cat_ids), 80, "\n").') 796 776 ;'; 797 $result = pwg_query($query); 798 while ($row = pwg_db_fetch_assoc($result)) 799 { 800 array_push($categories, $row); 801 } 777 $categories = array_from_query($query); 802 778 803 779 // filling $cat_fulldirs … … 1604 1580 WHERE id IN ('.implode(',', $images).') 1605 1581 '; 1606 1582 1607 1583 if (is_array($categories) and count($categories) > 0) 1608 1584 { … … 2084 2060 case 'rating': 2085 2061 case 'tags': 2086 case 'picture_modify':2087 2062 case 'batch_manager': 2088 2063 return 0; … … 2146 2121 { 2147 2122 $alt_names = trigger_event('get_tag_alt_names', array(), $raw_name); 2148 2149 // TEMP 2.42150 if (count($alt_names)==0 and preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['name'], $matches))2151 {2152 foreach ($matches[2] as $alt)2153 {2154 $alt_names[] = $alt;2155 }2156 }2157 2123 2158 2124 foreach( array_diff( array_unique($alt_names), array($name) ) as $alt)
Note: See TracChangeset
for help on using the changeset viewer.