completely replaced get_thumbnail_src it get_thumbnail_url

or get_thumbnail_path

git-svn-id: http://piwigo.org/svn/trunk@1609 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2006-11-15 04:25:12 +00:00
commit 221d839769
6 changed files with 45 additions and 63 deletions

View file

@ -388,12 +388,12 @@ if ($category['nb_images'] > 0
if (!empty($category['representative_picture_id']))
{
$query = '
SELECT tn_ext,path
SELECT id,tn_ext,path
FROM '.IMAGES_TABLE.'
WHERE id = '.$category['representative_picture_id'].'
;';
$row = mysql_fetch_array(pwg_query($query));
$src = get_thumbnail_src($row['path'], @$row['tn_ext']);
$src = get_thumbnail_url($row);
$url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
$url.= '&image_id='.$category['representative_picture_id'];

View file

@ -399,9 +399,9 @@ SELECT id,path,tn_ext
$template->assign_block_vars('thumbnails', array());
}
while ($row = mysql_fetch_array($result))
while ($row = mysql_fetch_assoc($result))
{
$src = get_thumbnail_src($row['path'], @$row['tn_ext']);
$src = get_thumbnail_url($row);
$template->assign_block_vars(
'thumbnails.thumbnail',

View file

@ -202,12 +202,12 @@ SELECT id,path,tn_ext,name,date_creation,comment,author,file
;';
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
while ($row = mysql_fetch_assoc($result))
{
// echo '<pre>'; print_r($row); echo '</pre>';
array_push($element_ids, $row['id']);
$src = get_thumbnail_src($row['path'], @$row['tn_ext']);
$src = get_thumbnail_url($row);
$query = '
SELECT tag_id

View file

@ -234,7 +234,7 @@ $template->assign_vars(
'PATH'=>$row['path'],
'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']),
'TN_SRC' => get_thumbnail_url($row),
'NAME' =>
isset($_POST['name']) ?

View file

@ -106,23 +106,16 @@ SELECT id, storage_category_id, file, tn_ext
{
$dir = get_complete_dir($row['storage_category_id']);
unlink($dir.$row['file']);
if (isset($row['tn_ext']) and $row['tn_ext'] != '')
{
unlink(
get_thumbnail_src(
$dir.$row['file'],
$row['tn_ext']
)
$element_info = array(
'path' => $dir.$row['file'],
'tn_ext' =>
(isset($row['tn_ext']) and $row['tn_ext']!='') ? $row['tn_ext']:'jpg'
);
}
else if (@is_file(get_thumbnail_src($dir.$row['file'], 'jpg')))
$tn_path = get_thumbnail_path( $element_info );
if ( @is_file($tn_path) )
{
unlink(
get_thumbnail_src(
$dir.$row['file'],
'jpg'
)
);
unlink( $tn_path );
}
}

View file

@ -680,17 +680,6 @@ function get_pwg_themes()
return $themes;
}
/**
DEPRECATED use get_thumbnail_path or get_thumbnail_url
*/
function get_thumbnail_src($path, $tn_ext = '', $with_rewrite = true)
{
if ($with_rewrite)
return get_thumbnail_url( array('path'=>$path, 'tn_ext'=>$tn_ext) );
else
return get_thumbnail_path( array('path'=>$path, 'tn_ext'=>$tn_ext) );
}
/* Returns the PATH to the thumbnail to be displayed. If the element does not
* have a thumbnail, the default mime image path is returned. The PATH can be
* used in the php script, but not sent to the browser.