diff options
author | plegall <plg@piwigo.org> | 2005-09-14 21:57:05 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-09-14 21:57:05 +0000 |
commit | 3371c757424cef291be02a946e528983dece9543 (patch) | |
tree | 2ede9c21e065d766d8a3226309635c46b596d77d /admin/include/functions.php | |
parent | eac1724ee5e20967d989916b76fc9076411be758 (diff) |
- improvement: long localized messages are in HTML files instead of $lang
array. This is the case of admin/help and about pages.
- deletion: of unused functions (ts_to_mysqldt, is_image, TN_exists,
check_date_format, date_convert, get_category_directories,
get_used_metadata_list, array_remove, pwg_write_debug,
get_group_restrictions, get_all_group_restrictions, is_group_allowed,
style_select, deprecated_getAttribute).
- new: many new contextual help pages to replace descriptions previously
included in pages.
- modification: reorganisation of language files. Deletion of unused
language keys, alphabetical sort. No faq.lang.php anymore (replaced by
help.html). Only done for en_UK.iso-8859-1.
git-svn-id: http://piwigo.org/svn/trunk@862 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/functions.php')
-rw-r--r-- | admin/include/functions.php | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index 78ec15a09..12a032b39 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -27,44 +27,6 @@ include(PHPWG_ROOT_PATH.'admin/include/functions_metadata.php'); -$tab_ext_create_TN = array ( 'jpg', 'png', 'JPG', 'PNG' ); - -// is_image returns true if the given $filename (including the path) is a -// picture according to its format and its extension. -// As GD library can only generate pictures from jpeg and png files, if you -// ask if the filename is an image for thumbnail creation (second parameter -// set to true), the only authorized formats are jpeg and png. -function is_image( $filename, $create_thumbnail = false ) -{ - global $conf, $tab_ext_create_TN; - - if (is_file($filename) - and in_array(get_extension($filename), $conf['picture_ext'])) - { - $size = getimagesize( $filename ); - // $size[2] == 1 means GIF - // $size[2] == 2 means JPG - // $size[2] == 3 means PNG - if ( !$create_thumbnail ) - { - if ( in_array( get_extension( $filename ), $conf['picture_ext'] ) - and ( $size[2] == 1 or $size[2] == 2 or $size[2] == 3 ) ) - { - return true; - } - } - else - { - if ( in_array( get_extension( $filename ), $tab_ext_create_TN ) - and ( $size[2] == 2 or $size[2] == 3 ) ) - { - return true; - } - } - } - return false; -} - /** * returns an array with all picture files according to $conf['file_ext'] * @@ -142,22 +104,6 @@ function get_representative_files($dir) return $pictures; } -function TN_exists( $dir, $file ) -{ - global $conf; - - $filename = get_filename_wo_extension( $file ); - foreach ( $conf['picture_ext'] as $ext ) { - $test = $dir.'/thumbnail/'.$conf['prefix_thumbnail'].$filename.'.'.$ext; - if ( is_file ( $test ) ) - { - return $ext; - } - } - return false; -} - - // The function delete_site deletes a site and call the function // delete_categories for each primary category of the site function delete_site( $id ) @@ -552,21 +498,6 @@ SELECT id } } -function check_date_format( $date ) -{ - // date arrives at this format : DD/MM/YYYY - @list($day,$month,$year) = explode( '/', $date ); - return @checkdate( $month, $day, $year ); -} - -function date_convert( $date ) -{ - // date arrives at this format : DD/MM/YYYY - // It must be transformed in YYYY-MM-DD - list($day,$month,$year) = explode( '/', $date ); - return $year.'-'.$month.'-'.$day; -} - function date_convert_back( $date ) { // date arrives at this format : YYYY-MM-DD @@ -602,37 +533,6 @@ function get_keywords($keywords_string) } /** - * returns an array containing sub-directories which can be a category - * - * directories nammed "thumbnail", "pwg_high" or "pwg_representative" are - * omitted - * - * @param string $basedir - * @return array - */ -function get_category_directories( $basedir ) -{ - $sub_dirs = array(); - - if ( $opendir = opendir( $basedir ) ) - { - while ( $file = readdir( $opendir ) ) - { - if ($file != '.' - and $file != '..' - and $file != 'thumbnail' - and $file != 'pwg_high' - and $file != 'pwg_representative' - and is_dir($basedir.'/'.$file)) - { - array_push( $sub_dirs, $file ); - } - } - } - return $sub_dirs; -} - -/** * returns an array containing sub-directories which can be a category, * recursive by default * |