Luxbum.net - Script de galerie photo

Changeset 302

Show
Ignore:
Timestamp:
03/09/08 19:55:22 (9 months ago)
Author:
nicolas
Message:

possibilité de saisir une description sans saisir de date

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/luxbum-0.6/_fonctions_manager/galerie.php

    r301 r302  
    22 
    33error_reporting(E_ALL); 
    4   //------------------------------------------------------------------------------ 
    5   // Includes 
    6   //------------------------------------------------------------------------------ 
     4//------------------------------------------------------------------------------ 
     5// Includes 
     6//------------------------------------------------------------------------------ 
    77include (FONCTIONS_DIR.'luxbum.class.php'); 
    88include (FONCTIONS_DIR.'utils/aff_page.inc.php'); 
     
    8282function jour_select () { 
    8383   $tab = array (); 
     84   $tab['#'] = '--'; 
    8485   for ($i = 1 ; $i <= 31 ; $i++) { 
    8586      $tab[sprintf("%02d",$i)] = $i; 
     
    8889} 
    8990function mois_select () { 
    90    return array ('01' => 'Janvier',  
     91   return array ('#' => '--', 
     92                 '01' => 'Janvier',  
    9193                 '02' => 'Février',  
    9294                 '03' => 'Mars',  
     
    272274      // La date 
    273275      if (isset ($_POST['date'])) { 
     276 
     277         if (isset ($_POST['jour'])) { 
     278            $jour = trim($_POST['jour']); 
     279         } 
     280         if (isset ($_POST['mois'])) { 
     281            $mois = trim($_POST['mois']); 
     282         } 
    274283         $annee = protege_input ($_POST['date']); 
    275          if (isset ($_POST['jour'])) { 
    276             $jour = $_POST['jour']; 
    277          } 
    278          if (isset ($_POST['mois'])) { 
    279             $mois = $_POST['mois']; 
    280          } 
    281          $theDate = $jour.'/'.$mois.'/'.$annee; 
    282  
    283          if ($annee == '') { 
    284             $err_date = 'Année Vide !!'; 
    285          } 
    286          else if (!verif_date ('date', $theDate)) { 
    287             $err_date = 'Mauvais format de date !!'; 
     284 
     285         if ($annee == '' && $jour == '#' && $mois == '#') { 
     286            $theDate = ''; 
     287         } 
     288         else { 
     289            $theDate = $jour.'/'.$mois.'/'.$annee; 
     290 
     291            if (!verif_date ('date', $theDate)) { 
     292               $err_date = 'Mauvais format de date !!'; 
     293            } 
    288294         } 
    289295      } 
     
    295301       
    296302      // On met à jour si tout est OK 
    297       if (/*$err_description == '' &&*/ $err_date == '') { 
     303      if ($err_date == '') { 
    298304         $where = $nuxThumb->getImageIndex ($img); 
    299305         if ($where > -1) { 
     
    324330   // Aucune photo envoyée 
    325331   else if (count($upload->Infos) == 0) { 
    326       $page->MxText ('message', 'Veuillez choisir au moins une photo à envoyer.'); 
     332      $page->MxText ('message', 'Veuillez choisir au moins une photo à envoyer.'); 
    327333   } 
    328334   else {