Changeset 12796 for trunk/admin


Ignore:
Timestamp:
12/27/11 06:26:44 (8 years ago)
Author:
rvelices
Message:

feature 2541 multisize

  • core implementation + usage on most public/admin pages
  • still to do: sync process, upload, gui/persistence for size parameters, migration script, center of interest ...
Location:
trunk/admin
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager_global.php

    r12748 r12796  
    712712 
    713713  $query = ' 
    714 SELECT id,path,tn_ext,file,filesize,level,name 
     714SELECT id,path,representative_ext,file,filesize,level,name 
    715715  FROM '.IMAGES_TABLE; 
    716716   
     
    748748  { 
    749749    $nb_thumbs_page++; 
    750     $src = get_thumbnail_url($row); 
     750    $src = DerivativeImage::thumb_url($row); 
    751751 
    752752    $title = $row['name']; 
  • trunk/admin/batch_manager_unit.php

    r11853 r12796  
    202202 
    203203  $query = ' 
    204 SELECT id,path,tn_ext,name,date_creation,comment,author,level,file 
     204SELECT id,path,representative_ext,name,date_creation,comment,author,level,file 
    205205  FROM '.IMAGES_TABLE; 
    206206   
     
    238238    array_push($element_ids, $row['id']); 
    239239 
    240     $src = get_thumbnail_url($row); 
     240    $src = DerivativeImage::thumb_url($row); 
    241241 
    242242    // creation date 
  • trunk/admin/cat_modify.php

    r12591 r12796  
    302302  { 
    303303    $query = ' 
    304 SELECT id,tn_ext,path 
     304SELECT id,representative_ext,path 
    305305  FROM '.IMAGES_TABLE.' 
    306306  WHERE id = '.$category['representative_picture_id'].' 
    307307;'; 
    308308    $row = pwg_db_fetch_assoc(pwg_query($query)); 
    309     $src = get_thumbnail_url($row); 
     309    $src = DerivativeImage::thumb_url($row); 
    310310    $url = get_root_url().'admin.php?page=picture_modify'; 
    311311    $url.= '&image_id='.$category['representative_picture_id']; 
     
    388388  { 
    389389    $query = ' 
    390 SELECT id, file, path, tn_ext 
     390SELECT id, file, path, representative_ext 
    391391  FROM '.IMAGES_TABLE.' 
    392392  WHERE id = '.$category['representative_picture_id'].' 
     
    404404                          'category' => $category 
    405405                        )) 
    406                       .'" class="thumblnk"><img src="'.get_thumbnail_url($element).'"></a>'; 
     406                      .'" class="thumblnk"><img src="'.DerivativeImage::thumb_url($element).'"></a>'; 
    407407    } 
    408408  } 
  • trunk/admin/comments.php

    r12596 r12796  
    100100$query = ' 
    101101SELECT c.id, c.image_id, c.date, c.author, '. 
    102 $conf['user_fields']['username'].' AS username, c.content, i.path, i.tn_ext 
     102$conf['user_fields']['username'].' AS username, c.content, i.path, i.representative_ext 
    103103  FROM '.COMMENTS_TABLE.' AS c 
    104104    INNER JOIN '.IMAGES_TABLE.' AS i 
     
    112112while ($row = pwg_db_fetch_assoc($result)) 
    113113{ 
    114   $thumb = get_thumbnail_url( 
     114  $thumb = DerivativeImage::thumb_url( 
    115115      array( 
    116116        'id'=>$row['image_id'], 
  • trunk/admin/element_set_ranks.php

    r12782 r12796  
    200200    file, 
    201201    path, 
    202     tn_ext, 
     202    representative_ext, 
     203    width, height, 
    203204    name, 
    204205    rank 
     
    215216        $thumbnail_info=array(); 
    216217        $clipping=array(); 
     218  $derivativeParams = ImageStdParams::get_by_type(IMG_SQUARE); 
    217219        while ($row = pwg_db_fetch_assoc($result)) 
    218220        { 
    219                 $src = get_thumbnail_url($row); 
    220  
    221                 $thumbnail_size = getimagesize($src); 
     221    $derivative = new DerivativeImage($derivativeParams, new SrcImage($row)); 
     222 
     223                $thumbnail_size = $derivative->get_size(); 
    222224                if ( !empty( $row['name'] ) ) 
    223225                { 
     
    234236                        'height'        => $thumbnail_size[1], 
    235237                        'id'    => $row['id'], 
    236                         'tn_src'        => $src, 
     238                        'tn_src'        => $derivative->get_url(), 
    237239                        'rank'  => $current_rank * 10, 
    238240                        ); 
  • trunk/admin/history.php

    r9808 r12796  
    304304    file, 
    305305    path, 
    306     tn_ext 
     306    representative_ext 
    307307  FROM '.IMAGES_TABLE.' 
    308308  WHERE id IN ('.implode(',', array_keys($image_ids)).') 
     
    314314    $file_of_image = array(); 
    315315    $path_of_image = array(); 
    316     $tn_ext_of_image = array(); 
     316    $representative_ext_of_image = array(); 
    317317 
    318318    $result = pwg_query($query); 
     
    333333      $file_of_image[ $row['id'] ] = $row['file']; 
    334334      $path_of_image[ $row['id'] ] = $row['path']; 
    335       $tn_ext_of_image[ $row['id'] ] = $row['tn_ext']; 
     335      $representative_ext_of_image[ $row['id'] ] = $row['representative_ext']; 
    336336    } 
    337337 
     
    455455          'file' => $file_of_image[$line['image_id']], 
    456456          'path' => $path_of_image[$line['image_id']], 
    457           'tn_ext' => $tn_ext_of_image[$line['image_id']], 
     457          'representative_ext' => $representative_ext_of_image[$line['image_id']], 
    458458          ); 
    459459        $thumbnail_display = $page['search']['fields']['display_thumbnail']; 
     
    488488          $image_string = 
    489489            '<a class="thumbnail" href="'.$picture_url.'">' 
    490             .'<span><img src="'.get_thumbnail_url($element) 
     490            .'<span><img src="'.DerivativeImage::thumb_url($element) 
    491491            .'" alt="'.$image_title.'" title="'.$image_title.'">' 
    492492            .'</span></a>'; 
     
    497497          $image_string = 
    498498            '<a class="over" href="'.$picture_url.'">' 
    499             .'<span><img src="'.get_thumbnail_url($element) 
     499            .'<span><img src="'.DerivativeImage::thumb_url($element) 
    500500            .'" alt="'.$image_title.'" title="'.$image_title.'">' 
    501501            .'</span>'.$image_title.'</a>'; 
  • trunk/admin/picture_modify.php

    r12612 r12796  
    283283    'PATH'=>$row['path'], 
    284284 
    285     'TN_SRC' => get_thumbnail_url($row), 
     285    'TN_SRC' => DerivativeImage::thumb_url($row), 
    286286 
    287287    'NAME' => 
  • trunk/admin/rating.php

    r12624 r12796  
    185185        i.path, 
    186186        i.file, 
    187         i.tn_ext, 
     187        i.representative_ext, 
    188188        i.rating_score, 
    189189        r.element_id 
     
    202202foreach ($images as $image) 
    203203{ 
    204   $thumbnail_src = get_thumbnail_url($image); 
     204  $thumbnail_src = DerivativeImage::thumb_url($image); 
    205205 
    206206  $image_url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify'. 
  • trunk/admin/rating_user.php

    r12650 r12796  
    102102if (count($image_ids) > 0 ) 
    103103{ 
    104   $query = 'SELECT id, name, file, path, tn_ext 
     104  $query = 'SELECT id, name, file, path, representative_ext 
    105105  FROM '.IMAGES_TABLE.' 
    106106  WHERE id IN ('.implode(',', array_keys($image_ids)).')'; 
     
    109109  { 
    110110    $image_urls[ $row['id'] ] = array( 
    111       'tn' => get_thumbnail_url($row), 
     111      'tn' => DerivativeImage::thumb_url($row), 
    112112      'page' => make_picture_url( array('image_id'=>$row['id'], 'image_file'=>$row['file']) ), 
    113113    ); 
     
    218218  'ratings' => $by_user_ratings, 
    219219  'image_urls' => $image_urls, 
    220   'TN_WIDTH' => 20+2*$conf['upload_form_thumb_maxwidth'], 
     220  'TN_WIDTH' => 28+2*ImageStdParams::get_by_type(IMG_THUMB)->sizing->ideal_size[0], 
    221221  ) ); 
    222222$template->set_filename('rating', 'rating_user.tpl'); 
  • trunk/admin/themes/default/template/rating_user.tpl

    r12650 r12796  
    6060                {capture assign=rate_over}{foreach from=$rates item=rate_arr}<img src="{$image_urls[$rate_arr.id].tn}" alt="thumb-{$rate_arr.id}" title="{$rate_arr.date}"></img> 
    6161                {/foreach}{/capture} 
    62                 <a class="cluetip" title="{$rate_over|@htmlspecialchars}">{$rates|@count}</a> 
     62                <a class="cluetip" title="|{$rate_over|@htmlspecialchars}">{$rates|@count}</a> 
    6363                {/if}</td> 
    6464        {/foreach} 
     
    7272jQuery(document).ready(function(){ldelim} 
    7373        jQuery('.cluetip').cluetip({ldelim} 
    74                 width: {$TN_WIDTH}, splitTitle: '|' 
     74                width: {$TN_WIDTH}, showTitle:false, splitTitle: '|' 
    7575        }); 
    7676}) 
Note: See TracChangeset for help on using the changeset viewer.