Changeset 189
- Timestamp:
- 05/10/07 00:37:30 (2 years ago)
- Files:
-
- trunk/.htaccess.rewrite (modified) (1 diff)
- trunk/api/inc/files.php (modified) (7 diffs)
- trunk/api/inc/imagetoolkit.imagemagick.php (modified) (1 diff)
- trunk/api/inc/imagetoolkit.php (modified) (5 diffs)
- trunk/api/inc/sortablerecordset.php (modified) (10 diffs)
- trunk/api/process/commonfile.php (added)
- trunk/api/process/luxbum.php (modified) (3 diffs)
- trunk/api/process/luxbumflv.php (added)
- trunk/api/process/luxbumgallery.php (modified) (17 diffs)
- trunk/api/process/luxbumimage.php (modified) (10 diffs)
- trunk/api/process/luxbumindex.php (modified) (3 diffs)
- trunk/api/ui/lib.backend.php (modified) (1 diff)
- trunk/api/ui/lib.frontend.php (modified) (40 diffs)
- trunk/api/ui/link.php (modified) (8 diffs)
- trunk/api/ui/views.php (modified) (17 diffs)
- trunk/api/ui/views_manager/gallery.php (modified) (1 diff)
- trunk/common.php (modified) (2 diffs)
- trunk/index.php (modified) (2 diffs)
- trunk/locales/fr/luxbum.lang (modified) (1 diff)
- trunk/photos/.htaccess (modified) (1 diff)
- trunk/templates/common/flash (added)
- trunk/templates/common/flash/video (added)
- trunk/templates/common/flash/video/FlowPlayer.swf (added)
- trunk/templates/common/flash/video/FlowPlayerBlack.swf (added)
- trunk/templates/common/flash/video/FlowPlayerLP.swf (added)
- trunk/templates/common/flash/video/FlowPlayerLight.swf (added)
- trunk/templates/common/flash/video/FlowPlayerNew.swf (added)
- trunk/templates/common/flash/video/FlowPlayerThermo.swf (added)
- trunk/templates/common/flash/video/FlowPlayerWhite.swf (added)
- trunk/templates/common/flash/video/flowPlayer.js (added)
- trunk/templates/common/flash/video/flv_preview.fla (added)
- trunk/templates/common/flash/video/swfobject.js (added)
- trunk/templates/public/luxbum/conf_luxbum.php (modified) (1 diff)
- trunk/templates/public/luxbum/filefooter.php (added)
- trunk/templates/public/luxbum/fileheader.php (added)
- trunk/templates/public/luxbum/flv.php (added)
- trunk/templates/public/luxbum/index.php (modified) (1 diff)
- trunk/templates/public/luxbum/themes/dark/images/back.png (moved) (moved from trunk/templates/public/luxbum/themes/dark/images/back.gif)
- trunk/templates/public/luxbum/themes/dark/images/forward.png (moved) (moved from trunk/templates/public/luxbum/themes/dark/images/forward.gif)
- trunk/templates/public/luxbum/themes/light/images/back.png (moved) (moved from trunk/templates/public/luxbum/themes/light/images/back.gif)
- trunk/templates/public/luxbum/themes/light/images/folder_video.png (added)
- trunk/templates/public/luxbum/themes/light/images/forward.png (moved) (moved from trunk/templates/public/luxbum/themes/light/images/forward.gif)
- trunk/templates/public/luxbum/themes/light2 (added)
- trunk/templates/public/luxbum/themes/light2/images (added)
- trunk/templates/public/luxbum/themes/light2/images/back.png (added)
- trunk/templates/public/luxbum/themes/light2/images/fleche_light.png (added)
- trunk/templates/public/luxbum/themes/light2/images/folder_image.png (added)
- trunk/templates/public/luxbum/themes/light2/images/folder_locked.png (added)
- trunk/templates/public/luxbum/themes/light2/images/folder_video.png (added)
- trunk/templates/public/luxbum/themes/light2/images/forward.png (added)
- trunk/templates/public/luxbum/themes/light2/images/luxbum_h1_light.jpg (added)
- trunk/templates/public/luxbum/themes/light2/light2.css (added)
- trunk/templates/public/luxbum/themes/linux62/images/back.png (moved) (moved from trunk/templates/public/luxbum/themes/linux62/images/back.gif)
- trunk/templates/public/luxbum/themes/linux62/images/forward.png (moved) (moved from trunk/templates/public/luxbum/themes/linux62/images/forward.gif)
- trunk/templates/public/luxbum/vignette.php (modified) (1 diff)
- trunk/templates/public/photoblog/affichage.php (modified) (1 diff)
- trunk/templates/public/photoblog/conf_photoblog.php (modified) (1 diff)
- trunk/templates/public/photoblog/index.php (modified) (1 diff)
- trunk/templates/public/photoblog/themes/blue/images/folder_image.png (added)
- trunk/templates/public/photoblog/themes/blue/images/folder_locked.png (added)
- trunk/templates/public/photoblog/themes/blue/images/folder_video.png (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/.htaccess.rewrite
r185 r189 1 1 RewriteEngine on 2 2 3 RewriteRule ^(image|album|folder|meta|photo|comments|slide\-show|private )/(.*)$ /index.php?/$1/$23 RewriteRule ^(image|album|folder|meta|photo|comments|slide\-show|private|file)/(.*)$ /index.php?/$1/$2 4 4 5 5 trunk/api/inc/files.php
r163 r189 1 1 <?php 2 2 3 /**4 * @package inc5 */3 /** 4 * @package inc 5 */ 6 6 class files { 7 7 8 8 /** 9 9 * Ajoute un slash final si il n'y en a pas … … 46 46 47 47 return $res; 48 } 48 } 49 49 else { 50 50 return false; … … 62 62 } 63 63 return false; 64 } 64 } 65 65 else if (is_dir ($file)) { 66 66 return (is_writable (dirname ($file)));// && count (files::scandir ($file)) <= 2); … … 76 76 77 77 /** 78 * Suppression r écursive d'un répertoire (rm -rf)78 * Suppression rᅵcursive d'un rᅵpertoire (rm -rf 79 79 */ 80 80 function delTree ($dir) { … … 131 131 $name = $tab[count($tab) - 1]; 132 132 $return = @mkdir ($name, 0777) && @rename ($name, $path); 133 } 133 } 134 134 else { 135 135 $return = @mkdir ($path, 0777); … … 151 151 return true; 152 152 } 153 154 /** 155 * 153 154 /** 155 * 156 156 */ 157 157 function isPhotoFile ($dir, $file) { 158 return $file[0] != '.' 158 return $file[0] != '.' 159 159 && !is_dir (luxbum::getImage ($dir, $file) ) 160 160 && eregi ('^.*(' . ALLOWED_FORMAT . ')$', $file); 161 161 } 162 163 /** 164 * 162 163 /** 164 * 165 */ 166 function isFlvFile ($dir, $file) { 167 return $file[0] != '.' 168 && !is_dir (luxbum::getImage ($dir, $file) ) 169 && eregi ('^.*(flv)$', $file); 170 } 171 172 /** 173 * 165 174 */ 166 175 function getExtension($f) { 167 176 $f = explode('.',basename($f)); 168 169 if (count($f) <= 1) { 170 return ''; 171 } 172 177 178 if (count($f) <= 1) { 179 return ''; 180 } 181 173 182 return strtolower($f[count($f)-1]); 174 183 } 175 176 /** 177 * 184 185 /** 186 * 178 187 */ 179 188 function getMimeType($file) { … … 187 196 function getMimeTypeFromExtention($ext) { 188 197 $types = files::mimeTypes(); 189 198 190 199 if (isset($types[$ext])) { 191 200 return $types[$ext]; 192 } 201 } 193 202 else { 194 203 return 'text/plain'; 195 204 } 196 205 } 197 198 /** 199 * 200 */ 206 207 /** 208 * 209 */ 201 210 function mimeTypes() { 202 211 return array( 203 'odt' => 'application/vnd.oasis.opendocument.text', 204 'odp' => 'application/vnd.oasis.opendocument.presentation', 205 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 206 207 'sxw' => 'application/vnd.sun.xml.writer', 208 'sxc' => 'application/vnd.sun.xml.calc', 209 'sxi' => 'application/vnd.sun.xml.impress', 210 211 'ppt' => 'application/mspowerpoint', 212 'doc' => 'application/msword', 213 'xls' => 'application/msexcel', 214 'rtf' => 'application/rtf', 215 216 'pdf' => 'application/pdf', 217 'ps' => 'application/postscript', 218 'ai' => 'application/postscript', 219 'eps' => 'application/postscript', 220 221 'bin' => 'application/octet-stream', 222 'exe' => 'application/octet-stream', 223 224 'deb' => 'application/x-debian-package', 225 'gz' => 'application/x-gzip', 226 'jar' => 'application/x-java-archive', 227 'rar' => 'application/rar', 228 'rpm' => 'application/x-redhat-package-manager', 229 'tar' => 'application/x-tar', 230 'tgz' => 'application/x-gtar', 231 'zip' => 'application/zip', 232 233 'aiff' => 'audio/x-aiff', 234 'ua' => 'audio/basic', 235 'mp3' => 'audio/mpeg3', 236 'mid' => 'audio/x-midi', 237 'midi' => 'audio/x-midi', 238 'ogg' => 'application/ogg', 239 'wav' => 'audio/x-wav', 240 241 'swf' => 'application/x-shockwave-flash', 242 'swfl' => 'application/x-shockwave-flash', 243 244 'bmp' => 'image/bmp', 245 'gif' => 'image/gif', 246 'jpeg' => 'image/jpeg', 247 'jpg' => 'image/jpeg', 248 'jpe' => 'image/jpeg', 249 'png' => 'image/png', 250 'tiff' => 'image/tiff', 251 'tif' => 'image/tiff', 252 'xbm' => 'image/x-xbitmap', 253 254 'css' => 'text/css', 255 'js' => 'text/javascript', 256 'html' => 'text/html', 257 'htm' => 'text/html', 258 'txt' => 'text/plain', 259 'rtf' => 'text/richtext', 260 'rtx' => 'text/richtext', 261 262 'mpg' => 'video/mpeg', 263 'mpeg' => 'video/mpeg', 264 'mpe' => 'video/mpeg', 265 'viv' => 'video/vnd.vivo', 266 'vivo' => 'video/vnd.vivo', 267 'qt' => 'video/quicktime', 268 'mov' => 'video/quicktime', 269 'avi' => 'video/x-msvideo' 212 'odt' => 'application/vnd.oasis.opendocument.text', 213 'odp' => 'application/vnd.oasis.opendocument.presentation', 214 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 215 216 'sxw' => 'application/vnd.sun.xml.writer', 217 'sxc' => 'application/vnd.sun.xml.calc', 218 'sxi' => 'application/vnd.sun.xml.impress', 219 220 'ppt' => 'application/mspowerpoint', 221 'doc' => 'application/msword', 222 'xls' => 'application/msexcel', 223 'rtf' => 'application/rtf', 224 225 'pdf' => 'application/pdf', 226 'ps' => 'application/postscript', 227 'ai' => 'application/postscript', 228 'eps' => 'application/postscript', 229 230 'bin' => 'application/octet-stream', 231 'exe' => 'application/octet-stream', 232 233 'deb' => 'application/x-debian-package', 234 'gz' => 'application/x-gzip', 235 'jar' => 'application/x-java-archive', 236 'rar' => 'application/rar', 237 'rpm' => 'application/x-redhat-package-manager', 238 'tar' => 'application/x-tar', 239 'tgz' => 'application/x-gtar', 240 'zip' => 'application/zip', 241 242 'aiff' => 'audio/x-aiff', 243 'ua' => 'audio/basic', 244 'mp3' => 'audio/mpeg3', 245 'mid' => 'audio/x-midi', 246 'midi' => 'audio/x-midi', 247 'ogg' => 'application/ogg', 248 'wav' => 'audio/x-wav', 249 250 'swf' => 'application/x-shockwave-flash', 251 'swfl' => 'application/x-shockwave-flash', 252 253 'bmp' => 'image/bmp', 254 'gif' => 'image/gif', 255 'jpeg' => 'image/jpeg', 256 'jpg' => 'image/jpeg', 257 'jpe' => 'image/jpeg', 258 'png' => 'image/png', 259 'tiff' => 'image/tiff', 260 'tif' => 'image/tiff', 261 'xbm' => 'image/x-xbitmap', 262 263 'css' => 'text/css', 264 'js' => 'text/javascript', 265 'html' => 'text/html', 266 'htm' => 'text/html', 267 'txt' => 'text/plain', 268 'rtf' => 'text/richtext', 269 'rtx' => 'text/richtext', 270 271 'mpg' => 'video/mpeg', 272 'mpeg' => 'video/mpeg', 273 'mpe' => 'video/mpeg', 274 'viv' => 'video/vnd.vivo', 275 'vivo' => 'video/vnd.vivo', 276 'qt' => 'video/quicktime', 277 'mov' => 'video/quicktime', 278 'avi' => 'video/x-msvideo', 279 'flv' => 'video/x-flv' 270 280 ); 271 281 } 272 }282 } 273 283 274 284 trunk/api/inc/imagetoolkit.imagemagick.php
r166 r189 13 13 $this->imageDest = $img_dest; 14 14 15 // Cr éer la vignette?15 // Create the thumb ? 16 16 if ($this->canResize ()) { 17 17 trunk/api/inc/imagetoolkit.php
r166 r189 11 11 12 12 /**-----------------------------------------------------------------------**/ 13 /** Fonctions de créations d'images */13 /** Image generation functions */ 14 14 /**-----------------------------------------------------------------------**/ 15 15 … … 25 25 26 26 /** 27 * Constructeur par d éfaut27 * Constructeur par dᅵfaut 28 28 * @param String $image Chemin complet vers l'image 29 29 */ … … 34 34 35 35 /** 36 * Retourne la largeur finale de l'image redimensionn ée.37 * @return int Largeur finale de l'image redimensionn ée.36 * Retourne la largeur finale de l'image redimensionnᅵe. 37 * @return int Largeur finale de l'image redimensionnᅵe. 38 38 */ 39 39 function getImageDestWidth () { … … 42 42 43 43 /** 44 * Retourne la hauteur finale de l'image redimensionn ée.45 * @return int Hauteur finale de l'image redimensionn ée.44 * Retourne la hauteur finale de l'image redimensionnᅵe. 45 * @return int Hauteur finale de l'image redimensionnᅵe. 46 46 */ 47 47 function getImageDestHeight () { … … 158 158 function canResize () { 159 159 160 // La vignette existe?160 // the thumb exists ? 161 161 if (!file_exists ($this->imageDest)) { 162 162 return true; 163 163 } 164 164 165 // L'original a été modifié?165 // The original has changed ? 166 166 if (filemtime($this->imageDest) > filemtime ($this->image)) { 167 167 return true; trunk/api/inc/sortablerecordset.php
r179 r189 1 1 <?php 2 2 3 /** 4 * @package inc 5 */ 6 3 /** 4 * @package inc 5 */ 7 6 class SortableRecordset extends Recordset2 { 8 7 … … 18 17 $this->sortType = $sortType; 19 18 } 20 19 21 20 /** 22 21 * Retourne le type de tri de l'index … … 26 25 return $this->sortType; 27 26 } 28 27 29 28 /** 30 29 * Affecte le sens du tri (asc / desc) … … 34 33 $this->sortOrder = $sortOrder; 35 34 } 36 35 37 36 /** 38 37 * Retourne le sens du tri … … 61 60 $realkey = null; 62 61 $i = 0; 63 62 64 63 //echo "sortType:$sortType - $sortOrder - "; 65 64 foreach ($galleryList as $gallery) { … … 69 68 } 70 69 //print_r ($newImageArray); 71 72 // Now natcase sort the array based on the keys 70 71 // Now natcase sort the array based on the keys 73 72 uksort ($newImageArray, "strnatcasecmp"); 74 73 uksort ($newImageArrayFailed, "strnatcasecmp"); 75 76 // Inverse l'ordre si ordre d écroissant74 75 // Inverse l'ordre si ordre dᅵcroissant 77 76 if ($sortOrder == 'desc') { 78 77 $newImageArray = array_reverse ($newImageArray); 79 78 $newImageArrayFailed = array_reverse ($newImageArrayFailed); 80 79 } 81 80 82 81 // Return a new array with just the values 83 82 $newImageArray = array_values($newImageArray); … … 88 87 89 88 /** 90 * Enregistre les pr éférences de tri dans un fichier de format :89 * Enregistre les prᅵfᅵrences de tri dans un fichier de format : 91 90 * sortType\n 92 91 * sortOrder\n … … 102 101 for ($i = 0 ; $i < count ($list) ; $i++) { 103 102 $img = $list[$i]; 104 $name = $img->get ImageName();103 $name = $img->getFile(); 105 104 fputs($fd, "$name\n"); 106 105 } … … 108 107 } 109 108 } 110 109 111 110 /** 112 111 * Charge l'ordre des photos … … 128 127 } 129 128 } 130 }129 } 131 130 132 131 ?> trunk/api/process/luxbum.php
r164 r189 67 67 68 68 /** 69 * Retourne le chemin complet des pr évisualisation du dossier $dir de photos69 * Retourne le chemin complet des prᅵvisualisation du dossier $dir de photos 70 70 * With a trailing slash 71 71 */ … … 113 113 return luxbum::getFsPath ($dir) . $img; 114 114 } 115 116 /** 117 * Return the full file path 118 */ 119 function getFilePath($dir, $img) { 120 return luxbum::getFsPath ($dir) . $img; 121 } 115 122 116 123 /** … … 122 129 123 130 /** 124 * Retourne le chemin de l'image pr évisualisation $img du dossier $dir d'images131 * Retourne le chemin de l'image prᅵvisualisation $img du dossier $dir d'images 125 132 */ 126 133 function getPreviewImage ($dir, $img, $w, $h) { trunk/api/process/luxbumgallery.php
r181 r189 18 18 var $name, $dir; 19 19 var $preview; 20 var $count; 21 var $size; 20 21 var $flvCount = 0; 22 var $imageCount = 0; 23 var $totalCount = 0; 24 25 var $flvSize = 0; 26 var $imageSize = 0; 27 var $totalSize = 0; 28 22 29 var $sortPosition = ''; 23 30 var $private = false; … … 31 38 /**-----------------------------------------------------------------------**/ 32 39 /** 33 * Constructeur par dᅵfaut40 * Default constructor 34 41 * @param String $dir Dossier de la galerie 35 42 */ … … 37 44 parent::Recordset2(); 38 45 $this->preview = $preview; 39 $this->size = 0;40 $this->count = 0;41 46 42 47 $this->dir = $dir; … … 68 73 while ($current_file = $fd->read ()) { 69 74 if (files::isPhotoFile($this->dir, $current_file)) { 70 $the_file = luxbum::getImage ($this->dir, $current_file); 71 $this->size += filesize ($the_file); 72 $this->count++; 75 $theFile = luxbum::getFilePath($this->dir, $current_file); 76 $this->imageSize += filesize ($theFile); 77 $this->imageCount++; 78 } 79 else if (files::isFlvFile($this->dir, $current_file)) { 80 $theFile = luxbum::getFilePath($this->dir, $current_file); 81 $this->flvSize += filesize ($theFile); 82 $this->flvCount++; 73 83 } 74 84 } 75 85 $fd->close(); 76 86 } 87 $this->totalSize = $this->flvSize + $this->imageSize; 88 $this->totalCount = $this->flvCount + $this->imageCount; 77 89 } 78 90 … … 134 146 * @return int Taille en octets des photos de la galerie 135 147 */ 136 function getSize () { 137 return $this->size; 148 function getImageSize () { 149 return $this->imageSize; 150 } 151 152 /** 153 * Retourne la taille en octets des photos de la galerie 154 * @return int Taille en octets des photos de la galerie 155 */ 156 function getFlvSize () { 157 return $this->flvSize; 158 } 159 160 /** 161 * Retourne la taille en octets des photos de la galerie 162 * @return int Taille en octets des photos de la galerie 163 */ 164 function getTotalSize () { 165 return $this->totalSize; 138 166 } 139 167 … … 142 170 * @return int Taille affichable des photos de la galerie 143 171 */ 144 function getNiceSize () { 145 return luxbum::niceSize ($this->size); 172 function getImageNiceSize () { 173 return luxbum::niceSize ($this->imageSize); 174 } 175 176 /** 177 * Retourne la taille affichable des photos de la galerie 178 * @return int Taille affichable des photos de la galerie 179 */ 180 function getFlvNiceSize () { 181 return luxbum::niceSize ($this->flvSize); 182 } 183 184 /** 185 * Retourne la taille affichable des photos de la galerie 186 * @return int Taille affichable des photos de la galerie 187 */ 188 function getTotalNiceSize () { 189 return luxbum::niceSize ($this->totalSize); 146 190 } 147 191 … … 150 194 * @return int Nombre de photos de la galerie 151 195 */ 152 function getCount () { 153 return $this->count; 196 function getImageCount () { 197 return $this->imageCount; 198 } 199 200 /** 201 * Retourne le nombre de vidéos de la galerie 202 * @return int Nombre de vidéos de la galerie 203 */ 204 function getFlvCount () { 205 return $this->flvCount; 206 } 207 208 /** 209 * Retourne le nombre de vidéos de la galerie 210 * @return int Nombre de vidéos de la galerie 211 */ 212 function getTotalCount () { 213 return $this->totalCount; 154 214 } 155 215 … … 240 300 reset ($this->arrayList); 241 301 while (list (,$img) = each ($this->arrayList)) { 242 $name = $img->get ImageName();302 $name = $img->getFile(); 243 303 if (!in_array ($name, $desc)) { 244 304 fputs ($fd, "$name||\n"); … … 256 316 257 317 if ($fd = fopen ($this->dirPath . DESCRIPTION_FILE, 'a')) { 258 for ($i = 0 ; $i < $this->get Count () ; $i++) {318 for ($i = 0 ; $i < $this->getTotalCount () ; $i++) { 259 319 $img = $this->list[$i]; 260 $name = $img->get ImageName ();320 $name = $img->getFile (); 261 321 $description = $img->getDescription (); 262 322 $date = $img->getDate (); … … 329 389 if ($dir_fd = opendir ($this->dirPath)) { 330 390 331 // Rᅵcupᅵration des descriptions et de l'ordre391 // Fetch all images, their descriptions and their orders 332 392 $desc = $this->getDescriptions (); 333 393 $this->_loadSort(); … … 335 395 // Parcours des photos du dossiers 336 396 while ($current_file = readdir ($dir_fd)) { 397 398 // Add an image file 337 399 if (files::isPhotoFile ($this->dir, $current_file)) { 338 400 $imageTemp = new luxBumImage ($this->dir, $current_file); … … 350 412 $this->addToList($imageTemp); 351 413 } 414 415 // Add a flash video file 416 else if (files::isFlvFile($this->dir, $current_file)) { 417 $object = new LuxbumFlv($this->dir, $current_file); 418 $this->addToList($object); 419 } 352 420 } 353 421 closedir ($dir_fd); … … 370 438 $this->reset(); 371 439 while (!$trouve && list (,$img) = each ($this->arrayList)) { 372 $name = $img->get ImageName();440 $name = $img->getFile(); 373 441 if ($name == $imgName) { 374 442 $trouve = true; … … 389 457 /** Fonctions de tri */ 390 458 /**-----------------------------------------------------------------------**/ 391 function getSortRealKey($ image, $sortType=null) {459 function getSortRealKey($file, $sortType=null) { 392 460 if ($sortType == null) { 393 461 $sortType = $this->sortType; … … 396 464 switch ($sortType) { 397 465 case 'manuel': 398 $realkey = $ image->getSortPosition();466 $realkey = $file->getSortPosition(); 399 467 break; 400 468 case 'date': 401 $realkey = $ image->getDate();469 $realkey = $file->getDate(); 402 470 break; 403 471 case 'description': 404 $realkey = $ image->getDescription();472 $realkey = $file->getDescription(); 405 473 break; 406 474 default: 407 $realkey = $ image->getImageName();475 $realkey = $file->getFile(); 408 476 } 409 477 $realkey = trim($realkey); 410 478 if ($realkey == null || $realkey == '') { 411 $realkey = $ image->getImageName();479 $realkey = $file->getFile(); 412 480 } 413 481 else { … … 415 483 // il y aurait des clᅵs identiques !!! 416 484 // (ce qui arrive souvent, mᅵme date|description, ordre non dᅵfini) 417 $realkey .= '_'.$ image->getImageName();485 $realkey .= '_'.$file->getFile(); 418 486 } 419 487 return $realkey; … … 438 506 439 507 // On est dans une sous galerie sans images 440 if ($this->get Count() == 0) {508 if ($this->getTotalCount() == 0) { 441 509 $this->preview = ''; 510 } 511 512 if ($this->getImageCount() == 0 && $this->getFlvCount() > 0) { 513 442 514 } 443 515 trunk/api/process/luxbumimage.php
r166 r189 1 1 <?php 2 2 3 4 5 //==============================================================================6 // Classe luxBumImage : Fonctions pour les générations de miniatures7 //==============================================================================8 3 9 4 /** 10 5 * @package process 11 6 */ 12 class luxBumImage 7 class luxBumImage extends CommonFile 13 8 { 14 var $dir;15 var $img;16 9 var $thumbDir; 17 10 var $previewDir; 18 11 19 20 var $description = NULL;21 var $date = NULL;22 23 12 var $thumbToolkit = NULL; 24 13 var $previewToolkit = NULL; 25 26 var $sortPosition = ''; 27 28 var $listComments = NULL; 29 30 31 /** 32 * Constructeur par défaut 14 15 var $imageMeta; 16 17 18 /** 19 * Default constructor 33 20 * @param String $dir le nom de la galerie 34 21 * @param String $img le nom de l'image 35 22 */ 36 function luxBumImage ($dir, $img) {23 function luxBumImage($dir, $file) { 37 24 $this->dir = $dir; 38 25 $list = split('/', $dir); 39 26 $this->name = $list[count($list) - 1]; 40 41 $this->img = $img; 42 $this->thumbDir = luxbum::getThumbPath ($this->dir); 43 $this->previewDir = luxbum::getPreviewPath ($this->dir); 27 $this->type = TYPE_IMAGE_FILE; 28 29 $this->file = $file; 30 $this->thumbDir = luxbum::getThumbPath($this->dir); 31 $this->previewDir = luxbum::getPreviewPath($this->dir); 44 32 $this->setAllDescription ('', ''); 45 33 } … … 54 42 55 43 /** 56 * Retourne le nom de l'image57 * @return String Nom de l'image58 */59 function getImageName () {60 return $this->img;61 }62 63 /**64 44 * Retourne le chemin complet de l'image 65 45 * @return String Chemin complet de l'image 66 46 */ 67 47 function getImagePath () { 68 return luxbum::getImage ($this->dir, $this->img); 69 } 70 71 /** 72 * Retourne la description de l'image 73 * @return String Description de l'image 74 */ 75 function getDescription () { 76 return $this->description; 77 } 78 79 /** 80 * Retourne la date de l'image 81 * @return String Date de l'image 82 */ 83 function getDate () { 84 return $this->date; 85 } 86 87 /** 88 * Affecte la description de l'image 89 * @param String $description Description de l'image 90 */ 91 function setDescription ($description) { 92 $this->description = $description; 93 } 94 95 /** 96 * Affecte la date de l'image 97 * @param String $date Date de l'image 98 */ 99 function setDate ($date) { 100 $this->date = $date; 101 } 102 103 /** 104 * Affecte la date et la description de l'image 105 * @param String $description Description de l'image 106 * @param String $date Date de l'image 107 */ 108 function setAllDescription ($description, $date) { 109 $this->setDescription ($description); 110 $this->setDate ($date); 111 } 112 113 /** 114 * Retourne true/false si la date et la description sont vide 115 * @return Boolean true/false si la date et la description sont vide 116 */ 117 function issetDescription () { 118 if ($this->description == '' && $this->date == '') { 119 return false; 120 } 121 return true; 122 } 123 124 /** 125 * Retourne la taille en octets de l'image 126 * @return int Taille en octets de l'image 127 */ 128 function getSize () { 129 return filesize ($this->getImagePath ()); 130 } 131 132 /** 133 * Retourne la date et la description sous un format affichable 134 * @return String Date et descrition sous format affichable 135 */ 136 function getDateDesc () { 137 $dateDesc = ' '; 138 139 // Date 140 if ($this -> getDate() != '') { 141 list ($jour, $mois, $annee) = explode ('/', $this -> getDate()); 142 setlocale (LC_TIME, 'fr_FR'); 143 $timeStamp = mktime (0, 0, 0, $mois, $jour, $annee); 144 $dateDesc = 'Le '.strftime (DATE_FORMAT, $timeStamp); 145 146 // date + description 147 if ($this -> getDescription () != '') { 148 $dateDesc .= ' - '. ucfirst ($this -> getDescription ()); 149 } 150 } 151 152 // Que description 153 else if ($this -> getDescription () != '') { 154 $dateDesc = ucfirst ($this -> getDescription ()); 155 } 156 return $dateDesc; 157 } 158 48
