From b72f6620e664e321815433adcb3f9ed9ff771a43 Mon Sep 17 00:00:00 2001 From: rub Date: Sun, 4 Mar 2007 09:36:30 +0000 Subject: Remove "TODO" on picture display showed on the caddie... git-svn-id: http://piwigo.org/svn/trunk@1868 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/element_set_global.php | 6 +++--- include/category_default.inc.php | 9 +-------- include/functions.inc.php | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/admin/element_set_global.php b/admin/element_set_global.php index cb55282e2..ad1ff8135 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -369,7 +369,7 @@ if (count($page['cat_elements_id']) > 0) $template->assign_vars(array('NAV_BAR' => $nav_bar)); $query = ' -SELECT id,path,tn_ext +SELECT id,path,tn_ext,file,filesize FROM '.IMAGES_TABLE.' WHERE id IN ('.implode(',', $page['cat_elements_id']).') '.$conf['order_by'].' @@ -393,8 +393,8 @@ SELECT id,path,tn_ext array( 'ID' => $row['id'], 'SRC' => $src, - 'ALT' => 'TODO', - 'TITLE' => 'TODO' + 'ALT' => $row['file'], + 'TITLE' => get_thumbnail_title($row) ) ); } diff --git a/include/category_default.inc.php b/include/category_default.inc.php index 19a8d7633..48e16fa95 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -74,13 +74,6 @@ foreach ($pictures as $row) { $thumbnail_url = get_thumbnail_url($row); - // message in title for the thumbnail - $thumbnail_title = $row['file']; - if (isset($row['filesize'])) - { - $thumbnail_title .= ' : '.$row['filesize'].' KB'; - } - // link on picture.php page $url = duplicate_picture_url( array( @@ -95,7 +88,7 @@ foreach ($pictures as $row) array( 'IMAGE' => $thumbnail_url, 'IMAGE_ALT' => $row['file'], - 'IMAGE_TITLE' => $thumbnail_title, + 'IMAGE_TITLE' => get_thumbnail_title($row), 'IMAGE_TS' => get_icon($row['date_available']), 'U_IMG_LINK' => $url, diff --git a/include/functions.inc.php b/include/functions.inc.php index eb706e6ba..5990b1f68 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -819,6 +819,26 @@ function get_thumbnail_location($element_info) return $path; } +/* returns the title of the thumnail */ +function get_thumbnail_title($element_info) +{ + // message in title for the thumbnail + if (isset($element_info['file'])) + { + $thumbnail_title = $element_info['file']; + } + else + { + $thumbnail_title = ''; + } + + if (!empty($element_info['filesize'])) + { + $thumbnail_title .= ' : '.$element_info['filesize'].' KB'; + } + + return $thumbnail_title; +} // my_error returns (or send to standard output) the message concerning the // error occured for the last mysql query. -- cgit v1.2.3