diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/category_default.inc.php | 14 | ||||
-rw-r--r-- | include/functions_html.inc.php | 13 |
2 files changed, 25 insertions, 2 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php index db8091c3e..fed872691 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -110,7 +110,12 @@ foreach ($pictures as $row) { $template->assign_block_vars( 'thumbnails.line.thumbnail.nb_hits', - array('HITS'=> l10n_dec('%d hit', '%d hits', $row['hit']))); + array( + 'HITS'=> l10n_dec('%d hit', '%d hits', $row['hit']), + 'CLASS'=> set_span_class($row['hit']) . ' nb-hits', + ) + ); + } if ($conf['show_thumbnail_caption']) @@ -165,7 +170,12 @@ SELECT COUNT(*) AS nb_comments $row = mysql_fetch_array(pwg_query($query)); $template->assign_block_vars( 'thumbnails.line.thumbnail.nb_comments', - array('NB_COMMENTS'=>$row['nb_comments'])); + array( + 'NB_COMMENTS'=> l10n_dec('%d comment', '%d comments', + $row['nb_comments']), + 'CLASS'=> set_span_class($row['nb_comments']) . ' nb-comments', + ) + ); } //plugins need to add/modify sth in this loop ? diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 48c05ea06..53690211b 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -718,4 +718,17 @@ function set_status_header($code, $text='') header("Status: $code $text"); trigger_action('set_status_header', $code, $text); } + +/** + * set a class to display a counter + * .zero .one .2nmore + */ +function set_span_class($count) +{ + if ($count > 1) + { + return '2nmore'; + } + return ( $count == 0 ) ? 'zero':'one'; +} ?> |