diff options
author | patdenice <patdenice@piwigo.org> | 2009-03-11 17:25:26 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2009-03-11 17:25:26 +0000 |
commit | 36d0da30d307cd821413ccb8ea1ccc68de1d8538 (patch) | |
tree | e94b6f52d4657cecc5f7340526a467f095b684a3 /include/functions_html.inc.php | |
parent | 1516e8833f3a73b1dc4b73e7fa7d3c36bc25c0b4 (diff) |
Move get_icon function.
git-svn-id: http://piwigo.org/svn/trunk@3188 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r-- | include/functions_html.inc.php | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 4dac9cb88..4be5ef077 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -21,58 +21,6 @@ // | USA. | // +-----------------------------------------------------------------------+ -function get_icon($date, $is_child_date = false) -{ - global $cache, $user; - - if (empty($date)) - { - return ''; - } - - if (isset($cache['get_icon'][$date])) - { - if (! $cache['get_icon'][$date] ) - return ''; - return $cache['get_icon']['_icons_'][$is_child_date]; - } - - if (!isset($cache['get_icon']['sql_recent_date'])) - { - // Use MySql date in order to standardize all recent "actions/queries" - list($cache['get_icon']['sql_recent_date']) = - mysql_fetch_array(pwg_query('select SUBDATE( - CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)')); - } - - $cache['get_icon'][$date] = false; - if ( $date > $cache['get_icon']['sql_recent_date'] ) - { - if ( !isset($cache['get_icon']['_icons_'] ) ) - { - $icons = array(false => 'recent', true => 'recent_by_child' ); - $title = sprintf( - l10n('elements posted during the last %d days'), - $user['recent_period'] - ); - foreach ($icons as $key => $icon) - { - $icon_url = get_themeconf('icon_dir').'/'.$icon.'.png'; - $size = getimagesize( PHPWG_ROOT_PATH.$icon_url ); - $icon_url = get_root_url().$icon_url; - $output = '<img title="'.$title.'" src="'.$icon_url.'" class="icon" style="border:0;'; - $output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="(!)">'; - $cache['get_icon']['_icons_'][$key] = $output; - } - } - $cache['get_icon'][$date] = true; - } - - if (! $cache['get_icon'][$date] ) - return ''; - return $cache['get_icon']['_icons_'][$is_child_date]; -} - /** * returns the list of categories as a HTML string * |