Index: /trunk/admin/picture_modify.php
===================================================================
--- /trunk/admin/picture_modify.php (revision 13085)
+++ /trunk/admin/picture_modify.php (revision 13086)
@@ -302,7 +302,8 @@
$intro_vars = array(
'file' => sprintf(l10n('Original file : %s'), $row['file']),
- 'added' => sprintf(l10n('Posted %s on %s by %s'), time_since($row['date_available'], 'month'), format_date($row['date_available'], false, false), $row['added_by']),
+ 'add_date' => sprintf(l10n('Posted %s on %s'), time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)),
+ 'added_by' => sprintf(l10n('Added by %s'), $row['added_by']),
'size' => $row['width'].'×'.$row['height'].' pixels, '.sprintf('%.2f', $row['filesize']/1024).'MB',
- 'hits' => sprintf(l10n('%d visits'), $row['hit']),
+ 'stats' => sprintf(l10n('Visited %d times'), $row['hit']),
'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']),
);
@@ -318,5 +319,5 @@
list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query));
- $intro_vars['rate'] = sprintf(l10n('Rated %d times, score : %f'), $row['nb_rates'], $row['rating_score']);
+ $intro_vars['stats'].= ', '.sprintf(l10n('Rated %d times, score : %.2f'), $row['nb_rates'], $row['rating_score']);
}
Index: /trunk/admin/themes/default/template/picture_modify.tpl
===================================================================
--- /trunk/admin/themes/default/template/picture_modify.tpl (revision 13085)
+++ /trunk/admin/themes/default/template/picture_modify.tpl (revision 13086)
@@ -47,16 +47,16 @@
-
-
+
+
- {$INTRO.file}
- - {$INTRO.added}
+ - {$INTRO.add_date}
+ - {$INTRO.added_by}
- {$INTRO.size}
- - {$INTRO.hits}
- {if $INTRO.rate}- {$INTRO.rate}
{/if}
+ - {$INTRO.stats}
- {$INTRO.id}
|
-
+
{if isset($U_JUMPTO) }
- {'jump to photo'|@translate} →
Index: /trunk/include/functions.inc.php
===================================================================
--- /trunk/include/functions.inc.php (revision 13085)
+++ /trunk/include/functions.inc.php (revision 13086)
@@ -547,4 +547,9 @@
$tok = strtok('- :');
}
+
+ if ($ymdhms[0] < 1970) return false;
+ if (!isset($ymdhms[3])) $ymdhms[3] = 12;
+ if (!isset($ymdhms[4])) $ymdhms[4] = 0;
+ if (!isset($ymdhms[5])) $ymdhms[5] = 0;
$original = mktime($ymdhms[3],$ymdhms[4],$ymdhms[5],$ymdhms[1],$ymdhms[2],$ymdhms[0]);
}
@@ -552,11 +557,11 @@
// array of time period chunks
$chunks = array(
- array(60 * 60 * 24 * 365 , 'year'),
- array(60 * 60 * 24 * 30 , 'month'),
- array(60 * 60 * 24 * 7, 'week'),
- array(60 * 60 * 24 , 'day'),
- array(60 * 60 , 'hour'),
- array(60 , 'minute'),
- array(1 , 'second'),
+ 'year' => 60 * 60 * 24 * 365,
+ 'month' => 60 * 60 * 24 * 30,
+ 'week' => 60 * 60 * 24 * 7,
+ 'day' => 60 * 60 * 24,
+ 'hour' => 60 * 60,
+ 'minute' => 60,
+ 'second' => 1,
);
@@ -565,14 +570,12 @@
$print = null;
- for ($i = 0, $j = count($chunks); $i < $j; $i++)
- {
- $seconds = $chunks[$i][0];
- $name = $chunks[$i][1];
+ foreach ($chunks as $name => $seconds)
+ {
if (($count = floor($since / $seconds)) != 0)
{
- $print.= ($count == 1) ? '1 '.l10n($name).' ' : $count.' '.l10n($name.'s').' ';
+ $print.= l10n_dec('%d '.$name, '%d '.$name.'s', $count);
$since-= $count*$seconds;
}
- if ($name == $stop)
+ if (!empty($print) and $chunks[$name] <= $chunks[$stop])
{
break;
| |