From b7fff52095e774c9e905aafe980fec251ee3eaca Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 20 Jan 2012 05:36:58 +0000 Subject: feature 2548 multisize - comments thumbnails + no more hard coded thumbnail sizes in css - removed admin thumbnail page + language cleanup git-svn-id: http://piwigo.org/svn/trunk@12930 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/thumbnail.php | 140 ---------------------------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 admin/thumbnail.php (limited to 'admin/thumbnail.php') diff --git a/admin/thumbnail.php b/admin/thumbnail.php deleted file mode 100644 index 7ccea0536..000000000 --- a/admin/thumbnail.php +++ /dev/null @@ -1,140 +0,0 @@ - $param) -{ - $param_name = 'upload_form_'.$param_shortname; - $form_values[$param_shortname] = $conf[$param_name]; -} - -// +-----------------------------------------------------------------------+ -// | search pictures without thumbnails | -// +-----------------------------------------------------------------------+ -$wo_thumbnails = array(); - -// what is the directory to search in ? -$query = ' -SELECT galleries_url FROM '.SITES_TABLE.' - WHERE galleries_url NOT LIKE \'http://%\' -;'; -$result = pwg_query($query); -while ( $row=pwg_db_fetch_assoc($result) ) -{ - $basedir = preg_replace('#/*$#', '', $row['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); - - // only files matching the authorized filename pattern can be considered - // as "without thumbnail" - if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename)) - { - continue; - } - - // searching the element - $filename_wo_ext = get_filename_wo_extension($filename); - $tn_ext = ''; - $base_test = $dirname.'/'.$conf['dir_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)) - { - array_push($wo_thumbnails, $path); - } - } - } // next element -} // next site id - -// +-----------------------------------------------------------------------+ -// | form & pictures without thumbnails display | -// +-----------------------------------------------------------------------+ -$template->set_filenames( array('thumbnail'=>'thumbnail.tpl') ); - -if (count($wo_thumbnails) > 0) -{ - foreach ($wo_thumbnails as $path) - { - list($width, $height) = getimagesize($path); - $size = floor(filesize($path) / 1024).' KB'; - - $template->append( - 'remainings', - array( - 'PATH'=>$path, - 'FILESIZE_IMG'=>$size, - 'WIDTH_IMG'=>$width, - 'HEIGHT_IMG'=>$height, - ) - ); - } -} - -foreach (array_keys($upload_form_config) as $field) -{ - if (is_bool($upload_form_config[$field]['default'])) - { - $form_values[$field] = $form_values[$field] ? 'checked="checked"' : ''; - } -} - -$template->assign( - array( - 'F_ACTION' => get_root_url().'admin.php?page=thumbnail', - 'values' => $form_values, - 'TOTAL_NB_REMAINING' => count($wo_thumbnails), - 'U_HELP' => get_root_url().'admin/popuphelp.php?page=thumbnail', - ) -); - -$template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail'); -?> -- cgit v1.2.3