aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-06-09 20:34:48 +0000
committermistic100 <mistic@piwigo.org>2011-06-09 20:34:48 +0000
commit7532e1a802beb74b32417cedefc9a000733c8004 (patch)
tree3f0bacd34b9921df9ddc07a88f2d9dd9109c73fb
parent87e8bd9788a561ad045d149c549ed6d995983f1b (diff)
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
-rw-r--r--admin/configuration.php1
-rw-r--r--admin/themes/default/template/configuration.tpl7
-rw-r--r--include/category_cats.inc.php5
-rw-r--r--include/category_default.inc.php5
-rw-r--r--include/functions_category.inc.php15
-rw-r--r--install/config.sql1
-rw-r--r--install/db/107-database.php42
-rw-r--r--language/en_UK/admin.lang.php1
-rw-r--r--language/fr_FR/admin.lang.php1
9 files changed, 70 insertions, 8 deletions
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 () {
<span class="property">{'display only recently posted photos'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}</span>
<input type="checkbox" name="menubar_filter_icon" {if ($display.menubar_filter_icon)}checked="checked"{/if}>
</label>
+ </li>
+
+ <li>
+ <label>
+ <span class="property">{'Activate icon "new" next to albums and pictures'|@translate}</span>
+ <input type="checkbox" name="index_new_icon" {if ($display.index_new_icon)}checked="checked"{/if}>
+ </label>
</li>
<li>
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 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+$upgrade_description = 'Display new icons next albums and pictures';
+
+$query = '
+INSERT INTO piwigo_config (param,value,comment)
+ VALUES (\'index_new_icon\',\'true\',\'Display new icons next albums and pictures\')
+;';
+pwg_query($query);
+
+echo
+"\n"
+. $upgrade_description
+."\n"
+;
+?> \ 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