[198] | 1 | <?php |
---|
| 2 | /***************************************************************************\ |
---|
| 3 | Plugin : magusine |
---|
| 4 | Licence : GPL |
---|
| 5 | Auteurs : Stéphane Noël, Philippe Vanderlinden |
---|
| 6 | Infos : http://www.spip-contrib.net/Le-plugin-Magusine |
---|
| 7 | http://www.magunews.net/spip.php?rubrique645 |
---|
| 8 | |
---|
| 9 | $LastChangedRevision: 12345 $ |
---|
| 10 | $LastChangedBy: bubu $ |
---|
| 11 | $LastChangedDate: 2008-03-21 15:50:47 +0100 (ven, 21 mar 2008) $ |
---|
| 12 | \***************************************************************************/ |
---|
| 13 | |
---|
| 14 | # supprime le bandeau d'une rubrique donnée |
---|
| 15 | function action_supprimer_bandeau_dist() |
---|
| 16 | { |
---|
| 17 | $request_id_check = _request('id_check'); |
---|
| 18 | $request_id_rubrique = _request('id_rubrique'); |
---|
| 19 | $chem = _DIR_IMG."bandeau/"; |
---|
| 20 | $handle = @opendir($chem); |
---|
| 21 | |
---|
| 22 | # Vérifier si $id_rubrique est un entier |
---|
| 23 | if(!is_numeric($request_id_rubrique) ) |
---|
| 24 | { |
---|
| 25 | echo "<p>"._T("arty:erreur_supprimer_bandeau")."</p>"; |
---|
| 26 | exit(); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | if ($request_id_check == $_SESSION["id_check"]) |
---|
| 31 | { |
---|
| 32 | // TODO : mazu - faut-il faire un while, pourquoi pas directement le unlink sur $chem.$fichier? |
---|
| 33 | while($fichier = @readdir($handle) ) |
---|
| 34 | { |
---|
| 35 | if (ereg("^bandeau-$request_id_rubrique\.(jpg|png|gif)$", $fichier) ) |
---|
| 36 | { |
---|
| 37 | if(unlink($chem.$fichier) ) |
---|
| 38 | { |
---|
| 39 | $contexte = array('id_rubrique'=>$request_id_rubrique,'largeurMax'=>350,'hauteurMax'=>250); |
---|
| 40 | echo recuperer_fond('prive/upload_bandeau', $contexte); |
---|
| 41 | exit(); |
---|
| 42 | } |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | echo "<p>"._T("arty:erreur_supprimer_bandeau")." -> ".$chem."bandeau-".$request_id_rubrique."</p>"; |
---|
| 47 | exit(); |
---|
| 48 | } |
---|
| 49 | ?> |
---|