Changeset 1068 for trunk/admin/include/functions.php
- Timestamp:
- Mar 7, 2006, 2:20:02 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1064 r1068 1 2 1 <?php 3 2 // +-----------------------------------------------------------------------+ … … 188 187 ;'; 189 188 pwg_query($query); 190 189 191 190 $query = ' 192 191 DELETE FROM '.GROUP_ACCESS_TABLE.' … … 206 205 207 206 $sources_of = array(); 208 207 209 208 while ($row = mysql_fetch_array($result)) 210 209 { … … 446 445 { 447 446 array_push($query_ids, $row['category_id']); 448 447 449 448 array_push( 450 449 $datas, … … 1350 1349 { 1351 1350 $images_of = array(); 1352 1351 1353 1352 $query = ' 1354 1353 SELECT category_id, image_id … … 1369 1368 ); 1370 1369 } 1371 1370 1372 1371 $fulldirs = get_fulldirs( 1373 1372 array_keys($images_of) … … 1619 1618 1620 1619 $destinations_of = array(); 1621 1620 1622 1621 while ($row = mysql_fetch_array($result)) 1623 1622 { … … 1639 1638 // let's suppose we only need a single turn 1640 1639 $need_new_turn = false; 1641 1640 1642 1641 foreach ($destinations_of as $source => $destinations) 1643 1642 { … … 1656 1655 array($source) // no cyclic link 1657 1656 ); 1658 1657 1659 1658 if (count($missing_destinations) > 0) 1660 1659 { … … 1685 1684 $filtered_destinations_of[$category] = array(); 1686 1685 } 1687 1686 1688 1687 foreach ($destinations_of as $source => $destinations) 1689 1688 { … … 1713 1712 1714 1713 $sources_of = array(); 1715 1714 1716 1715 foreach ($destinations_of as $source => $destinations) 1717 1716 { … … 1726 1725 } 1727 1726 } 1728 1727 1729 1728 // eventually, filter 1730 1729 if (is_array($categories)) … … 1738 1737 $filtered_sources_of[$category] = array(); 1739 1738 } 1740 1739 1741 1740 foreach ($sources_of as $destination => $sources) 1742 1741 { … … 1784 1783 } 1785 1784 } 1786 1785 1787 1786 $query = ' 1788 1787 SELECT image_id, category_id … … 1803 1802 1804 1803 $inserts = array(); 1805 1804 1806 1805 foreach ($sources_of as $destination => $sources) 1807 1806 { 1808 1807 // merge all images from the sources of this destination 1809 1808 $sources_images = array(); 1810 1809 1811 1810 foreach ($sources as $source) 1812 1811 { … … 1875 1874 * 1876 1875 * Warning: only virtual links can be removed, physical links are protected. 1877 * 1876 * 1878 1877 * @param int destination 1879 1878 * @param array sources … … 1894 1893 ;'; 1895 1894 pwg_query($query); 1896 1895 1897 1896 // The strategy is the following: 1898 1897 // … … 1928 1927 $destinations_of[$destination] 1929 1928 ); 1930 1929 1931 1930 // unlink sources images from destinations 1932 1931 $query = ' … … 1949 1948 1950 1949 $request_random = array(); 1951 1950 1952 1951 while ($row = mysql_fetch_array($result)) 1953 1952 { … … 1979 1978 { 1980 1979 global $conf; 1981 1980 1982 1981 // is the given category name only containing blank spaces ? 1983 1982 if (preg_match('/^\s*$/', $category_name)) … … 1985 1984 return array('error' => l10n('cat_error_name')); 1986 1985 } 1987 1986 1988 1987 $parent_id = !empty($parent_id) ? $parent_id : 'NULL'; 1989 1988 … … 1994 1993 ;'; 1995 1994 list($current_rank) = mysql_fetch_array(pwg_query($query)); 1996 1995 1997 1996 $insert = array( 1998 1997 'name' => $category_name, … … 2001 2000 'uploadable' => 'false', 2002 2001 ); 2003 2002 2004 2003 if ($parent_id != 'NULL') 2005 2004 { … … 2013 2012 $insert{'id_uppercat'} = $parent{'id'}; 2014 2013 $insert{'global_rank'} = $parent{'global_rank'}.'.'.$insert{'rank'}; 2015 2014 2016 2015 // at creation, must a category be visible or not ? Warning : if the 2017 2016 // parent category is invisible, the category is automatically create … … 2025 2024 $insert{'visible'} = $conf['newcat_default_visible']; 2026 2025 } 2027 2026 2028 2027 // at creation, must a category be public or private ? Warning : if the 2029 2028 // parent category is private, the category is automatically create … … 2067 2066 ;'; 2068 2067 pwg_query($query); 2069 2068 2070 2069 return array( 2071 2070 'info' => l10n('cat_virtual_added'),
Note: See TracChangeset
for help on using the changeset viewer.