Luxbum.net - Script de galerie photo

Changeset 189

Show
Ignore:
Timestamp:
05/10/07 00:37:30 (2 years ago)
Author:
nicolas
Message:

add flv support. missing fews things.
add a light2 color scheme for the luxbum theme.
fix bug of navigator cache
lot's of corrections/ameliorations in api / frontend

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/.htaccess.rewrite

    r185 r189  
    11RewriteEngine on 
    22 
    3 RewriteRule ^(image|album|folder|meta|photo|comments|slide\-show|private)/(.*)$ /index.php?/$1/$2 
     3RewriteRule ^(image|album|folder|meta|photo|comments|slide\-show|private|file)/(.*)$ /index.php?/$1/$2 
    44 
    55 
  • trunk/api/inc/files.php

    r163 r189  
    11<?php 
    22 
    3   /** 
    4    * @package inc 
    5    */ 
     3/** 
     4 * @package inc 
     5 */ 
    66class files { 
    7     
     7     
    88   /** 
    99    * Ajoute un slash final si il n'y en a pas 
     
    4646 
    4747         return $res; 
    48       }  
     48      } 
    4949      else { 
    5050         return false; 
     
    6262         } 
    6363         return false; 
    64       }  
     64      } 
    6565      else if (is_dir ($file)) { 
    6666         return (is_writable (dirname ($file)));// && count (files::scandir ($file)) <= 2); 
     
    7676 
    7777   /** 
    78     * Suppression récursive d'un répertoire (rm -rf) 
     78    * Suppression rᅵcursive d'un rᅵpertoire (rm -rf 
    7979    */ 
    8080   function delTree ($dir)  { 
     
    131131            $name = $tab[count($tab) - 1]; 
    132132            $return = @mkdir ($name, 0777) && @rename ($name, $path); 
    133          }  
     133         } 
    134134         else { 
    135135            $return = @mkdir ($path, 0777); 
     
    151151      return true; 
    152152   } 
    153     
    154    /** 
    155     *  
     153     
     154   /** 
     155    * 
    156156    */ 
    157157   function isPhotoFile ($dir, $file) { 
    158       return $file[0] != '.'  
     158      return $file[0] != '.' 
    159159         && !is_dir (luxbum::getImage ($dir, $file) ) 
    160160         && eregi ('^.*(' . ALLOWED_FORMAT . ')$', $file); 
    161161   } 
    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    * 
    165174    */ 
    166175   function getExtension($f) { 
    167176      $f = explode('.',basename($f)); 
    168                  
    169       if (count($f) <= 1) {  
    170          return '';  
    171       } 
    172                  
     177 
     178      if (count($f) <= 1) { 
     179         return ''; 
     180      } 
     181 
    173182      return strtolower($f[count($f)-1]); 
    174183   } 
    175          
    176    /** 
    177     *  
     184 
     185   /** 
     186    * 
    178187    */ 
    179188   function getMimeType($file) { 
     
    187196   function getMimeTypeFromExtention($ext) { 
    188197      $types = files::mimeTypes(); 
    189                  
     198 
    190199      if (isset($types[$ext])) { 
    191200         return $types[$ext]; 
    192       }  
     201      } 
    193202      else { 
    194203         return 'text/plain'; 
    195204      } 
    196205   } 
    197        
    198    /** 
    199     *  
    200     */   
     206 
     207   /** 
     208    * 
     209    */ 
    201210   function mimeTypes() { 
    202211      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' 
    270280         ); 
    271281   } 
    272  
     282
    273283 
    274284 
  • trunk/api/inc/imagetoolkit.imagemagick.php

    r166 r189  
    1313      $this->imageDest = $img_dest; 
    1414       
    15       // Créer la vignette
     15      // Create the thumb
    1616      if ($this->canResize ()) { 
    1717 
  • trunk/api/inc/imagetoolkit.php

    r166 r189  
    1111 
    1212   /**-----------------------------------------------------------------------**/ 
    13    /** Fonctions de créations d'images */ 
     13   /** Image generation functions */ 
    1414   /**-----------------------------------------------------------------------**/ 
    1515 
     
    2525 
    2626   /** 
    27     * Constructeur par défaut 
     27    * Constructeur par dᅵfaut 
    2828    * @param String $image Chemin complet vers l'image 
    2929    */ 
     
    3434 
    3535   /** 
    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. 
    3838    */ 
    3939   function getImageDestWidth () { 
     
    4242 
    4343   /** 
    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. 
    4646    */ 
    4747   function getImageDestHeight () { 
     
    158158   function canResize () { 
    159159 
    160       // La vignette existe
     160      // the thumb exists
    161161      if (!file_exists ($this->imageDest)) { 
    162162         return true; 
    163163      } 
    164164 
    165       // L'original a été modifié
     165      // The original has changed
    166166      if (filemtime($this->imageDest) > filemtime ($this->image)) { 
    167167         return true; 
  • trunk/api/inc/sortablerecordset.php

    r179 r189  
    11<?php 
    22 
    3   /** 
    4    * @package inc 
    5    */ 
    6  
     3/** 
     4 * @package inc 
     5 */ 
    76class SortableRecordset extends Recordset2 { 
    87 
     
    1817      $this->sortType = $sortType; 
    1918   } 
    20     
     19     
    2120   /** 
    2221    * Retourne le type de tri de l'index 
     
    2625      return $this->sortType; 
    2726   } 
    28     
     27     
    2928   /** 
    3029    * Affecte le sens du tri (asc / desc) 
     
    3433      $this->sortOrder = $sortOrder; 
    3534   } 
    36     
     35     
    3736   /** 
    3837    * Retourne le sens du tri 
     
    6160      $realkey = null; 
    6261      $i = 0; 
    63            
     62 
    6463      //echo "sortType:$sortType - $sortOrder - "; 
    6564      foreach ($galleryList as $gallery) { 
     
    6968      } 
    7069      //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 
    7372      uksort ($newImageArray, "strnatcasecmp"); 
    7473      uksort ($newImageArrayFailed, "strnatcasecmp"); 
    75        
    76       // Inverse l'ordre si ordre décroissant 
     74 
     75      // Inverse l'ordre si ordre dᅵcroissant 
    7776      if ($sortOrder == 'desc') { 
    7877         $newImageArray = array_reverse ($newImageArray); 
    7978         $newImageArrayFailed = array_reverse ($newImageArrayFailed); 
    8079      } 
    81        
     80 
    8281      // Return a new array with just the values 
    8382      $newImageArray = array_values($newImageArray); 
     
    8887 
    8988   /** 
    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 : 
    9190    * sortType\n 
    9291    * sortOrder\n 
     
    102101         for ($i = 0 ; $i < count ($list) ; $i++) { 
    103102            $img = $list[$i]; 
    104             $name = $img->getImageName (); 
     103            $name = $img->getFile(); 
    105104            fputs($fd, "$name\n"); 
    106105         } 
     
    108107      } 
    109108   } 
    110     
     109     
    111110   /** 
    112111    * Charge l'ordre des photos 
     
    128127      } 
    129128   } 
    130  
     129
    131130 
    132131?> 
  • trunk/api/process/luxbum.php

    r164 r189  
    6767 
    6868   /** 
    69     * Retourne le chemin complet des prévisualisation du dossier $dir de photos 
     69    * Retourne le chemin complet des prᅵvisualisation du dossier $dir de photos 
    7070    * With a trailing slash 
    7171    */ 
     
    113113      return luxbum::getFsPath ($dir) . $img; 
    114114   } 
     115    
     116   /** 
     117    * Return the full file path 
     118    */ 
     119   function getFilePath($dir, $img) { 
     120      return luxbum::getFsPath ($dir) . $img; 
     121   } 
    115122 
    116123   /** 
     
    122129 
    123130   /** 
    124     * Retourne le chemin de l'image prévisualisation $img du dossier $dir d'images 
     131    * Retourne le chemin de l'image prᅵvisualisation $img du dossier $dir d'images 
    125132    */ 
    126133   function getPreviewImage ($dir, $img, $w, $h) { 
  • trunk/api/process/luxbumgallery.php

    r181 r189  
    1818   var $name, $dir; 
    1919   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    
    2229   var $sortPosition = ''; 
    2330   var $private = false; 
     
    3138   /**-----------------------------------------------------------------------**/ 
    3239   /** 
    33     * Constructeur par dᅵfaut 
     40    * Default constructor 
    3441    * @param String $dir Dossier de la galerie 
    3542    */ 
     
    3744      parent::Recordset2(); 
    3845      $this->preview = $preview; 
    39       $this->size = 0; 
    40       $this->count = 0;  
    4146 
    4247      $this->dir = $dir; 
     
    6873         while ($current_file = $fd->read ()) { 
    6974            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++;  
    7383            } 
    7484         } 
    7585         $fd->close(); 
    7686      } 
     87      $this->totalSize = $this->flvSize + $this->imageSize; 
     88      $this->totalCount = $this->flvCount + $this->imageCount; 
    7789   } 
    7890 
     
    134146    * @return int Taille en octets des photos de la galerie 
    135147    */ 
    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; 
    138166   } 
    139167 
     
    142170    * @return int Taille affichable des photos de la galerie 
    143171    */ 
    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); 
    146190   } 
    147191 
     
    150194    * @return int Nombre de photos de la galerie 
    151195    */ 
    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; 
    154214   } 
    155215 
     
    240300         reset ($this->arrayList); 
    241301         while (list (,$img) = each ($this->arrayList)) { 
    242             $name = $img->getImageName (); 
     302            $name = $img->getFile(); 
    243303            if (!in_array ($name, $desc)) { 
    244304               fputs ($fd, "$name||\n"); 
     
    256316       
    257317      if ($fd = fopen ($this->dirPath . DESCRIPTION_FILE, 'a')) { 
    258          for ($i = 0 ; $i < $this->getCount () ; $i++) { 
     318         for ($i = 0 ; $i < $this->getTotalCount () ; $i++) { 
    259319            $img = $this->list[$i]; 
    260             $name = $img->getImageName (); 
     320            $name = $img->getFile (); 
    261321            $description = $img->getDescription (); 
    262322            $date = $img->getDate (); 
     
    329389      if ($dir_fd = opendir ($this->dirPath)) { 
    330390         
    331          // Rᅵcupᅵration des descriptions et de l'ordre 
     391         // Fetch all images, their descriptions and their orders 
    332392         $desc = $this->getDescriptions (); 
    333393         $this->_loadSort(); 
     
    335395         // Parcours des photos du dossiers 
    336396         while ($current_file = readdir ($dir_fd)) { 
     397             
     398            // Add an image file 
    337399            if (files::isPhotoFile ($this->dir, $current_file)) { 
    338400               $imageTemp = new luxBumImage ($this->dir, $current_file); 
     
    350412               $this->addToList($imageTemp); 
    351413            } 
     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            } 
    352420         } 
    353421         closedir ($dir_fd); 
     
    370438      $this->reset(); 
    371439      while (!$trouve && list (,$img) = each ($this->arrayList)) { 
    372          $name = $img->getImageName (); 
     440         $name = $img->getFile(); 
    373441         if ($name == $imgName) { 
    374442            $trouve = true; 
     
    389457   /** Fonctions de tri */ 
    390458   /**-----------------------------------------------------------------------**/ 
    391    function getSortRealKey($image, $sortType=null) { 
     459   function getSortRealKey($file, $sortType=null) { 
    392460      if ($sortType == null) { 
    393461         $sortType = $this->sortType; 
     
    396464      switch ($sortType) { 
    397465         case 'manuel': 
    398             $realkey = $image->getSortPosition(); 
     466            $realkey = $file->getSortPosition(); 
    399467            break; 
    400468         case 'date': 
    401             $realkey = $image->getDate(); 
     469            $realkey = $file->getDate(); 
    402470            break; 
    403471         case 'description': 
    404             $realkey = $image->getDescription(); 
     472            $realkey = $file->getDescription(); 
    405473            break; 
    406474         default: 
    407             $realkey = $image->getImageName(); 
     475            $realkey = $file->getFile(); 
    408476      } 
    409477      $realkey = trim($realkey); 
    410478      if ($realkey == null || $realkey == '') { 
    411          $realkey = $image->getImageName(); 
     479         $realkey = $file->getFile(); 
    412480      } 
    413481      else { 
     
    415483         // il y aurait des clᅵs identiques !!!  
    416484         // (ce qui arrive souvent, mᅵme date|description, ordre non dᅵfini) 
    417          $realkey .= '_'.$image->getImageName(); 
     485         $realkey .= '_'.$file->getFile(); 
    418486      } 
    419487      return $realkey; 
     
    438506 
    439507      // On est dans une sous galerie sans images 
    440       if ($this->getCount() == 0) { 
     508      if ($this->getTotalCount() == 0) { 
    441509         $this->preview = ''; 
     510      } 
     511       
     512      if ($this->getImageCount() == 0 && $this->getFlvCount() > 0) { 
     513          
    442514      } 
    443515 
  • trunk/api/process/luxbumimage.php

    r166 r189  
    11<?php 
    22 
    3  
    4  
    5 //============================================================================== 
    6 // Classe luxBumImage : Fonctions pour les générations de miniatures 
    7 //============================================================================== 
    83 
    94/** 
    105 * @package process 
    116 */ 
    12 class luxBumImage 
     7class luxBumImage extends CommonFile 
    138{ 
    14    var $dir; 
    15    var $img; 
    169   var $thumbDir; 
    1710   var $previewDir; 
    1811 
    19  
    20    var $description = NULL; 
    21    var $date = NULL; 
    22  
    2312   var $thumbToolkit = NULL; 
    2413   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 
    3320    * @param String $dir le nom de la galerie 
    3421    * @param String $img le nom de l'image 
    3522    */ 
    36    function luxBumImage ($dir, $img) { 
     23   function luxBumImage($dir, $file) { 
    3724      $this->dir = $dir; 
    3825      $list = split('/', $dir); 
    3926      $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); 
    4432      $this->setAllDescription ('', ''); 
    4533   } 
     
    5442 
    5543   /** 
    56     * Retourne le nom de l'image 
    57     * @return String Nom de l'image 
    58     */ 
    59    function getImageName () { 
    60       return $this->img; 
    61    } 
    62  
    63    /** 
    6444    * Retourne le chemin complet de l'image 
    6545    * @return String Chemin complet de l'image 
    6646    */ 
    6747   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 = '&nbsp;'; 
    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</