14 define(
'IN_PEEL_ADMIN',
true);
15 include(
"../configuration.inc.php");
29 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_haut.php");
33 if (
vb($_GET[
'suppr']) ==
'thumbs') {
35 }
elseif (
vb($_GET[
'suppr']) ==
'cache') {
38 if (isset($files_deleted)) {
39 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_MSG_FILES_DELETED'], $files_deleted)))->fetch();
42 if (isset($_POST[
'file_shortpath']) && isset($_POST[
'tx_qualite'])) {
43 if (empty($_POST[
'file_shortpath'])) {
46 if (empty($_POST[
'tx_qualite'])) {
48 }
elseif (is_numeric($_POST[
'tx_qualite'])) {
49 if ($_POST[
'tx_qualite'] > 100 || $_POST[
'tx_qualite'] <= 0) {
56 $form_values[
'file_shortpath'] = $_POST[
'file_shortpath'];
64 if (substr($_POST[
'file_shortpath'], -1) ==
'/') {
65 $_POST[
'file_shortpath'] = substr($_POST[
'file_shortpath'], 0, strlen($_POST[
'file_shortpath'])-1);
67 $chemin_final = $dirroot .
'/' . $_POST[
'file_shortpath'];
68 if (is_dir($chemin_final)) {
69 if ($dir_pointer = opendir($chemin_final)) {
70 while (
false !== (
$filename = readdir($dir_pointer))) {
71 if (
$filename !=
'.' &&
$filename !=
'..' && is_file($chemin_final .
'/' .
$filename) && filesize($chemin_final .
'/' . $filename) >=
vn($_POST[
'size_ko']) * 1024) {
72 $array = explode(
'.', $filename);
75 echo filesize($chemin_final .
'/' . $filename) .
' - ' . $chemin_final .
'/' .
$filename;
76 image_resize($chemin_final .
'/' . $filename, $chemin_final .
'/' . $filename,
$GLOBALS[
'site_parameters'][
'image_max_width'],
$GLOBALS[
'site_parameters'][
'image_max_height'],
false,
true,
vn($_POST[
'size_ko']) * 1024, $_POST[
'tx_qualite'], (
vb($_POST[
'enlighten']) ==
'on'?1.6:1.0));
89 closedir($dir_pointer);
91 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_ERR_OPEN_DIRECTORY']))->fetch();
93 }
elseif (is_file($chemin_final) && filesize($chemin_final) >=
vn($_POST[
'size_ko']) * 1024) {
94 image_resize($chemin_final, $chemin_final,
$GLOBALS[
'site_parameters'][
'image_max_width'],
$GLOBALS[
'site_parameters'][
'image_max_height'],
false,
true,
vn($_POST[
'size_ko']) * 1024, $_POST[
'tx_qualite'], 1.0);
97 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_MSG_IMAGES_OPTIMIZED_OK'],
$i)))->fetch();
100 if (!empty($_GET[
'create_thumbs_subfolders']) || !empty($_GET[
'delete_thumbs_not_in_subfolders'])) {
101 $folder_origin =
'/home/back214750/.snapshots/daily.0/localhost/home/algomtl/domains/algomtl.com/public_html/upload/thumbs/';
102 $folder =
$GLOBALS[
'uploaddir'] .
'/thumbs/';
103 if (is_dir($folder_origin)) {
104 $dir_pointer = opendir($folder_origin);
105 if(!empty($dir_pointer)) {
107 while (
false !== (
$filename = readdir($dir_pointer))) {
109 $filename_no_ext = pathinfo($filename, PATHINFO_FILENAME);
111 echo
'<b>' . $filename .
' NOK nom</b><br />';
113 if(!empty($_GET[
'create_thumbs_subfolders'])) {
116 if(!is_file($folder .
'/' . $folder1 .
'/' . (!empty($folder2) ? $folder2 .
'/':
'') . $filename)) {
117 if(!is_dir($folder .
'/' . $folder1)) {
118 mkdir($folder .
'/' . $folder1);
120 if(!empty($folder2) && !is_dir($folder .
'/' . $folder1 .
'/' . $folder2)) {
121 mkdir($folder .
'/' . $folder1 .
'/' . $folder2);
123 if(empty($_GET[
'test'])) {
124 copy($folder_origin .
'/' . $filename, $folder .
'/' . $folder1.
'/' . (!empty($folder2) ? $folder2 .
'/':
'') . $filename);
126 echo
'' . $filename .
' copied<br />';
128 echo
'' . $filename .
' already exists<br />';
131 if(!empty($_GET[
'delete_thumbs_not_in_subfolders'])) {
132 if(empty($_GET[
'test'])) {
133 unlink($folder_origin .
'/' . $filename);
135 echo
'' . $filename .
' deleted<br />';
142 echo
'<meta http-equiv="refresh" content="1; url='.get_current_url(
true).
'">';
151 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
'%s not found', $folder)))->fetch();
153 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
'FINISHED'))->fetch();
157 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_clean_folders.tpl');
158 $tpl->assign(
'action_thumbs',
$GLOBALS[
'administrer_url'] .
'/clean_folders.php?suppr=thumbs');
159 $tpl->assign(
'action_cache',
$GLOBALS[
'administrer_url'] .
'/clean_folders.php?suppr=cache');
160 $tpl->assign(
'action_images',
$GLOBALS[
'administrer_url'] .
'/clean_folders.php');
166 $tpl->assign(
'STR_TEXT_CONFIG',
$GLOBALS[
'STR_TEXT_CONFIG']);
169 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_QUALITY',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_QUALITY']);
170 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_MINIMAL_SIZE',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_MINIMAL_SIZE']);
172 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_EMPTY_CACHE',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_EMPTY_CACHE']);
173 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_EMPTY_CACHE_EXPLAIN',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_EMPTY_CACHE_EXPLAIN']);
174 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_OPTIMIZE_IMAGES_EXPLAIN',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_OPTIMIZE_IMAGES_EXPLAIN']);
175 $tpl->assign(
'STR_ADMIN_IMAGE_SHORT_PATH',
$GLOBALS[
'STR_ADMIN_IMAGE_SHORT_PATH']);
176 $tpl->assign(
'STR_ADMIN_CLEAN_FOLDERS_ENLIGHTEN_IMAGE',
$GLOBALS[
'STR_ADMIN_CLEAN_FOLDERS_ENLIGHTEN_IMAGE']);
177 $tpl->assign(
'STR_ADMIN_CONFIRM_JAVASCRIPT',
$GLOBALS[
'STR_ADMIN_CONFIRM_JAVASCRIPT']);
178 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
183 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_bas.php");
$accepted_formats['form_image']
static strtolower($string)
Returns string with all alphabetic characters converted to lowercase.
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
if(!defined('IN_PEEL')) image_resize($origin_filename_with_path, $new_filename_with_path, $destinationW=null, $destinationH=null, $resize_even_if_smaller=false, $allow_keep_origin_file_if_resize_not_needed=true, $filesize_limit_keep_origin_file=102400, $jpeg_quality=85, $gammacorrect=1.0)
On redimensionne l'image pour qu'elle ne dépasse pas la taille de destination Le ratio largeur / haut...
nettoyer_dir($dir, $older_than_seconds=3, $filename_beginning=null, $create_files_array_found_instead_of_delete=false)
Effacement des fichiers trouvés répondant aux critères en argument, en effaçant récusivement le conte...
if(vb($_GET['suppr'])== 'thumbs') elseif(vb($_GET['suppr'])== 'cache') if(isset($files_deleted)) $show_form
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.