Changeset 13086


Ignore:
Timestamp:
Feb 10, 2012, 6:02:54 PM (9 years ago)
Author:
mistic100
Message:

feature 2564: small changes in infos list

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/picture_modify.php

    r13084 r13086  
    302302$intro_vars = array(
    303303  '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']),
    305306  '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']),
    307308  'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']),
    308309  );
     
    318319  list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query));
    319320 
    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']);
    321322}
    322323
  • trunk/admin/themes/default/template/picture_modify.tpl

    r13084 r13086  
    4747          <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail">
    4848        </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;">
    5151            <li>{$INTRO.file}</li>
    52             <li>{$INTRO.added}</li>
     52            <li>{$INTRO.add_date}</li>
     53            <li>{$INTRO.added_by}</li>
    5354            <li>{$INTRO.size}</li>
    54             <li>{$INTRO.hits}</li>
    55             {if $INTRO.rate}<li>{$INTRO.rate}</li>{/if}
     55            <li>{$INTRO.stats}</li>
    5656            <li>{$INTRO.id}</li>
    5757          </ul>
    5858        </td>
    5959        <td style="vertical-align:top;">
    60           <ul style="padding-left:15px;">
     60          <ul style="padding-left:15px;margin:0;">
    6161          {if isset($U_JUMPTO) }
    6262            <li><a href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li>
  • trunk/include/functions.inc.php

    r13085 r13086  
    547547      $tok = strtok('- :');
    548548    }
     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;
    549554    $original = mktime($ymdhms[3],$ymdhms[4],$ymdhms[5],$ymdhms[1],$ymdhms[2],$ymdhms[0]);
    550555  }
     
    552557  // array of time period chunks
    553558  $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,
    561566  );
    562567 
     
    565570 
    566571  $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  {
    571574    if (($count = floor($since / $seconds)) != 0)
    572575    {
    573       $print.= ($count == 1) ? '1 '.l10n($name).' ' : $count.' '.l10n($name.'s').' ';
     576      $print.= l10n_dec('%d '.$name, '%d '.$name.'s', $count);
    574577      $since-= $count*$seconds;
    575578    }
    576     if ($name == $stop)
     579    if (!empty($print) and $chunks[$name] <= $chunks[$stop])
    577580    {
    578581      break;
Note: See TracChangeset for help on using the changeset viewer.