Changeset 13086
- Timestamp:
- Feb 10, 2012, 6:02:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/picture_modify.php
r13084 r13086 302 302 $intro_vars = array( 303 303 'file' => sprintf(l10n('Original file : %s'), $row['file']), 304 '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']), 304 'add_date' => sprintf(l10n('Posted %s on %s'), time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)), 305 'added_by' => sprintf(l10n('Added by %s'), $row['added_by']), 305 306 'size' => $row['width'].'×'.$row['height'].' pixels, '.sprintf('%.2f', $row['filesize']/1024).'MB', 306 ' hits' => sprintf(l10n('%d visits'), $row['hit']),307 'stats' => sprintf(l10n('Visited %d times'), $row['hit']), 307 308 'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']), 308 309 ); … … 318 319 list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query)); 319 320 320 $intro_vars[' rate'] = sprintf(l10n('Rated %d times, score : %f'), $row['nb_rates'], $row['rating_score']);321 $intro_vars['stats'].= ', '.sprintf(l10n('Rated %d times, score : %.2f'), $row['nb_rates'], $row['rating_score']); 321 322 } 322 323 -
trunk/admin/themes/default/template/picture_modify.tpl
r13084 r13086 47 47 <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail"> 48 48 </td> 49 <td id="albumLinks" style="width: 500px;vertical-align:top;">50 <ul >49 <td id="albumLinks" style="width:400px;vertical-align:top;"> 50 <ul style="padding-left:15px;margin:0;"> 51 51 <li>{$INTRO.file}</li> 52 <li>{$INTRO.added}</li> 52 <li>{$INTRO.add_date}</li> 53 <li>{$INTRO.added_by}</li> 53 54 <li>{$INTRO.size}</li> 54 <li>{$INTRO.hits}</li> 55 {if $INTRO.rate}<li>{$INTRO.rate}</li>{/if} 55 <li>{$INTRO.stats}</li> 56 56 <li>{$INTRO.id}</li> 57 57 </ul> 58 58 </td> 59 59 <td style="vertical-align:top;"> 60 <ul style="padding-left:15px; ">60 <ul style="padding-left:15px;margin:0;"> 61 61 {if isset($U_JUMPTO) } 62 62 <li><a href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li> -
trunk/include/functions.inc.php
r13085 r13086 547 547 $tok = strtok('- :'); 548 548 } 549 550 if ($ymdhms[0] < 1970) return false; 551 if (!isset($ymdhms[3])) $ymdhms[3] = 12; 552 if (!isset($ymdhms[4])) $ymdhms[4] = 0; 553 if (!isset($ymdhms[5])) $ymdhms[5] = 0; 549 554 $original = mktime($ymdhms[3],$ymdhms[4],$ymdhms[5],$ymdhms[1],$ymdhms[2],$ymdhms[0]); 550 555 } … … 552 557 // array of time period chunks 553 558 $chunks = array( 554 array(60 * 60 * 24 * 365 , 'year'),555 array(60 * 60 * 24 * 30 , 'month'),556 array(60 * 60 * 24 * 7, 'week'),557 array(60 * 60 * 24 , 'day'),558 array(60 * 60 , 'hour'),559 array(60 , 'minute'),560 array(1 , 'second'),559 'year' => 60 * 60 * 24 * 365, 560 'month' => 60 * 60 * 24 * 30, 561 'week' => 60 * 60 * 24 * 7, 562 'day' => 60 * 60 * 24, 563 'hour' => 60 * 60, 564 'minute' => 60, 565 'second' => 1, 561 566 ); 562 567 … … 565 570 566 571 $print = null; 567 for ($i = 0, $j = count($chunks); $i < $j; $i++) 568 { 569 $seconds = $chunks[$i][0]; 570 $name = $chunks[$i][1]; 572 foreach ($chunks as $name => $seconds) 573 { 571 574 if (($count = floor($since / $seconds)) != 0) 572 575 { 573 $print.= ($count == 1) ? '1 '.l10n($name).' ' : $count.' '.l10n($name.'s').' ';576 $print.= l10n_dec('%d '.$name, '%d '.$name.'s', $count); 574 577 $since-= $count*$seconds; 575 578 } 576 if ( $name == $stop)579 if (!empty($print) and $chunks[$name] <= $chunks[$stop]) 577 580 { 578 581 break;
Note: See TracChangeset
for help on using the changeset viewer.