Skip to content

Commit

Permalink
feature:2390
Browse files Browse the repository at this point in the history
All the legend is hidden if $conf['show_thumbnail_caption'] = false;

git-svn-id: http://piwigo.org/svn/trunk@11924 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
flop25 committed Aug 9, 2011
1 parent 3ed5fad commit 803d50f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
61 changes: 29 additions & 32 deletions include/category_default.inc.php
Expand Up @@ -136,37 +136,34 @@
$tpl_var['NB_HITS'] = $row['hit'];
}

if ($conf['show_thumbnail_caption'])
{// name of the picture
if (isset($row['name']) and $row['name'] != '')
{
$name = $row['name'];
}
else
{
$name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
}

$name = trigger_event('render_element_description', $name);

switch ($page['section'])
{
case 'best_rated' :
{
$name = '('.$row['rating_score'].') '.$name;
break;
}
case 'most_visited' :
{
if ( !$user['show_nb_hits']) {
$name = '('.$row['hit'].') '.$name;
}
break;
}
}

$tpl_var['NAME'] = $name;
}
if (isset($row['name']) and $row['name'] != '')
{
$name = $row['name'];
}
else
{
$name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
}

$name = trigger_event('render_element_description', $name);

switch ($page['section'])
{
case 'best_rated' :
{
$name = '('.$row['rating_score'].') '.$name;
break;
}
case 'most_visited' :
{
if ( !$user['show_nb_hits']) {
$name = '('.$row['hit'].') '.$name;
}
break;
}
}

$tpl_var['NAME'] = $name;

if ( isset($nb_comments_of) )
{
Expand All @@ -178,7 +175,7 @@

$tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
$template->assign('thumbnails', $tpl_thumbnails_var);

$template->assign('SHOW_THUMBNAIL_CAPTION', $conf['show_thumbnail_caption']);
$template->assign_var_from_handle('THUMBNAILS', 'index_thumbnails');

pwg_debug('end include/category_default.inc.php');
Expand Down
4 changes: 3 additions & 1 deletion themes/default/template/thumbnails.tpl
Expand Up @@ -7,8 +7,9 @@
<img class="thumbnail" src="{$thumbnail.TN_SRC}" alt="{$thumbnail.TN_ALT}" title="{if isset($thumbnail.NAME)}{$thumbnail.NAME|@replace:'"':' '}{else}{$thumbnail.TN_TITLE}{/if}">
</a>
</span>
{if $SHOW_THUMBNAIL_CAPTION }
<span class="thumbLegend">
{if isset($thumbnail.NAME)}{$thumbnail.NAME}{/if}
{$thumbnail.NAME}
{if !empty($thumbnail.icon_ts)}
<img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
{/if}
Expand All @@ -26,6 +27,7 @@
</span>
{/if}
</span>
{/if}
</span>
</li>
{/foreach}{/strip}
Expand Down

0 comments on commit 803d50f

Please sign in to comment.