mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 18:01:31 +02:00
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 ... git-svn-id: http://piwigo.org/svn/trunk@12796 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -711,7 +711,7 @@ if (count($page['cat_elements_id']) > 0)
|
||||
|
||||
|
||||
$query = '
|
||||
SELECT id,path,tn_ext,file,filesize,level,name
|
||||
SELECT id,path,representative_ext,file,filesize,level,name
|
||||
FROM '.IMAGES_TABLE;
|
||||
|
||||
if ($is_category)
|
||||
@@ -747,7 +747,7 @@ SELECT id,path,tn_ext,file,filesize,level,name
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$nb_thumbs_page++;
|
||||
$src = get_thumbnail_url($row);
|
||||
$src = DerivativeImage::thumb_url($row);
|
||||
|
||||
$title = $row['name'];
|
||||
if (empty($title))
|
||||
|
||||
@@ -201,7 +201,7 @@ if (count($page['cat_elements_id']) > 0)
|
||||
|
||||
|
||||
$query = '
|
||||
SELECT id,path,tn_ext,name,date_creation,comment,author,level,file
|
||||
SELECT id,path,representative_ext,name,date_creation,comment,author,level,file
|
||||
FROM '.IMAGES_TABLE;
|
||||
|
||||
if ($is_category)
|
||||
@@ -237,7 +237,7 @@ SELECT id,path,tn_ext,name,date_creation,comment,author,level,file
|
||||
{
|
||||
array_push($element_ids, $row['id']);
|
||||
|
||||
$src = get_thumbnail_url($row);
|
||||
$src = DerivativeImage::thumb_url($row);
|
||||
|
||||
// creation date
|
||||
if (!empty($row['date_creation']))
|
||||
|
||||
@@ -301,12 +301,12 @@ if ($category['has_images']
|
||||
if (!empty($category['representative_picture_id']))
|
||||
{
|
||||
$query = '
|
||||
SELECT id,tn_ext,path
|
||||
SELECT id,representative_ext,path
|
||||
FROM '.IMAGES_TABLE.'
|
||||
WHERE id = '.$category['representative_picture_id'].'
|
||||
;';
|
||||
$row = pwg_db_fetch_assoc(pwg_query($query));
|
||||
$src = get_thumbnail_url($row);
|
||||
$src = DerivativeImage::thumb_url($row);
|
||||
$url = get_root_url().'admin.php?page=picture_modify';
|
||||
$url.= '&image_id='.$category['representative_picture_id'];
|
||||
|
||||
@@ -387,7 +387,7 @@ if (isset($_POST['submitEmail']) and !empty($_POST['group']))
|
||||
if (!empty($category['representative_picture_id']))
|
||||
{
|
||||
$query = '
|
||||
SELECT id, file, path, tn_ext
|
||||
SELECT id, file, path, representative_ext
|
||||
FROM '.IMAGES_TABLE.'
|
||||
WHERE id = '.$category['representative_picture_id'].'
|
||||
;';
|
||||
@@ -403,7 +403,7 @@ SELECT id, file, path, tn_ext
|
||||
'image_file' => $element['file'],
|
||||
'category' => $category
|
||||
))
|
||||
.'" class="thumblnk"><img src="'.get_thumbnail_url($element).'"></a>';
|
||||
.'" class="thumblnk"><img src="'.DerivativeImage::thumb_url($element).'"></a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -99,7 +99,7 @@ $list = array();
|
||||
|
||||
$query = '
|
||||
SELECT c.id, c.image_id, c.date, c.author, '.
|
||||
$conf['user_fields']['username'].' AS username, c.content, i.path, i.tn_ext
|
||||
$conf['user_fields']['username'].' AS username, c.content, i.path, i.representative_ext
|
||||
FROM '.COMMENTS_TABLE.' AS c
|
||||
INNER JOIN '.IMAGES_TABLE.' AS i
|
||||
ON i.id = c.image_id
|
||||
@@ -111,7 +111,7 @@ $conf['user_fields']['username'].' AS username, c.content, i.path, i.tn_ext
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$thumb = get_thumbnail_url(
|
||||
$thumb = DerivativeImage::thumb_url(
|
||||
array(
|
||||
'id'=>$row['image_id'],
|
||||
'path'=>$row['path'],
|
||||
|
||||
@@ -199,7 +199,8 @@ SELECT
|
||||
id,
|
||||
file,
|
||||
path,
|
||||
tn_ext,
|
||||
representative_ext,
|
||||
width, height,
|
||||
name,
|
||||
rank
|
||||
FROM '.IMAGES_TABLE.'
|
||||
@@ -214,11 +215,12 @@ if (pwg_db_num_rows($result) > 0)
|
||||
$current_rank = 1;
|
||||
$thumbnail_info=array();
|
||||
$clipping=array();
|
||||
$derivativeParams = ImageStdParams::get_by_type(IMG_SQUARE);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$src = get_thumbnail_url($row);
|
||||
$derivative = new DerivativeImage($derivativeParams, new SrcImage($row));
|
||||
|
||||
$thumbnail_size = getimagesize($src);
|
||||
$thumbnail_size = $derivative->get_size();
|
||||
if ( !empty( $row['name'] ) )
|
||||
{
|
||||
$thumbnail_name = $row['name'];
|
||||
@@ -233,7 +235,7 @@ if (pwg_db_num_rows($result) > 0)
|
||||
'width' => $thumbnail_size[0],
|
||||
'height' => $thumbnail_size[1],
|
||||
'id' => $row['id'],
|
||||
'tn_src' => $src,
|
||||
'tn_src' => $derivative->get_url(),
|
||||
'rank' => $current_rank * 10,
|
||||
);
|
||||
if ($thumbnail_size[0]<=128 and $thumbnail_size[1]<=128)
|
||||
|
||||
+6
-6
@@ -303,7 +303,7 @@ SELECT
|
||||
high_filesize,
|
||||
file,
|
||||
path,
|
||||
tn_ext
|
||||
representative_ext
|
||||
FROM '.IMAGES_TABLE.'
|
||||
WHERE id IN ('.implode(',', array_keys($image_ids)).')
|
||||
;';
|
||||
@@ -313,7 +313,7 @@ SELECT
|
||||
$high_filesize_of_image = array();
|
||||
$file_of_image = array();
|
||||
$path_of_image = array();
|
||||
$tn_ext_of_image = array();
|
||||
$representative_ext_of_image = array();
|
||||
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
@@ -332,7 +332,7 @@ SELECT
|
||||
|
||||
$file_of_image[ $row['id'] ] = $row['file'];
|
||||
$path_of_image[ $row['id'] ] = $row['path'];
|
||||
$tn_ext_of_image[ $row['id'] ] = $row['tn_ext'];
|
||||
$representative_ext_of_image[ $row['id'] ] = $row['representative_ext'];
|
||||
}
|
||||
|
||||
// echo '<pre>'; print_r($high_filesize_of_image); echo '</pre>';
|
||||
@@ -454,7 +454,7 @@ SELECT
|
||||
'id' => $line['image_id'],
|
||||
'file' => $file_of_image[$line['image_id']],
|
||||
'path' => $path_of_image[$line['image_id']],
|
||||
'tn_ext' => $tn_ext_of_image[$line['image_id']],
|
||||
'representative_ext' => $representative_ext_of_image[$line['image_id']],
|
||||
);
|
||||
$thumbnail_display = $page['search']['fields']['display_thumbnail'];
|
||||
}
|
||||
@@ -487,7 +487,7 @@ SELECT
|
||||
{
|
||||
$image_string =
|
||||
'<a class="thumbnail" href="'.$picture_url.'">'
|
||||
.'<span><img src="'.get_thumbnail_url($element)
|
||||
.'<span><img src="'.DerivativeImage::thumb_url($element)
|
||||
.'" alt="'.$image_title.'" title="'.$image_title.'">'
|
||||
.'</span></a>';
|
||||
break;
|
||||
@@ -496,7 +496,7 @@ SELECT
|
||||
{
|
||||
$image_string =
|
||||
'<a class="over" href="'.$picture_url.'">'
|
||||
.'<span><img src="'.get_thumbnail_url($element)
|
||||
.'<span><img src="'.DerivativeImage::thumb_url($element)
|
||||
.'" alt="'.$image_title.'" title="'.$image_title.'">'
|
||||
.'</span>'.$image_title.'</a>';
|
||||
break;
|
||||
|
||||
@@ -282,7 +282,7 @@ $template->assign(
|
||||
|
||||
'PATH'=>$row['path'],
|
||||
|
||||
'TN_SRC' => get_thumbnail_url($row),
|
||||
'TN_SRC' => DerivativeImage::thumb_url($row),
|
||||
|
||||
'NAME' =>
|
||||
isset($_POST['name']) ?
|
||||
|
||||
+2
-2
@@ -184,7 +184,7 @@ SELECT i.id,
|
||||
GROUP BY i.id,
|
||||
i.path,
|
||||
i.file,
|
||||
i.tn_ext,
|
||||
i.representative_ext,
|
||||
i.rating_score,
|
||||
r.element_id
|
||||
ORDER BY ' . $available_order_by[$order_by_index][1] .'
|
||||
@@ -201,7 +201,7 @@ while ($row = pwg_db_fetch_assoc($result))
|
||||
$template->assign( 'images', array() );
|
||||
foreach ($images as $image)
|
||||
{
|
||||
$thumbnail_src = get_thumbnail_url($image);
|
||||
$thumbnail_src = DerivativeImage::thumb_url($image);
|
||||
|
||||
$image_url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
|
||||
'&image_id='.$image['id'];
|
||||
|
||||
@@ -101,14 +101,14 @@ while ($row = pwg_db_fetch_assoc($result))
|
||||
$image_urls = array();
|
||||
if (count($image_ids) > 0 )
|
||||
{
|
||||
$query = 'SELECT id, name, file, path, tn_ext
|
||||
$query = 'SELECT id, name, file, path, representative_ext
|
||||
FROM '.IMAGES_TABLE.'
|
||||
WHERE id IN ('.implode(',', array_keys($image_ids)).')';
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$image_urls[ $row['id'] ] = array(
|
||||
'tn' => get_thumbnail_url($row),
|
||||
'tn' => DerivativeImage::thumb_url($row),
|
||||
'page' => make_picture_url( array('image_id'=>$row['id'], 'image_file'=>$row['file']) ),
|
||||
);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ $template->assign( array(
|
||||
'available_rates' => $conf['rate_items'],
|
||||
'ratings' => $by_user_ratings,
|
||||
'image_urls' => $image_urls,
|
||||
'TN_WIDTH' => 20+2*$conf['upload_form_thumb_maxwidth'],
|
||||
'TN_WIDTH' => 28+2*ImageStdParams::get_by_type(IMG_THUMB)->sizing->ideal_size[0],
|
||||
) );
|
||||
$template->set_filename('rating', 'rating_user.tpl');
|
||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'rating');
|
||||
|
||||
@@ -59,7 +59,7 @@ function del(elt,uid,aid)
|
||||
<td>{if !empty($rates)}
|
||||
{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>
|
||||
{/foreach}{/capture}
|
||||
<a class="cluetip" title="{$rate_over|@htmlspecialchars}">{$rates|@count}</a>
|
||||
<a class="cluetip" title="|{$rate_over|@htmlspecialchars}">{$rates|@count}</a>
|
||||
{/if}</td>
|
||||
{/foreach}
|
||||
<td><a onclick="return del(this,{$rating.uid},'{$rating.aid}');"><img src="{$themeconf.admin_icon_dir}/delete.png" alt="[{'Delete'|@translate}]"></a></td>
|
||||
@@ -71,7 +71,7 @@ function del(elt,uid,aid)
|
||||
{footer_script require='jquery.cluetip'}
|
||||
jQuery(document).ready(function(){ldelim}
|
||||
jQuery('.cluetip').cluetip({ldelim}
|
||||
width: {$TN_WIDTH}, splitTitle: '|'
|
||||
width: {$TN_WIDTH}, showTitle:false, splitTitle: '|'
|
||||
});
|
||||
})
|
||||
{/footer_script}
|
||||
Reference in New Issue
Block a user