Navigation Menu

Skip to content

Commit

Permalink
feature:2330 ability to hide the "new" icon for recent photos
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@11285 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jun 9, 2011
1 parent 87e8bd9 commit 7532e1a
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 8 deletions.
1 change: 1 addition & 0 deletions admin/configuration.php
Expand Up @@ -78,6 +78,7 @@
'index_posted_date_icon',
'index_created_date_icon',
'index_slideshow_icon',
'index_new_icon',
'picture_metadata_icon',
'picture_slideshow_icon',
'picture_favorite_icon',
Expand Down
7 changes: 7 additions & 0 deletions admin/themes/default/template/configuration.tpl
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion include/category_cats.inc.php
Expand Up @@ -306,7 +306,6 @@
'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(
Expand All @@ -328,6 +327,10 @@
'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'])
{
Expand Down
5 changes: 4 additions & 1 deletion include/category_default.inc.php
Expand Up @@ -110,7 +110,6 @@
'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 */
Expand All @@ -127,6 +126,10 @@
'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'])
{
Expand Down
15 changes: 9 additions & 6 deletions include/functions_category.inc.php
Expand Up @@ -50,7 +50,7 @@ function check_restrictions($category_id)

function get_categories_menu()
{
global $page, $user, $filter;
global $page, $user, $filter, $conf;

$query = '
SELECT ';
Expand Down Expand Up @@ -110,21 +110,24 @@ function get_categories_menu()
'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'];
Expand Down
1 change: 1 addition & 0 deletions install/config.sql
Expand Up @@ -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');
Expand Down
42 changes: 42 additions & 0 deletions 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"
;
?>
1 change: 1 addition & 0 deletions language/en_UK/admin.lang.php
Expand Up @@ -98,6 +98,7 @@
$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';
Expand Down
1 change: 1 addition & 0 deletions language/fr_FR/admin.lang.php
Expand Up @@ -852,4 +852,5 @@
$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';
?>

0 comments on commit 7532e1a

Please sign in to comment.