aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/category_default.inc.php61
-rw-r--r--themes/default/template/thumbnails.tpl4
2 files changed, 32 insertions, 33 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index c6e9834d7..c4eb448bf 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -136,37 +136,34 @@ foreach ($pictures as $row)
$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) )
{
@@ -178,7 +175,7 @@ foreach ($pictures as $row)
$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');
diff --git a/themes/default/template/thumbnails.tpl b/themes/default/template/thumbnails.tpl
index 9b06f3c5c..93faaf06e 100644
--- a/themes/default/template/thumbnails.tpl
+++ b/themes/default/template/thumbnails.tpl
@@ -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}
@@ -26,6 +27,7 @@
</span>
{/if}
</span>
+ {/if}
</span>
</li>
{/foreach}{/strip}