mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-20 16:42:59 +02:00
Issue 0000614: Display hits under thumbnails like comments counter
- Comments are not plurial < 2 - hits and comments have specific classes for css control git-svn-id: http://piwigo.org/svn/trunk@1769 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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 ?
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -299,6 +299,8 @@ $lang['%d comment to validate'] = '%d comment to validate';
|
||||
$lang['%d comments to validate'] = '%d comments to validate';
|
||||
$lang['%d new comment'] = '%d new comment';
|
||||
$lang['%d new comments'] = '%d new comments';
|
||||
$lang['%d comment'] = '%d comment';
|
||||
$lang['%d comments'] = '%d comments';
|
||||
$lang['%d hit'] = '%d hit';
|
||||
$lang['%d hits'] = '%d hits';
|
||||
$lang['%d new element'] = '%d new element';
|
||||
|
||||
@@ -299,6 +299,8 @@ $lang['%d comment to validate'] = '%d commentaire utilisateur
|
||||
$lang['%d comments to validate'] = '%d commentaires utilisateur à valider';
|
||||
$lang['%d new comment'] = '%d nouveau commentaire utilisateur';
|
||||
$lang['%d new comments'] = '%d nouveaux commentaires utilisateur';
|
||||
$lang['%d comment'] = '%d commentaire';
|
||||
$lang['%d comments'] = '%d commentaires';
|
||||
$lang['%d hit'] = 'vue %d fois';
|
||||
$lang['%d hits'] = 'vue %d fois';
|
||||
$lang['%d new element'] = '%d nouvel élément';
|
||||
|
||||
@@ -248,6 +248,11 @@ SPAN.calItem, SPAN.calItemEmpty
|
||||
label {
|
||||
cursor:pointer
|
||||
}
|
||||
|
||||
.zero { display: none }
|
||||
.one { }
|
||||
.2nmore { }
|
||||
|
||||
/* nice looking month calendar*/
|
||||
TD.calDayCellEmpty, TD.calDayCellFull { border: 1px solid gray;}
|
||||
|
||||
|
||||
@@ -238,6 +238,11 @@ SPAN.calItem, SPAN.calItemEmpty
|
||||
label {
|
||||
cursor:pointer
|
||||
}
|
||||
|
||||
.zero { display: none }
|
||||
.one { }
|
||||
.2nmore { }
|
||||
|
||||
/* nice looking month calendar*/
|
||||
TD.calDayCellEmpty, TD.calDayCellFull { border: 1px solid gray;}
|
||||
|
||||
@@ -246,3 +251,16 @@ TD.calDayCellEmpty { color: silver; }
|
||||
.calBackDate { color: #000; }
|
||||
.calForeDate { color: #fff; }
|
||||
.virtual_cat { background: #222 !important; }
|
||||
|
||||
.PWG {
|
||||
font-family: verdana, arial, helvetica, sans-serif !important;
|
||||
font-size: 0.9em;
|
||||
font-weight: normal;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
a.PWG { border: 0px; }
|
||||
a.PWG .P { color : #f92; }
|
||||
a.PWG .W { color : #aaa; }
|
||||
a.PWG .G { color : #69c; }
|
||||
a.PWG:hover .P { color : #69c; }
|
||||
a.PWG:hover .G { color : #f92; }
|
||||
|
||||
@@ -21,11 +21,17 @@
|
||||
<!-- END category_name -->
|
||||
{thumbnails.line.thumbnail.IMAGE_TS}
|
||||
<!-- BEGIN nb_comments -->
|
||||
<br />{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS} {lang:comments}
|
||||
<span class="{thumbnails.line.thumbnail.nb_comments.CLASS}">
|
||||
<br />
|
||||
{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS}
|
||||
</span>
|
||||
<!-- END nb_comments -->
|
||||
<!-- BEGIN nb_hits -->
|
||||
<br />{thumbnails.line.thumbnail.nb_hits.HITS}
|
||||
<!-- END nb_comments -->
|
||||
<span class="{thumbnails.line.thumbnail.nb_hits.CLASS}">
|
||||
<br />
|
||||
{thumbnails.line.thumbnail.nb_hits.HITS}
|
||||
</span>
|
||||
<!-- END nb_hits -->
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user