- Timestamp:
- Nov 3, 2006, 2:26:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1452 r1592 28 28 include(PHPWG_ROOT_PATH.'admin/include/functions_metadata.php'); 29 29 30 /**31 * returns an array with all picture files according to $conf['file_ext']32 *33 * @param string $dir34 * @return array35 */36 function get_pwg_files($dir)37 {38 global $conf;39 40 $pictures = array();41 if ($opendir = opendir($dir))42 {43 while ($file = readdir($opendir))44 {45 if (in_array(get_extension($file), $conf['file_ext']))46 {47 array_push($pictures, $file);48 }49 }50 }51 return $pictures;52 }53 54 /**55 * returns an array with all thumbnails according to $conf['picture_ext']56 * and $conf['prefix_thumbnail']57 *58 * @param string $dir59 * @return array60 */61 function get_thumb_files($dir)62 {63 global $conf;64 65 $prefix_length = strlen($conf['prefix_thumbnail']);66 67 $thumbnails = array();68 if ($opendir = @opendir($dir.'/thumbnail'))69 {70 while ($file = readdir($opendir))71 {72 if (in_array(get_extension($file), $conf['picture_ext'])73 and substr($file, 0, $prefix_length) == $conf['prefix_thumbnail'])74 {75 array_push($thumbnails, $file);76 }77 }78 }79 return $thumbnails;80 }81 82 /**83 * returns an array with representative picture files of a directory84 * according to $conf['picture_ext']85 *86 * @param string $dir87 * @return array88 */89 function get_representative_files($dir)90 {91 global $conf;92 93 $pictures = array();94 if ($opendir = @opendir($dir.'/pwg_representative'))95 {96 while ($file = readdir($opendir))97 {98 if (in_array(get_extension($file), $conf['picture_ext']))99 {100 array_push($pictures, $file);101 }102 }103 }104 return $pictures;105 }106 30 107 31 // The function delete_site deletes a site and call the function … … 1234 1158 USER_GROUP_TABLE 1235 1159 ); 1236 1160 1237 1161 foreach ($tables as $table) 1238 1162 { … … 1707 1631 return; 1708 1632 } 1709 1633 1710 1634 // we can't insert twice the same {image_id,tag_id} so we must first 1711 1635 // delete lines we'll insert later … … 1747 1671 return $page['tag_id_from_tag_name_cache'][$tag_name]; 1748 1672 } 1749 1673 1750 1674 if (function_exists('mysql_real_escape_string')) 1751 1675 { … … 1800 1724 1801 1725 $inserts = array(); 1802 1726 1803 1727 foreach ($tags_of as $image_id => $tag_ids) 1804 1728 { … … 1831 1755 { 1832 1756 global $prefixeTable; 1833 1757 1834 1758 $all_tables = array(); 1835 1759 … … 1850 1774 { 1851 1775 $all_primary_key = array(); 1852 1776 1853 1777 $query = 'DESC '.$table_name.';'; 1854 1778 $result = pwg_query($query); … … 1860 1784 } 1861 1785 } 1862 1786 1863 1787 if (count($all_primary_key) != 0) 1864 1788 { … … 1913 1837 } 1914 1838 } 1915 1839 1916 1840 mass_inserts( 1917 1841 IMAGE_CATEGORY_TABLE,
Note: See TracChangeset
for help on using the changeset viewer.