mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-18 07:16:11 +02:00
- big update in thumbnail creation process : form is always shown with the
comprehensive list of pictures without thumbnails (no matter the directory) unless there are no thumbnail missing. - thumbnail creation process : form parameters are saved between 2 thumbnail generations thanks to new process - thumbnail creation process : can ask to create all missing thumbnails - thumbnail creation process : default thumbnail width and height are configured in include/config.inc.php - thumbnail creation process : errors due to no write access directories are catched git-svn-id: http://piwigo.org/svn/trunk@695 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+233
-278
@@ -26,104 +26,30 @@
|
||||
// +-----------------------------------------------------------------------+
|
||||
include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
|
||||
//------------------------------------------------------------------- functions
|
||||
// get_subdirs returns an array containing all sub directory names,
|
||||
// excepting : '.', '..' and 'thumbnail'.
|
||||
function get_subdirs( $dir )
|
||||
{
|
||||
$sub_dirs = array();
|
||||
if ( $opendir = opendir( $dir ) )
|
||||
{
|
||||
while ( $file = readdir( $opendir ) )
|
||||
{
|
||||
if ($file != 'thumbnail'
|
||||
and $file != 'pwg_representative'
|
||||
and $file != 'pwg_high'
|
||||
and $file != '.'
|
||||
and $file != '..'
|
||||
and is_dir($dir.'/'.$file))
|
||||
{
|
||||
array_push( $sub_dirs, $file );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $sub_dirs;
|
||||
}
|
||||
|
||||
// get_images_without_thumbnail returns an array with all the picture names
|
||||
// that don't have associated thumbnail in the directory. Each picture name
|
||||
// is associated with the width, heigh and filesize of the picture.
|
||||
function get_images_without_thumbnail( $dir )
|
||||
{
|
||||
$images = array();
|
||||
if ( $opendir = opendir( $dir ) )
|
||||
{
|
||||
while ( $file = readdir( $opendir ) )
|
||||
{
|
||||
$path = $dir.'/'.$file;
|
||||
if ( is_image( $path, true ) )
|
||||
{
|
||||
if ( !TN_exists( $dir, $file ) )
|
||||
{
|
||||
$image_infos = getimagesize( $path );
|
||||
$size = floor( filesize( $path ) / 1024 ). ' KB';
|
||||
array_push( $images, array( 'name' => $file,
|
||||
'width' => $image_infos[0],
|
||||
'height' => $image_infos[1],
|
||||
'size' => $size ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
// phpwg_scandir scans a dir to find pictures without thumbnails. Once found,
|
||||
// creation of the thumbnails (RatioResizeImg). Only the first $_POST['n']
|
||||
// pictures without thumbnails are treated.
|
||||
// scandir returns an array with the generation time of each thumbnail (for
|
||||
// statistics purpose)
|
||||
function phpwg_scandir( $dir, $width, $height )
|
||||
{
|
||||
global $conf;
|
||||
$stats = array();
|
||||
if ( $opendir = opendir( $dir ) )
|
||||
{
|
||||
while ( $file = readdir ( $opendir ) )
|
||||
{
|
||||
$path = $dir.'/'.$file;
|
||||
if ( is_image( $path, true ) )
|
||||
{
|
||||
if ( count( $stats ) < $_POST['n'] and !TN_exists( $dir, $file ) )
|
||||
{
|
||||
$starttime = get_moment();
|
||||
$info = RatioResizeImg( $file, $width, $height, $dir.'/', 'jpg' );
|
||||
$endtime = get_moment();
|
||||
$info['time'] = ( $endtime - $starttime ) * 1000;
|
||||
array_push( $stats, $info );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $stats;
|
||||
}
|
||||
|
||||
// RatioResizeImg creates a new picture (a thumbnail since it is supposed to
|
||||
// be smaller than original picture !) in the sub directory named
|
||||
// "thumbnail".
|
||||
function RatioResizeImg( $filename, $newWidth, $newHeight, $path, $tn_ext )
|
||||
function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext)
|
||||
{
|
||||
global $conf, $lang;
|
||||
// full path to picture
|
||||
$filepath = $path.$filename;
|
||||
global $conf, $lang, $errors;
|
||||
|
||||
$filename = basename($path);
|
||||
$dirname = dirname($path);
|
||||
|
||||
// extension of the picture filename
|
||||
$extension = get_extension( $filepath );
|
||||
switch( $extension )
|
||||
$extension = get_extension($filename);
|
||||
|
||||
if ($extension == 'jpg' or $extension == 'JPG')
|
||||
{
|
||||
case 'jpg': $srcImage = @imagecreatefromjpeg( $filepath ); break;
|
||||
case 'JPG': $srcImage = @imagecreatefromjpeg( $filepath ); break;
|
||||
case 'png': $srcImage = @imagecreatefrompng( $filepath ); break;
|
||||
case 'PNG': $srcImage = @imagecreatefrompng( $filepath ); break;
|
||||
default : unset( $extension ); break;
|
||||
$srcImage = @imagecreatefromjpeg($path);
|
||||
}
|
||||
else if ($extension == 'png' or $extension == 'PNG')
|
||||
{
|
||||
$srcImage = @imagecreatefrompng($path);
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($extension);
|
||||
}
|
||||
|
||||
if ( isset( $srcImage ) )
|
||||
@@ -168,31 +94,38 @@ function RatioResizeImg( $filename, $newWidth, $newHeight, $path, $tn_ext )
|
||||
imagecopyresized( $destImage, $srcImage, 0, 0, 0, 0,
|
||||
$destWidth,$destHeight,$srcWidth,$srcHeight );
|
||||
}
|
||||
|
||||
|
||||
if( !is_dir( $path.'thumbnail' ) )
|
||||
|
||||
$tndir = $dirname.'/thumbnail';
|
||||
if (!is_dir($tndir))
|
||||
{
|
||||
umask( 0000 );
|
||||
mkdir( $path.'thumbnail', 0777 );
|
||||
if (!is_writable($dirname))
|
||||
{
|
||||
array_push($errors, '['.$dirname.'] : '.$lang['no_write_access']);
|
||||
return false;
|
||||
}
|
||||
umask(0000);
|
||||
mkdir($tndir, 0777);
|
||||
}
|
||||
$dest_file = $path.'thumbnail/'.$conf['prefix_thumbnail'];
|
||||
$dest_file.= get_filename_wo_extension( $filename );
|
||||
|
||||
$dest_file = $tndir.'/'.$conf['prefix_thumbnail'];
|
||||
$dest_file.= get_filename_wo_extension($filename);
|
||||
$dest_file.= '.'.$tn_ext;
|
||||
|
||||
|
||||
// creation and backup of final picture
|
||||
imagejpeg( $destImage, $dest_file );
|
||||
if (!is_writable($tndir))
|
||||
{
|
||||
array_push($errors, '['.$tndir.'] : '.$lang['no_write_access']);
|
||||
return false;
|
||||
}
|
||||
imagejpeg($destImage, $dest_file);
|
||||
// freeing memory ressources
|
||||
imagedestroy( $srcImage );
|
||||
imagedestroy( $destImage );
|
||||
|
||||
list( $width,$height ) = getimagesize( $filepath );
|
||||
$size = floor( filesize( $filepath ) / 1024 ).' KB';
|
||||
list( $tn_width,$tn_height ) = getimagesize( $dest_file );
|
||||
$tn_size = floor( filesize( $dest_file ) / 1024 ).' KB';
|
||||
$info = array( 'file' => $filename,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'size' => $size,
|
||||
|
||||
list($tn_width, $tn_height) = getimagesize($dest_file);
|
||||
$tn_size = floor(filesize($dest_file) / 1024).' KB';
|
||||
|
||||
$info = array( 'path' => $path,
|
||||
'tn_file' => $dest_file,
|
||||
'tn_width' => $tn_width,
|
||||
'tn_height' => $tn_height,
|
||||
@@ -218,36 +151,17 @@ function RatioResizeImg( $filename, $newWidth, $newHeight, $path, $tn_ext )
|
||||
$errors = array();
|
||||
$pictures = array();
|
||||
$stats = array();
|
||||
|
||||
if ( isset( $_GET['dir'] ) && isset( $_POST['submit'] ))
|
||||
{
|
||||
$pictures = get_images_without_thumbnail( $_GET['dir'] );
|
||||
// checking criteria
|
||||
if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 )
|
||||
{
|
||||
array_push( $errors, $lang['tn_err_width'].' 10' );
|
||||
}
|
||||
if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 )
|
||||
{
|
||||
array_push( $errors, $lang['tn_err_height'].' 10' );
|
||||
}
|
||||
|
||||
// picture miniaturization
|
||||
if ( count( $errors ) == 0 )
|
||||
{
|
||||
$stats = phpwg_scandir( $_GET['dir'], $_POST['width'], $_POST['height'] );
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------- template initialization
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | template initialization |
|
||||
// +-----------------------------------------------------------------------+
|
||||
$template->set_filenames( array('thumbnail'=>'admin/thumbnail.tpl') );
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_THUMBNAIL_TITLE'=>$lang['tn_dirs_title'],
|
||||
'L_UNLINK'=>$lang['tn_dirs_alone'],
|
||||
'L_UNLINK'=>$lang['tn_no_missing'],
|
||||
'L_MISSING_THUMBNAILS'=>$lang['tn_dirs_alone'],
|
||||
'L_RESULTS'=>$lang['tn_results_title'],
|
||||
'L_TN_PICTURE'=>$lang['tn_picture'],
|
||||
'L_PATH'=>$lang['path'],
|
||||
'L_FILESIZE'=>$lang['filesize'],
|
||||
'L_WIDTH'=>$lang['tn_width'],
|
||||
'L_HEIGHT'=>$lang['tn_height'],
|
||||
@@ -273,182 +187,223 @@ $template->assign_vars(array(
|
||||
|
||||
'T_STYLE'=>$user['template']
|
||||
));
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | search pictures without thumbnails |
|
||||
// +-----------------------------------------------------------------------+
|
||||
$wo_thumbnails = array();
|
||||
$thumbnalized = array();
|
||||
|
||||
//----------------------------------------------------- miniaturization results
|
||||
if ( sizeof( $errors ) != 0 )
|
||||
// what is the directory to search in ?
|
||||
$query = '
|
||||
SELECT galleries_url
|
||||
FROM '.SITES_TABLE.'
|
||||
WHERE id = 1
|
||||
;';
|
||||
list($galleries_url) = mysql_fetch_array(pwg_query($query));
|
||||
$basedir = preg_replace('#/*$#', '', $galleries_url);
|
||||
|
||||
$fs = get_fs($basedir);
|
||||
// because isset is one hundred time faster than in_array
|
||||
$fs['thumbnails'] = array_flip($fs['thumbnails']);
|
||||
|
||||
foreach ($fs['elements'] as $path)
|
||||
{
|
||||
$template->assign_block_vars('errors',array());
|
||||
for ( $i = 0; $i < sizeof( $errors ); $i++ )
|
||||
// only pictures need thumbnails
|
||||
if (in_array(get_extension($path), $conf['picture_ext']))
|
||||
{
|
||||
$template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));
|
||||
}
|
||||
}
|
||||
else if (isset($_GET['dir']) and isset($_POST['submit']) and !empty($stats))
|
||||
{
|
||||
$times = array();
|
||||
foreach ($stats as $stat)
|
||||
{
|
||||
array_push( $times, $stat['time'] );
|
||||
}
|
||||
$sum=array_sum( $times );
|
||||
$average = $sum/sizeof($times);
|
||||
sort( $times, SORT_NUMERIC );
|
||||
$max = array_pop($times);
|
||||
$min = array_shift( $times);
|
||||
|
||||
$template->assign_block_vars(
|
||||
'results',
|
||||
array(
|
||||
'TN_NB'=>count( $stats ),
|
||||
'TN_TOTAL'=>number_format( $sum, 2, '.', ' ').' ms',
|
||||
'TN_MAX'=>number_format( $max, 2, '.', ' ').' ms',
|
||||
'TN_MIN'=>number_format( $min, 2, '.', ' ').' ms',
|
||||
'TN_AVERAGE'=>number_format( $average, 2, '.', ' ').' ms'
|
||||
));
|
||||
if (!count($pictures))
|
||||
{
|
||||
$template->assign_block_vars('warning',array());
|
||||
}
|
||||
|
||||
foreach ($stats as $i => $stat)
|
||||
{
|
||||
$class = ($i % 2)? 'row1':'row2';
|
||||
$color='';
|
||||
if ($stat['time'] == $max)
|
||||
$dirname = dirname($path);
|
||||
$filename = basename($path);
|
||||
// searching the element
|
||||
$filename_wo_ext = get_filename_wo_extension($filename);
|
||||
$tn_ext = '';
|
||||
$base_test = $dirname.'/thumbnail/';
|
||||
$base_test.= $conf['prefix_thumbnail'].$filename_wo_ext.'.';
|
||||
foreach ($conf['picture_ext'] as $ext)
|
||||
{
|
||||
$color = 'red';
|
||||
}
|
||||
else if ($stat['time'] == $min)
|
||||
{
|
||||
$color = '#33FF00';
|
||||
if (isset($fs['thumbnails'][$base_test.$ext]))
|
||||
{
|
||||
$tn_ext = $ext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_block_vars(
|
||||
'results.picture',
|
||||
array(
|
||||
'NB_IMG'=>($i+1),
|
||||
'FILE_IMG'=>$stat['file'],
|
||||
'FILESIZE_IMG'=>$stat['size'],
|
||||
'WIDTH_IMG'=>$stat['width'],
|
||||
'HEIGHT_IMG'=>$stat['height'],
|
||||
'TN_FILE_IMG'=>$stat['tn_file'],
|
||||
'TN_FILESIZE_IMG'=>$stat['tn_size'],
|
||||
'TN_WIDTH_IMG'=>$stat['tn_width'],
|
||||
'TN_HEIGHT_IMG'=>$stat['tn_height'],
|
||||
'GEN_TIME'=>number_format( $stat['time'], 2, '.', ' ').' ms',
|
||||
|
||||
'T_COLOR'=>$color,
|
||||
'T_CLASS'=>$class
|
||||
));
|
||||
if (empty($tn_ext))
|
||||
{
|
||||
array_push($wo_thumbnails, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------- miniaturization parameters
|
||||
if (isset($_GET['dir']) and !sizeof($pictures))
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | thumbnails creation |
|
||||
// +-----------------------------------------------------------------------+
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$form_url = PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$_GET['dir'];
|
||||
$gd = !empty( $_POST['gd'] )?$_POST['gd']:2;
|
||||
$width = !empty( $_POST['width'] )?$_POST['width']:128;
|
||||
$height = !empty( $_POST['height'] )?$_POST['height']:96;
|
||||
$errors = array();
|
||||
$times = array();
|
||||
$infos = array();
|
||||
|
||||
// checking criteria
|
||||
if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10)
|
||||
{
|
||||
array_push($errors, $lang['tn_err_width'].' 10');
|
||||
}
|
||||
if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10)
|
||||
{
|
||||
array_push($errors, $lang['tn_err_height'].' 10');
|
||||
}
|
||||
|
||||
// picture miniaturization
|
||||
if (count($errors) == 0)
|
||||
{
|
||||
$num = 1;
|
||||
foreach ($wo_thumbnails as $path)
|
||||
{
|
||||
if (is_numeric($_POST['n']) and $num > $_POST['n'])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$starttime = get_moment();
|
||||
if ($info = RatioResizeImg($path,$_POST['width'],$_POST['height'],'jpg'))
|
||||
{
|
||||
$endtime = get_moment();
|
||||
$info['time'] = ($endtime - $starttime) * 1000;
|
||||
array_push($infos, $info);
|
||||
array_push($times, $info['time']);
|
||||
array_push($thumbnalized, $path);
|
||||
$num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($infos) > 0)
|
||||
{
|
||||
$sum = array_sum($times);
|
||||
$average = $sum / count($times);
|
||||
sort($times, SORT_NUMERIC);
|
||||
$max = array_pop($times);
|
||||
if (count($thumbnalized) == 1)
|
||||
{
|
||||
$min = $max;
|
||||
}
|
||||
else
|
||||
{
|
||||
$min = array_shift($times);
|
||||
}
|
||||
|
||||
$template->assign_block_vars(
|
||||
'results',
|
||||
array(
|
||||
'TN_NB'=>count($infos),
|
||||
'TN_TOTAL'=>number_format($sum, 2, '.', ' ').' ms',
|
||||
'TN_MAX'=>number_format($max, 2, '.', ' ').' ms',
|
||||
'TN_MIN'=>number_format($min, 2, '.', ' ').' ms',
|
||||
'TN_AVERAGE'=>number_format($average, 2, '.', ' ').' ms'
|
||||
));
|
||||
|
||||
foreach ($infos as $i => $info)
|
||||
{
|
||||
if ($info['time'] == $max)
|
||||
{
|
||||
$class = 'worst_gen_time';
|
||||
}
|
||||
else if ($info['time'] == $min)
|
||||
{
|
||||
$class = 'best_gen_time';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = '';
|
||||
}
|
||||
|
||||
$template->assign_block_vars(
|
||||
'results.picture',
|
||||
array(
|
||||
'PATH'=>$info['path'],
|
||||
'TN_FILE_IMG'=>$info['tn_file'],
|
||||
'TN_FILESIZE_IMG'=>$info['tn_size'],
|
||||
'TN_WIDTH_IMG'=>$info['tn_width'],
|
||||
'TN_HEIGHT_IMG'=>$info['tn_height'],
|
||||
'GEN_TIME'=>number_format($info['time'], 2, '.', ' ').' ms',
|
||||
|
||||
'T_CLASS'=>$class
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | errors display |
|
||||
// +-----------------------------------------------------------------------+
|
||||
if (count($errors) != 0)
|
||||
{
|
||||
$template->assign_block_vars('errors',array());
|
||||
foreach ($errors as $error)
|
||||
{
|
||||
$template->assign_block_vars('errors.error',array('ERROR'=>$error));
|
||||
}
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | form & pictures without thumbnails display |
|
||||
// +-----------------------------------------------------------------------+
|
||||
$remainings = array_diff($wo_thumbnails, $thumbnalized);
|
||||
|
||||
if (count($remainings) > 0)
|
||||
{
|
||||
$form_url = PHPWG_ROOT_PATH.'admin.php?page=thumbnail';
|
||||
$gd = !empty($_POST['gd']) ? $_POST['gd'] : 2;
|
||||
$width = !empty($_POST['width']) ? $_POST['width'] : $conf['tn_width'];
|
||||
$height = !empty($_POST['height']) ? $_POST['height'] : $conf['tn_height'];
|
||||
$n = !empty($_POST['n']) ? $_POST['n'] : 5;
|
||||
|
||||
$gdlabel = 'GD'.$gd.'_CHECKED';
|
||||
$nlabel = 'n_'.$n.'_CHECKED';
|
||||
|
||||
$template->assign_block_vars(
|
||||
'params',
|
||||
array(
|
||||
'F_ACTION'=>add_session_id($form_url),
|
||||
$gdlabel=>'checked="checked"',
|
||||
$nlabel=>'checked="checked"',
|
||||
'WIDTH_TN'=>$width,
|
||||
'HEIGHT_TN'=>$height
|
||||
));
|
||||
//---------------------------------------------------------- remaining pictures
|
||||
$pictures = get_images_without_thumbnail( $_GET['dir'] );
|
||||
|
||||
$template->assign_block_vars(
|
||||
'remainings',
|
||||
array('TOTAL_IMG'=>count($pictures)));
|
||||
array('TOTAL_IMG'=>count($remainings)));
|
||||
|
||||
foreach ($pictures as $i => $picture)
|
||||
$num = 1;
|
||||
foreach ($remainings as $path)
|
||||
{
|
||||
$class = ($i % 2)? 'row1':'row2';
|
||||
$class = ($num % 2) ? 'row1' : 'row2';
|
||||
list($width, $height) = getimagesize($path);
|
||||
$size = floor(filesize($path) / 1024).' KB';
|
||||
|
||||
$template->assign_block_vars(
|
||||
'remainings.remaining',
|
||||
array(
|
||||
'NB_IMG'=>($i+1),
|
||||
'FILE_TN'=>$picture['name'],
|
||||
'FILESIZE_IMG'=>$picture['size'],
|
||||
'WIDTH_IMG'=>$picture['width'],
|
||||
'HEIGHT_IMG'=>$picture['height'],
|
||||
|
||||
'NB_IMG'=>($num),
|
||||
'PATH'=>$path,
|
||||
'FILESIZE_IMG'=>$size,
|
||||
'WIDTH_IMG'=>$width,
|
||||
'HEIGHT_IMG'=>$height,
|
||||
|
||||
'T_CLASS'=>$class
|
||||
));
|
||||
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------- directory list
|
||||
else
|
||||
{
|
||||
$wo_thumbnails = array();
|
||||
|
||||
// what is the directory to search in ?
|
||||
$query = '
|
||||
SELECT galleries_url
|
||||
FROM '.SITES_TABLE.'
|
||||
WHERE id = 1
|
||||
;';
|
||||
list($galleries_url) = mysql_fetch_array(pwg_query($query));
|
||||
$basedir = preg_replace('#/*$#', '', $galleries_url);
|
||||
|
||||
$fs = get_fs($basedir);
|
||||
// because isset is one hundred time faster than in_array
|
||||
$fs['thumbnails'] = array_flip($fs['thumbnails']);
|
||||
|
||||
foreach ($fs['elements'] as $path)
|
||||
{
|
||||
// only pictures need thumbnails
|
||||
if (in_array(get_extension($path), $conf['picture_ext']))
|
||||
{
|
||||
$dirname = dirname($path);
|
||||
$filename = basename($path);
|
||||
// searching the element
|
||||
$filename_wo_ext = get_filename_wo_extension($filename);
|
||||
$tn_ext = '';
|
||||
$base_test = $dirname.'/thumbnail/';
|
||||
$base_test.= $conf['prefix_thumbnail'].$filename_wo_ext.'.';
|
||||
foreach ($conf['picture_ext'] as $ext)
|
||||
{
|
||||
if (isset($fs['thumbnails'][$base_test.$ext]))
|
||||
{
|
||||
$tn_ext = $ext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($tn_ext))
|
||||
{
|
||||
if (!isset($wo_thumbnails[$dirname]))
|
||||
{
|
||||
$wo_thumbnails[$dirname] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$wo_thumbnails[$dirname]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($wo_thumbnails) > 0)
|
||||
{
|
||||
$template->assign_block_vars('directory_list', array());
|
||||
foreach ($wo_thumbnails as $directory => $nb_missing)
|
||||
{
|
||||
$url = PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$directory;
|
||||
|
||||
$template->assign_block_vars(
|
||||
'directory_list.directory',
|
||||
array(
|
||||
'DIRECTORY'=>$directory,
|
||||
'URL'=>add_session_id($url),
|
||||
'NB_MISSING'=>$nb_missing));
|
||||
}
|
||||
}
|
||||
$template->assign_block_vars('warning', array());
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | return to admin |
|
||||
// +-----------------------------------------------------------------------+
|
||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail');
|
||||
?>
|
||||
|
||||
@@ -183,10 +183,17 @@ $conf['newcat_default_visible'] = 'true';
|
||||
$conf['newcat_default_status'] = 'public';
|
||||
|
||||
// level_separator : character string used for separating a category level
|
||||
// to the sub level
|
||||
// to the sub level. Suggestions : ' / ', ' » ', ' → ', ' - ',
|
||||
// ' >'
|
||||
$conf['level_separator'] = ' / ';
|
||||
|
||||
// paginate_pages_around : on paginate navigation bar, how many pages
|
||||
// display before and after the current page ?
|
||||
$conf['paginate_pages_around'] = 2;
|
||||
|
||||
// tn_width : default width for thumbnails creation
|
||||
$conf['tn_width'] = 128;
|
||||
|
||||
// tn_height : default height for thumbnails creation
|
||||
$conf['tn_height'] = 96;
|
||||
?>
|
||||
|
||||
@@ -52,6 +52,7 @@ $lang['unlock'] = 'Unlock';
|
||||
$lang['up'] = 'Move up';
|
||||
$lang['down'] = 'Move down';
|
||||
$lang['path'] = 'path';
|
||||
$lang['no_write_access'] = 'no write access';
|
||||
|
||||
// Specific words
|
||||
$lang['phpinfos'] = 'PHP Information';
|
||||
@@ -263,6 +264,7 @@ $lang['tn_params_format_info'] = 'only jpeg file format is supported for thumbna
|
||||
$lang['tn_alone_title'] = 'pictures without thumbnail (jpeg and png only)';
|
||||
$lang['tn_dirs_title'] = 'Directories list';
|
||||
$lang['tn_dirs_alone'] = 'pictures without thumbnail';
|
||||
$lang['tn_no_missing'] = 'No missing thumbnail';
|
||||
|
||||
// Waiting files
|
||||
$lang['waiting_update'] = 'Validated pictures will be displayed only once pictures database updated';
|
||||
|
||||
@@ -53,6 +53,7 @@ $lang['unlock'] = 'D
|
||||
$lang['up'] = 'Monter';
|
||||
$lang['down'] = 'Descendre';
|
||||
$lang['path'] = 'Chemin d\'accès';
|
||||
$lang['no_write_access'] = 'pas d\'accès en écriture';
|
||||
|
||||
// Specific words
|
||||
$lang['phpinfos'] = 'Informations PHP';
|
||||
@@ -269,6 +270,7 @@ $lang['tn_params_format_info'] = 'seul le format jpeg est support
|
||||
$lang['tn_alone_title'] = 'images sans miniatures (format jpg et png uniquement)';
|
||||
$lang['tn_dirs_title'] = 'Liste des répertoires';
|
||||
$lang['tn_dirs_alone'] = 'images sans miniatures';
|
||||
$lang['tn_no_missing'] = 'Aucune miniature ne manque';
|
||||
|
||||
// Waiting files
|
||||
$lang['waiting_update'] = 'Les images validées ne seront visibles qu\'après mise à jour de la base d\'images.';
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
<!-- BEGIN directory_list -->
|
||||
<div class="admin">{L_THUMBNAIL_TITLE}</div>
|
||||
<ul class="menu">
|
||||
<!-- BEGIN directory -->
|
||||
<li>[<a href="{directory_list.directory.URL}">{directory_list.directory.DIRECTORY}</a>] {directory_list.directory.NB_MISSING} {L_MISSING_THUMBNAILS}</li>
|
||||
<!-- END directory -->
|
||||
</ul>
|
||||
<!-- END directory_list -->
|
||||
<!-- BEGIN warning -->
|
||||
<div style="text-align:center;font-weight:bold;margin:10px;"> [ 0 {L_UNLINK} ]</div>
|
||||
<!-- END warning -->
|
||||
|
||||
<!-- BEGIN errors -->
|
||||
<div class="errors">
|
||||
<ul>
|
||||
@@ -24,37 +12,25 @@
|
||||
<div class="admin">{L_RESULTS}</div>
|
||||
<table style="width:100%;">
|
||||
<tr class="throw">
|
||||
<th> </td>
|
||||
<th>{L_TN_PICTURE}</td>
|
||||
<th>{L_FILESIZE}</td>
|
||||
<th>{L_WIDTH}</td>
|
||||
<th>{L_HEIGHT}</td>
|
||||
<th>{L_GENERATED}</th>
|
||||
<th>{L_PATH}</td>
|
||||
<th>{L_THUMBNAIL}</td>
|
||||
<th>{L_GENERATED}</th>
|
||||
<th>{L_FILESIZE}</td>
|
||||
<th>{L_WIDTH}</td>
|
||||
<th>{L_HEIGHT}</td>
|
||||
</tr>
|
||||
<!-- BEGIN picture -->
|
||||
<tr class="{results.picture.T_CLASS}">
|
||||
<td>{results.picture.NB_IMG}</td>
|
||||
<td>{results.picture.FILE_IMG}</td>
|
||||
<td style="text-align:right;">{results.picture.FILESIZE_IMG}</td>
|
||||
<td style="text-align:right;">{results.picture.WIDTH_IMG}</td>
|
||||
<td style="text-align:right;">{results.picture.HEIGHT_IMG}</td>
|
||||
<th>
|
||||
<div style="text-align:right;margin-right:5px;color:{results.picture.T_COLOR};">{results.picture.GEN_TIME}</div>
|
||||
</th>
|
||||
<td>{results.picture.PATH}</td>
|
||||
<td><img src="{results.picture.TN_FILE_IMG}" /></td>
|
||||
<td style="text-align:right;" class="{results.picture.T_CLASS}">{results.picture.GEN_TIME}</td>
|
||||
<td style="text-align:right;">{results.picture.TN_FILESIZE_IMG}</td>
|
||||
<td style="text-align:right;">{results.picture.TN_WIDTH_IMG}</td>
|
||||
<td style="text-align:right;">{results.picture.TN_HEIGHT_IMG}</td>
|
||||
</tr>
|
||||
<!-- END picture -->
|
||||
<tr>
|
||||
<td colspan="10"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table2">
|
||||
<tr class="throw">
|
||||
<th colspan="2">{L_TN_STATS}</td>
|
||||
@@ -69,11 +45,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{L_TN_MAX}</td>
|
||||
<td style="text-align:right;color:red;">{results.TN_MAX}</td>
|
||||
<td style="text-align:right;" class="worst_gen_time">{results.TN_MAX}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{L_TN_MIN}</td>
|
||||
<td style="text-align:right;color:#33FF00;">{results.TN_MIN}</td>
|
||||
<td style="text-align:right;" class="best_gen_time">{results.TN_MIN}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{L_TN_AVERAGE}</td>
|
||||
@@ -115,12 +91,10 @@
|
||||
<tr>
|
||||
<td><div class="key">{L_CREATE}</div></td>
|
||||
<td class="choice">
|
||||
<select name="n">
|
||||
<option selected>5</option>
|
||||
<option>10</option>
|
||||
<option>20</option>
|
||||
<option>40</option>
|
||||
</select>
|
||||
<input type="radio" name="n" value="5" {params.n_5_CHECKED} /> 5
|
||||
<input type="radio" name="n" value="10" {params.n_10_CHECKED} /> 10
|
||||
<input type="radio" name="n" value="20" {params.n_20_CHECKED} /> 20
|
||||
<input type="radio" name="n" value="all" {params.n_all_CHECKED} /> all
|
||||
</td>
|
||||
<td>{L_CREATE_INFO}</td>
|
||||
</tr>
|
||||
@@ -138,12 +112,16 @@
|
||||
</form>
|
||||
<!-- END params -->
|
||||
|
||||
<!-- BEGIN warning -->
|
||||
<div style="text-align:center;font-weight:bold;margin:10px;"> [ {L_UNLINK} ]</div>
|
||||
<!-- END warning -->
|
||||
|
||||
<!-- BEGIN remainings -->
|
||||
<div class="admin">{remainings.TOTAL_IMG} {L_REMAINING}</div>
|
||||
<table style="width:100%;">
|
||||
<tr class="throw">
|
||||
<th> </td>
|
||||
<th style="width:60%;">{L_TN_PICTURE}</td>
|
||||
<th style="width:60%;">{L_PATH}</td>
|
||||
<th>{L_FILESIZE}</td>
|
||||
<th>{L_WIDTH}</td>
|
||||
<th>{L_HEIGHT}</td>
|
||||
@@ -151,7 +129,7 @@
|
||||
<!-- BEGIN remaining -->
|
||||
<tr class="{remainings.remaining.T_CLASS}">
|
||||
<td>{remainings.remaining.NB_IMG}</td>
|
||||
<td><div style="margin-left:10px;">{remainings.remaining.FILE_TN}</div></td>
|
||||
<td><div style="margin-left:10px;">{remainings.remaining.PATH}</div></td>
|
||||
<td><div style="margin-left:10px;">{remainings.remaining.FILESIZE_IMG}</div></td>
|
||||
<td><div style="margin-left:10px;">{remainings.remaining.WIDTH_IMG}</div></td>
|
||||
<td><div style="margin-left:10px;">{remainings.remaining.HEIGHT_IMG}</div></td>
|
||||
|
||||
@@ -18,8 +18,14 @@ input,select,textarea { color:#FFFFCC;} /* Forms font color */
|
||||
.commentDate { color:#999999;} /* Comments date */
|
||||
.throw { color:#FFFFCC;} /* First line of tables */
|
||||
.bouton, .errors { color:#FFFFFF;} /* Buttons & errors */
|
||||
.update_summary_new { color:#9cb4ce;} /* Update results (admin side only) */
|
||||
.update_summary_del { color:#ffe1e1;} /* Update results (admin side only) */
|
||||
|
||||
/* Update results (admin side only) */
|
||||
.update_summary_new, .best_gen_time
|
||||
{ color:#9cb4ce;}
|
||||
|
||||
/* Update results (admin side only) */
|
||||
.update_summary_del,.worst_gen_time
|
||||
{ color:#ffe1e1;}
|
||||
|
||||
/* ANCHORS */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user