Changeset 16281


Ignore:
Timestamp:
Jul 2, 2012, 3:30:33 PM (12 years ago)
Author:
plg
Message:

bug 2661 fixed: there is no more high_filesize in Piwigo 2.4. We have to remove it from history search.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/admin/history.php

    r14688 r16281  
    304304    IF(name IS NULL, file, name) AS label,
    305305    filesize,
    306     high_filesize,
    307306    file,
    308307    path,
     
    314313    $label_of_image = array();
    315314    $filesize_of_image = array();
    316     $high_filesize_of_image = array();
    317315    $file_of_image = array();
    318316    $path_of_image = array();
     
    329327      }
    330328
    331       if (isset($row['high_filesize']))
    332       {
    333         $high_filesize_of_image[ $row['id'] ] = $row['high_filesize'];
    334       }
    335 
    336329      $file_of_image[ $row['id'] ] = $row['file'];
    337330      $path_of_image[ $row['id'] ] = $row['path'];
    338331      $representative_ext_of_image[ $row['id'] ] = $row['representative_ext'];
    339332    }
    340 
    341     // echo '<pre>'; print_r($high_filesize_of_image); echo '</pre>';
    342333  }
    343334
     
    361352  foreach ($history_lines as $line)
    362353  {
    363     // FIXME when we watch the representative of a non image element, it is
    364     // the not the representative filesize that is counted (as it is
    365     // unknown) but the non image element filesize. Proposed solution: add
    366     // #images.representative_filesize and add 'representative' in the
    367     // choices of #history.image_type.
    368 
    369     if (isset($line['image_type']))
    370     {
    371       if ($line['image_type'] == 'high')
    372       {
    373         if (isset($high_filesize_of_image[$line['image_id']]))
    374         {
    375           $summary['total_filesize']+=
    376             $high_filesize_of_image[$line['image_id']];
    377         }
    378       }
    379       else
    380       {
    381         if (isset($filesize_of_image[$line['image_id']]))
    382         {
    383           $summary['total_filesize']+=
    384             $filesize_of_image[$line['image_id']];
    385         }
     354    if (isset($line['image_type']) and $line['image_type'] == 'high')
     355    {
     356      if (isset($filesize_of_image[$line['image_id']]))
     357      {
     358        $summary['total_filesize'] += $filesize_of_image[$line['image_id']];
    386359      }
    387360    }
     
    549522        $page['nb_lines']
    550523        ),
    551       'FILESIZE' => $summary['total_filesize'].' KB',
     524      'FILESIZE' => $summary['total_filesize'] != 0 ? ceil($summary['total_filesize']/1024).' MB' : '',
    552525      'USERS' => l10n_dec(
    553526        '%d user', '%d users',
Note: See TracChangeset for help on using the changeset viewer.