Subversion Repositories eFlore/Applications.cel

Rev

Rev 605 | Rev 632 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 605 Rev 621
Line 17... Line 17...
17
		
17
		
Line 18... Line 18...
18
	}
18
	}
19
	
19
	
20
	public function recreerMiniaturesRecursivement() {
20
	public function recreerMiniaturesRecursivement() {
Line 21... Line 21...
21
		$this->itererRecursivement($this->config['cel_db']['chemin_images']);
21
		$this->itererRecursivement($this->config['cel_db']['chemin_images']);
Line 22... Line 22...
22
	} 
22
	}
23
	
23
	
Line 180... Line 180...
180
		);
180
		);
Line 181... Line 181...
181
 
181
 
182
		return $image_redimensionnee;
182
		return $image_redimensionnee;
Line -... Line 183...
-
 
183
	}
-
 
184
	
-
 
185
	
-
 
186
	/*public function extractionSelonDate() {
-
 
187
 
-
 
188
		$DB=$this->connectDB($this->config,'cel_db');
-
 
189
		
-
 
190
		$requete_selection_diff = 'SELECT * FROM cel_images WHERE ci_meta_date_ajout >= "2011-02-23"';
-
 
191
		
-
 
192
		$diff_image =& $DB->query($query_ordre);
-
 
193
		
-
 
194
		if (PEAR::isError($diff_imag))
-
 
195
		{
-
 
196
			$erreur = 'ERROR' ;
-
 
197
	        die($diff_image->getMessage());
-
 
198
	    }
-
 
199
		
-
 
200
		while ($row =& $diff_image->fetchrow(DB_FETCHMODE_ASSOC)) {
-
 
201
			
-
 
202
			$id = $row['ci_id_image'];
-
 
203
			
-
 
204
			$dossier = $this->obtenirDossierPourFormat($id,'L');
-
 
205
			$nom_fichier = $this->convertirIdBddVersNomFichier($id, 'L');
-
 
206
			
-
 
207
			$chemin_complet = $dossier.'/'.$nom_fichier;
-
 
208
			
-
 
209
			
-
 
210
			
-
 
211
			$chemin_stockage_fichier = '/home/telabotap/www/sites/eflore/projets/cel_sauvegarde/'.str_replace(' ','_',$row['ci_nom_original']);
-
 
212
			copy($chemin_complet,$chemin_stockage_fichier);
-
 
213
			
-
 
214
		}
183
	}
215
	}*/
Line 184... Line 216...
184
	
216
	
185
	public function stockerFichierUploadeEtCreerMiniatures($fichier, $id) {
217
	public function stockerFichierEtCreerMiniatures($fichier, $id) {
Line 186... Line 218...
186
		
218
		
Line 187... Line 219...
187
		$chemin_base_fichier = $this->creerSiNecessaireEtRenvoyerCheminStockageFichierPourIdEtFormat($id, 'O');	
219
		$chemin_base_fichier = $this->creerSiNecessaireEtRenvoyerCheminStockageFichierPourIdEtFormat($id, 'O');	
Line 188... Line 220...
188
		$nom_fichier = $this->convertirIdBddVersNomFichier($id, 'O');
220
		$nom_fichier = $this->convertirIdBddVersNomFichier($id, 'O');
189
	
221
	
Line 190... Line 222...
190
		$chemin_fichier = $chemin_base_fichier.'/'.$nom_fichier;
222
		$chemin_fichier = $chemin_base_fichier.'/'.$nom_fichier;
Line 408... Line 440...
408
	public function detruireImageEnMemoire($image) {		
440
	public function detruireImageEnMemoire($image) {		
409
		imagedestroy($image);
441
		imagedestroy($image);
410
	}
442
	}
Line 411... Line 443...
411
	
443
	
-
 
444
	public function detruireImageSurDisque($id) {
412
	public function detruireImageSurDisque($id) {
445
		
Line 413... Line 446...
413
		$formats = $this->getFormats();
446
		$formats = $this->getFormats();
414
		
447
		
Line -... Line 448...
-
 
448
		// on detruit aussi l'image originale
-
 
449
		$formats[] = 'O';
415
		// on detruit aussi l'image originale
450
		
416
		$formats[] = 'O';
451
		$destruction_formats_fichier = false;
-
 
452
		
417
		
453
		// destructions de chacuns des formats définis
418
		// destructions de chacuns des formats définis
454
		foreach($formats as $format) {
-
 
455
			
419
		foreach($formats as $format) {
456
			$dossier_format = $this->obtenirDossierPourFormat($id, $format);
-
 
457
			$nom_fichier = $this->convertirIdBddVersNomFichier($id, $format);
-
 
458
			
-
 
459
			if(file_exists($dossier_format.'/'.$nom_fichier)) {
-
 
460
				$destruction_formats_fichier = unlink($dossier_format.'/'.$nom_fichier);
420
			$dossier_format = $this->obtenirDossierPourFormat($id, $format);
461
			} else {
-
 
462
				$destruction_formats_fichier = true;
-
 
463
			}
421
			$nom_fichier = $this->convertirIdBddVersNomFichier($id, $format);
464
		}
422
			unlink($dossier_format.'/'.$nom_fichier);
465
		
423
		}
466
		return $destruction_formats_fichier;
424
	}
467
	}