1 | <?php |
---|
2 | /***************************************\ |
---|
3 | | PHP OPTIMISATEUR | |
---|
4 | | Plugin Front2Back Support 1.1.a | |
---|
5 | \***************************************/ |
---|
6 | |
---|
7 | ## Déplace les versions alternatives dans 'thumbnail/verso' |
---|
8 | ## Crée la version alternative hd dans 'pwg_high/verso' |
---|
9 | ## Supprime le suffixe et déplace aussi les fichiers du repertoire source |
---|
10 | |
---|
11 | $F2B_nameverso = $CONF['Plugins']['front2back_support']['NAMEverso']; // Suffixe des versions alternatives |
---|
12 | $F2B_moveverso = $CONF['Plugins']['front2back_support']['MOVEverso']; // Déplacer les images originales dans un sous dosssier 'verso' |
---|
13 | |
---|
14 | if (strpos($FileName, $F2B_nameverso) !== false) { |
---|
15 | $FileNameClean = str_replace($F2B_nameverso, '', $FileName); |
---|
16 | |
---|
17 | // Image normale |
---|
18 | if (!file_exists($FileFolder.'thumbnail/verso')) { |
---|
19 | mkdir($FileFolder.'thumbnail/verso'); |
---|
20 | } |
---|
21 | exec('include\nconvert.exe -q '.$CONF['Qnormal'].' -out jpeg -o "'.$FileFolder.'thumbnail/verso/'.$FileNameClean.'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"'); |
---|
22 | |
---|
23 | // Image hd |
---|
24 | if ($CONF['DIRhighORNOT']) { |
---|
25 | if (!file_exists($FileFolder.'pwg_high/verso')) { |
---|
26 | mkdir($FileFolder.'pwg_high/verso'); |
---|
27 | } |
---|
28 | if ($CONF['DIMhdORNOT']) { |
---|
29 | exec('include\nconvert.exe -q '.$CONF['Qhd'].' -out jpeg -o "'.$FileFolder.'pwg_high/verso/'.$FileNameClean.'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"'); |
---|
30 | } else if (!in_array($FileExt, $CONF['JPGexts'])) { |
---|
31 | exec('include\nconvert.exe -q '.$CONF['Qhd'].' -out jpeg -o "'.$FileFolder.'pwg_high/'.$FileNameClean.'.jpg" "'.$FilesSource[$i].'"'); |
---|
32 | } else { |
---|
33 | copy($FilesSource[$i], $FileFolder.'pwg_high/verso/'.$FileNameClean.'.jpg'); |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | // Déplacement de l'image originale |
---|
38 | if ($F2B_moveverso) { |
---|
39 | $FileFolderSource = str_replace($CONF['DIRsortie'], $CONF['DIRsource'], $FileFolder); |
---|
40 | if (!file_exists($FileFolderSource.'verso')) { |
---|
41 | mkdir($FileFolderSource.'verso', 0777, true); |
---|
42 | } |
---|
43 | rename($FileFolderSource.$FileName.'.'.$FileExt, $FileFolderSource.'verso/'.$FileNameClean.'.'.$FileExt); |
---|
44 | } |
---|
45 | |
---|
46 | // Suppression de la miniature si déjà crée (par un autre plugin) |
---|
47 | if (file_exists($FileFolder.'thumbnail/'.$CONF['prefixe_mini'].$FileName.'.jpg')) { |
---|
48 | unlink($FileFolder.'thumbnail/'.$CONF['prefixe_mini'].$FileName.'.jpg'); |
---|
49 | } |
---|
50 | |
---|
51 | $BlockNormal['front2back_support'] = true; |
---|
52 | $BlockThumbnail['front2back_support'] = true; |
---|
53 | $BlockHigh['front2back_support'] = true; |
---|
54 | } |
---|
55 | ?> |
---|