$val) $val2 .=$val.'
'; return $val2; } $pictures = true; //while(list($key, $value) = each($HTTP_GET_VARS)) while(list($key, $value) = each($_GET)) { if (strtolower($key) == "pictures") $pictures = $value == 'no' ? false : true; } if ($pictures) doecho('Cacher les images

'); else doecho('Montrer les images

'); // Variable initialization $galleries = array(); $newgal = ''; $newphoto = ''; $languages = ''; $isnewgallery = true; $template = ''; // Configuration parsing $handle = @fopen($rootpath."galeries.txt", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle, 4096); if (substr($buffer, 0, 3) == '---') { $galleries[sizeof($galleries)] = new gallery(); $newgal = &$galleries[sizeof($galleries) - 1]; $isnewgallery = true; continue; } // Chercher si c'est un commentaire $p = strpos($buffer, '#'); if ($p === 0) continue; // Chercher si on a une valeur $p = strpos($buffer, '='); if ($p > 0) { $name = trim(substr($buffer, 0, $p)); $val = trim(substr($buffer, $p+1)); switch ($name) { case 'REP': $newgal->dir = $val; break; case 'PHOTO': $isnewgallery = false; $newgal->photos[sizeof($newgal->photos)] = new photo(); $newphoto = &$newgal->photos[sizeof($newgal->photos) - 1]; $newphoto->filename = $val; break; case 'LANGUES': if ($languages != '') doecho('Les langues sont définies plus d\'une fois!
'); $languages = explode(',', $val); break; case 'TEMPLATE': if ($template != '') doecho('Le modèle est défini plus d\'une fois!
'); $template = $val; break; case 'DISPO': if ($isnewgallery) { doecho('DISPO concerne les bijoux, pas les galeries!
'); } else { $newphoto->dispo = true; } break; case 'PRIX': if ($isnewgallery) { doecho('PRIX concerne les bijoux, pas les galeries!
'); } else { if (strpos($val, '-') !== 0) { $newphoto->prix = $val; } } break; case 'REF': if ($isnewgallery) { doecho('REF concerne les bijoux, pas les galeries!
'); } else { $newphoto->ref = $val; } break; case 'AFFICHER': if ($val == 'NON' ) { if ($isnewgallery) { $newgal->display = false; } else { $newphoto->display = false; } } else { doecho('AFFICHER doit être suivi de NON!
'); } break; default: if ($isnewgallery) $newgal->name[$name] = $val; else $newphoto->name[$name] = $val; } } } fclose($handle); } // Test if languages are defined if ($languages == '') exit('Il faut mettre une ligne qui définit les langues. Exemple:
LANGUES=F,ES,CA'); else { doecho('Langues définies:
'); foreach ($languages as $lan) { doecho($lan.'
'); } } // Test if all galleries are OK for ($i=0; $ibuggy = false; doecho('

'); // Prepare diagnostic doecho(''); if (!$gal->display) { doecho('La galerie n\'est pas affichée!!!
'); } doecho(''); if ($gal->dir == '') { doecho('Galerie sans répertoire

'); $gal->buggy = true; } doecho('

'.array_to_string($gal->name).'

'); // Test if gallery languages are defined according to LANGUES field (in $languages) foreach ($languages as $lan) { if (!array_key_exists($lan, $gal->name)) { doecho('Langue '.$lan.' pas trouvé

'); $gal->buggy = true; } } // Check directory doecho('Répertoire: '.$rootpath.$gal->dir.'
'); if (!file_exists($rootpath.$gal->dir)) { doecho(' Ce répertoire n\'existe pas!
'); $gal->buggy = true; } doecho('
'); doecho("".sizeof($gal->photos).' PHOTOS
'); doecho("
"); // Test photos if (!$gal->buggy) foreach ($gal->photos as $photo) { doecho('
'); doecho(''.$photo->filename.'
'); if (!$photo->display) doecho('LA PHOTO N\'EST PAS AFFICHÉE!!!
'); if ($photo->ref != '') doecho('Réf: '.$photo->ref.'
'); if ($photo->prix != '') doecho('Prix:'.$photo->prix.'
'); // Check descriptions in all defined languages foreach ($languages as $lan) { if (!array_key_exists($lan, $photo->name)) { doecho('Langue '.$lan.' pas trouvée!
'); $gal->buggy = true; } } // Check descriptions in all languages $photonames = array_keys($photo->name); foreach ($photonames as $name) { doecho($name.' -> '.$photo->name[$name].'
'); $textecheck = explode('/',$photo->name[$name]); if (count($textecheck) < 2) { doecho('Il manque une partie du texte (vérifier /)!
'); $gal->buggy = true; } } // Check thumbnail if (!$gal->buggy) if (file_exists($rootpath.$gal->dir.'/thumbnails/'.$photo->filename)) { if ($pictures) doecho('

'); } else { doecho(' La vignette n\'existe pas!
'); $gal->buggy = true; } // Check image file if (!$gal->buggy) if (file_exists($rootpath.$gal->dir.'/images/'.$photo->filename)) { if ($pictures) doecho('
'); } else { doecho(' Le fichier n\'existe pas!
'); $gal->buggy = true; } } doecho('
'); if ($gal->buggy) { doecho(''); } else { doecho(''); } } if (!$noecho) { ?> '; break; case 'ES': echo ''; break; case 'CA': echo ''; break; default: echo ''; } ?> Laia Calatrava - Joieria contemporània
logo Laia Calatrava

'; foreach ($langs as $l) { if ($l != $lang) echo '' .'  '; else echo '  '; } echo '
'; } ?>


'; } } } ?>
0) { $menuwidth = 70 / $pagecount; foreach ($menus as $menu) { if (array_key_exists($lang, $menu)) { if ($pagefile == $menu['URL']) $menutext = ''.$menu[$lang].''; else $menutext = ''.$menu[$lang].''; // Menu with submenus for galleries if ($menu['URL'] == 'galleries.php') { echo ''; echo '
'; echo '
'; if (strpos($pages['dir'][$lang].$pages[$menu['URL']][$lang]['URL'], '?') === false ) { echo ''.$menutext.' >>'; echo '
'; $counter = 0; foreach ($galleries as $gal) { if (!$gal->buggy && count($gal->photos)>0 && $gal->display) echo ''.$gal->name[$lang].'
'; $counter++; } echo '
'; echo '
'; echo '
'; } else // Normal menu (not Galleries) echo '
'.$menutext.''; echo '
' .'' .' ' .' ' .' ' .' ' .' ' .' ' .' ' .' ' .'
'.$imgTag.'
'; } ?>
photos as $photo) { if ($photo->display) echo borderImgTag('').'
'; $counter++; } ?>
name[$lang], MB_CASE_LOWER, "utf-8");?>
photos)) { if ($galleries[$gallery]->photos[$firstVisiblePhoto]->display) break; $firstVisiblePhoto++; } } echo borderImgTag('
'); ?>
photos as $photo) { $textes = explode('/',$photo->name[$lang]); for ($i=2; $i".$textes[0].''; echo "".$textes[1].''; $counter++; } ?> photos as $photo) { $s = ''; echo ""; if ($photo->dispo && $photo->prix != '') $s .= ($s != '' ? ' - ' : '') .$photo->prix.'

'; if ($photo->ref != '') $s .= $refText[$lang].' '.$photo->ref.'
'; if ($photo->dispo) $s .= ' '.$orderText[$lang].''.' - '; $s .= ' '.$commentText[$lang].''; echo $s; echo '
'; $counter++; } ?>
' .''; ///////////////////////////////// // Contenu spécifique de la page if ($pagefile != '') { // Ouvrir la page originale (template de la partie en bas à droite) $filename = '_'.$pages[$pagefile][$lang]['URL']; if (!file_exists($filename)) $filename = $rootpath.'pages/_'.$pagefile; $filename = str_replace('.php', $lang.'.php', $filename); $hf = fopen($filename, 'r'); if (!($hf === false)) { $pagecontent = fread ($hf, filesize ($filename)); fclose($hf); // Préparer un fichier temporaire $tempfile = rand(0, 1000000).'.php'; if (file_exists($tempfile)) delete($tempfile); // Remplacer le contenu actif par la traduction $count = 60; while ($count > 0) { $strstart = strpos($pagecontent, '-'.$count.'--'); if ($strstart === false) { $count--; continue; } else { $strend = strpos($pagecontent, '--'.$count.'-'); if (!($strend === false)) $pagecontent = substr($pagecontent, 0, $strstart).$texts[$pagefile][$lang][$count].substr($pagecontent, $strend + 4 + floor(log10($count)), 9999999); $count--; } } $count = 50; while ($count > 0) { $strstart = strpos($pagecontent, $count.'---'); if ($strstart === false) { $count--; continue; } else { $strend = strpos($pagecontent, '---'.$count); if (!($strend === false)) $pagecontent = substr($pagecontent, 0, $strstart).$texts[$pagefile][$lang][$count].substr($pagecontent, $strend + 4 + floor(log10($count)), 9999999); $count--; } } // Save to a temp file and include $hi = fopen($tempfile, 'w'); fwrite($hi, $pagecontent); fclose($hi); include($tempfile); unlink($tempfile); } } echo ''; } // End of Bottom of page ?>