From 7532e1a802beb74b32417cedefc9a000733c8004 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Thu, 9 Jun 2011 20:34:48 +0000 Subject: [PATCH] feature:2330 ability to hide the "new" icon for recent photos git-svn-id: http://piwigo.org/svn/trunk@11285 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/configuration.php | 1 + .../themes/default/template/configuration.tpl | 7 ++++ include/category_cats.inc.php | 5 ++- include/category_default.inc.php | 5 ++- include/functions_category.inc.php | 15 ++++--- install/config.sql | 1 + install/db/107-database.php | 42 +++++++++++++++++++ language/en_UK/admin.lang.php | 1 + language/fr_FR/admin.lang.php | 1 + 9 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 install/db/107-database.php diff --git a/admin/configuration.php b/admin/configuration.php index c03e4223b..5a5f97eee 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -78,6 +78,7 @@ $display_checkboxes = array( 'index_posted_date_icon', 'index_created_date_icon', 'index_slideshow_icon', + 'index_new_icon', 'picture_metadata_icon', 'picture_slideshow_icon', 'picture_favorite_icon', diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index f9d3cd576..ac40c6fbd 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -239,6 +239,13 @@ jQuery(document).ready(function () { {'display only recently posted photos'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')} + + +
  • +
  • diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php index 4271ad9be..47ae8fda8 100644 --- a/include/category_cats.inc.php +++ b/include/category_cats.inc.php @@ -306,7 +306,6 @@ if (count($categories) > 0) 'ID' => $category['id'], 'TN_SRC' => $thumbnail_src_of[$category['representative_picture_id']], 'TN_ALT' => strip_tags($category['name']), - 'icon_ts' => get_icon($category['max_date_last'], $category['is_child_date_last']), 'URL' => make_index_url( array( @@ -328,6 +327,10 @@ if (count($categories) > 0) 'subcatify_category_description')), 'NAME' => $name, ); + if ($conf['index_new_icon']) + { + $row['icon_ts'] = get_icon($category['max_date_last'], $category['is_child_date_last']); + } if ($conf['display_fromto']) { diff --git a/include/category_default.inc.php b/include/category_default.inc.php index 589d50724..66c89f889 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -110,7 +110,6 @@ foreach ($pictures as $row) 'TN_SRC' => get_thumbnail_url($row), 'TN_ALT' => $row['file'], 'TN_TITLE' => get_thumbnail_title($row), - 'icon_ts' => get_icon($row['date_available']), 'URL' => $url, /* Fields for template-extension usage */ @@ -127,6 +126,10 @@ foreach ($pictures as $row) 'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ? true:false, /* lack of include/functions_picture.inc.php */ ); + if ($conf['index_new_icon']) + { + $row['icon_ts'] = get_icon($row['date_available']); + } if ($user['show_nb_hits']) { diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index 44cefb0b5..067b7b798 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -50,7 +50,7 @@ function check_restrictions($category_id) function get_categories_menu() { - global $page, $user, $filter; + global $page, $user, $filter, $conf; $query = ' SELECT '; @@ -110,21 +110,24 @@ WHERE '.$where.' 'render_category_name', $row['name'], 'get_categories_menu' - ), + ), 'TITLE' => get_display_images_count( $row['nb_images'], $row['count_images'], $row['count_categories'], false, ' / ' - ), + ), 'URL' => make_index_url(array('category' => $row)), 'LEVEL' => substr_count($row['global_rank'], '.') + 1, - 'icon_ts' => get_icon($row['max_date_last'], $child_date_last), 'SELECTED' => $selected_category['id'] == $row['id'] ? true : false, 'IS_UPPERCAT' => $selected_category['id_uppercat'] == $row['id'] ? true : false, - ) - ); + ) + ); + if ($conf['index_new_icon']) + { + $row['icon_ts'] = get_icon($row['max_date_last'], $child_date_last); + } array_push($cats, $row); if ($row['id']==@$page['category']['id']) //save the number of subcats for later optim $page['category']['count_categories'] = $row['count_categories']; diff --git a/install/config.sql b/install/config.sql index 22805cd8e..04d342e25 100644 --- a/install/config.sql +++ b/install/config.sql @@ -36,6 +36,7 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('index_flat_icon','true' INSERT INTO piwigo_config (param,value,comment) VALUES ('index_posted_date_icon','true','Display calendar by posted date'); INSERT INTO piwigo_config (param,value,comment) VALUES ('index_created_date_icon','true','Display calendar by creation date icon'); INSERT INTO piwigo_config (param,value,comment) VALUES ('index_slideshow_icon','true','Display slideshow icon'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_new_icon','true','Display new icons next albums and pictures'); INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_metadata_icon','true','Display metadata icon on picture page'); INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_slideshow_icon','true','Display slideshow icon on picture page'); INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_favorite_icon','true','Display favorite icon on picture page'); diff --git a/install/db/107-database.php b/install/db/107-database.php new file mode 100644 index 000000000..46aaecadb --- /dev/null +++ b/install/db/107-database.php @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 1a06d530b..76d8c181f 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -98,6 +98,7 @@ $lang['Activate icon "%s"'] = 'Activate icon "%s"'; $lang['Activate Navigation Bar'] = 'Activate navigation bar'; $lang['Activate Navigation Thumbnails'] = 'Activate navigation thumbnails'; $lang['Activate'] = "Activate"; +$lang['Activate icon "new" next to albums and pictures'] = 'Activate icon "new" next to albums and pictures'; $lang['Active Languages'] = 'Active Languages'; $lang['Active Plugins'] = 'Active Plugins'; $lang['Active Themes'] = 'Active Themes'; diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index b551498ca..4f6a09411 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -852,4 +852,5 @@ $lang['Default photos order inside album'] = "Ordre par défaut des photos dans $lang['Invalid order string'] = 'Chaîne SQL incorrecte'; $lang['As default order'] = "Comme l'ordre par défaut"; $lang['Custom'] = "Personnalisé"; +$lang['Activate icon "new" next to albums and pictures'] = 'Afficher l\'icône "nouveau" à côté des albums et des photos'; ?> \ No newline at end of file