file: functions.inc.php
code change: how the thumb_title and the n_views are rendered
css: class .thumb_title / new: .n_views
#449: the thumb_title line checks for "title" and "hits" and hence the span line always gets rendered (except for images that have not yet been viewed once).
#449:
$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title'])?"":"").sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits'])."</span>" : '';
this may seem a bit like splitting hairs but... splitting that $caption check up in 2 phases (check title / check nviews) and generate html code accordingly seems to be a "cleaner" solution and one that gives the user more control over the "Look and Feel" of the output.
Due to lack of config settings for switching hit numbers on or off (maybe in a future release) i linked the "n_views" output to "comment_count" on/off (a temporary solution only).
#447
// Set picture caption
if ($set_caption) foreach ($rowset as $key => $row){
$caption = ($rowset[$key]['title']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title'])?"":"")."</span>" : '';
if ($CONFIG['display_comment_count']) {
$caption .= ($rowset[$key]['hits']) ? "<span class=\"n_views\">".sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits'])."</span>" : '';
}
if ($CONFIG['caption_in_thumbview']){
$caption .= $rowset[$key]['caption'] ? "<span class=\"thumb_caption\">".bb_decode(($rowset[$key]['caption']))."</span>" : '';
}
if ($CONFIG['display_comment_count']) {
$comments_nr = count_pic_comments($row['pid']);
if ($comments_nr > 0) $caption .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
}
$rowset[$key]['caption_text'] = $caption;
}
i introduced a new class "n_views" enabling the user to control the "look" of the "viewed" output in css and I split the output up in two spans since I feel the thumb_title deserves a line on it's own and certainly it's own style.
of course the x Hits are still displayed in the same line as the title but in its own style and if you want it to be displayed under it just add a br tag to the n_views string in the language file.
all it needs now is a $CONFIG['display_hits_count'] and it's good to go.
cheers
eke.