Changeset 13084 for trunk


Ignore:
Timestamp:
Feb 10, 2012, 5:10:00 PM (13 years ago)
Author:
mistic100
Message:

feature 2564: display picture infos as list

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/picture_modify.php

    r13077 r13084  
    297297while ($user_row = pwg_db_fetch_assoc($result))
    298298{
    299   $added_by = $user_row['username'];
    300 }
    301 
    302 $intro = sprintf(
    303   l10n('This photo was posted on %s by %s.'),
    304   format_date($row['date_available']),
    305   $added_by
    306   );
    307 
    308 $intro.= ' ';
    309 
    310 $intro.= sprintf(
    311   l10n('Original file is %s, %ux%u pixels, %.2fMB.'),
    312   $row['file'],
    313   $row['width'],
    314   $row['height'],
    315   $row['filesize']/1024
    316   );
    317 
    318 $intro.= ' ';
    319 
    320 $intro.= sprintf(
    321   l10n('%u visits'),
    322   $row['hit']
     299  $row['added_by'] = $user_row['username'];
     300}
     301
     302$intro_vars = array(
     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']),
     305  'size' => $row['width'].'×'.$row['height'].' pixels, '.sprintf('%.2f', $row['filesize']/1024).'MB',
     306  'hits' => sprintf(l10n('%d visits'), $row['hit']),
     307  'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']),
    323308  );
    324309
     
    331316  WHERE element_id = '.$_GET['image_id'].'
    332317;';
    333   list($nb_rates) = pwg_db_fetch_row(pwg_query($query));
     318  list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query));
    334319 
    335   $intro.= sprintf(
    336     l10n(', %u rates, rating score %s'),
    337     $nb_rates,
    338     $row['rating_score']
    339     );
    340 }
    341 
    342 $intro.= '. ';
    343 
    344 $intro.= sprintf(
    345   l10n('Numeric identifier is %u.'),
    346   $row['id']
    347   );
    348 
    349 $template->assign('INTRO', $intro);
     320  $intro_vars['rate'] = sprintf(l10n('Rated %d times, score : %f'), $row['nb_rates'], $row['rating_score']);
     321}
     322
     323$template->assign('INTRO', $intro_vars);
     324 
    350325
    351326if (in_array(get_extension($row['path']),$conf['picture_ext']))
  • trunk/admin/themes/default/template/picture_modify.tpl

    r13077 r13084  
    4545      <tr>
    4646        <td id="albumThumbnail">
    47 <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail">
     47          <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail">
    4848        </td>
     49        <td id="albumLinks" style="width:500px;vertical-align:top;">
     50          <ul>
     51            <li>{$INTRO.file}</li>
     52            <li>{$INTRO.added}</li>
     53            <li>{$INTRO.size}</li>
     54            <li>{$INTRO.hits}</li>
     55            {if $INTRO.rate}<li>{$INTRO.rate}</li>{/if}
     56            <li>{$INTRO.id}</li>
     57          </ul>
     58        </td>
     59        <td style="vertical-align:top;">
     60          <ul style="padding-left:15px;">
     61          {if isset($U_JUMPTO) }
     62            <li><a href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li>
     63          {/if}
     64          {if !url_is_remote($PATH)}
     65            <li><a href="{$U_SYNC}">{'Synchronize metadata'|@translate}</a></li>
    4966
    50         <td id="albumLinks">
    51 <p style="text-align:left">{$INTRO}</p>
    52 
    53 <ul style="padding-left:15px;">
    54 {if isset($U_JUMPTO) }
    55   <li><a href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li>
    56 {/if}
    57 
    58 {if !url_is_remote($PATH)}
    59   <li><a href="{$U_SYNC}">{'Synchronize metadata'|@translate}</a></li>
    60 
    61   <li><a href="{$U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete photo'|@translate}</a></li>
    62   {/if}
    63 
    64 </ul>
     67            <li><a href="{$U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete photo'|@translate}</a></li>
     68          {/if}
     69          </ul>
    6570        </td>
    6671      </tr>
Note: See TracChangeset for help on using the changeset viewer.