Galerie image et pseudo frame

anonimwork Messages postés 14 Date d'inscription mardi 9 août 2005 Statut Membre Dernière intervention 7 juin 2006 - 7 juin 2006 à 14:04
anonimwork Messages postés 14 Date d'inscription mardi 9 août 2005 Statut Membre Dernière intervention 7 juin 2006 - 7 juin 2006 à 14:07
Bonjour, je débute avec un grand D dans le php.
J'ai créé un menu gauche qui fait changer mon contenu sur la droite avec des includes sans trop de problèmes avec l'aide de certains codes mis à disposition sur le web (et j'ai compris certaines choses).
Mon problème arrive quand j'essaie d'intégrer dans ma zone de contenu droite un diapo image (WebJeff photos).
En naviguant dans mon menu gauche on peut voir dans la barre d'adresse ceci: www.mondomaine.com/index.php?rub= xxx et la diapo affiche ceci: www.mondomaine.com/index.php?rep=xxxIxxx sachant que rep est le dossier ou sont mes images.

Voila, je ne sais pas si je suis assez clair ? et si vous pourriez m'aider à faire cohabiter les deux procédés...

Merci d'avance, quand même

Voici le code webjeff:

<?php
//---------------------------------------------------------------------------------------------------
// OPTIONS
//---------------------------------------------------------------------------------------------------

// Barre de navigation en haut de page
$nav_haut="oui"; // ("oui" ou "non")

// Barre de navigation en bas de page
$nav_bas="oui"; // ("oui" ou "non")

// Afficher le nom du fichier image
$aff_filename="oui"; // ("oui" ou "non")

// Afficher le poids du fichier
$aff_filesize="oui"; // ("oui" ou "non")
$size_unit="o"; // ("o" ou "b" pour octets ou bytes)

// Afficher les dimensions de l'image
$aff_dimensions="oui"; // ("oui" ou "non")

// Afficher la date de modification de l'image
$aff_modtime="oui"; // ("oui" ou "non")

// Afficher des liens numerotes vers toutes les images
$aff_links="oui"; // ("oui" ou "non")
$nb_links=5; // interval

// Classer les images par (sort pictures with) :
// Nom de fichiers (filename) : "nom"
// Poids du fichier (file size) : "taille"
// Date de modification (modification date) : "date"
// Type de fichier (type of file, gif, jpg...) : "type"
$ordre="date";

// Inverser le sens de l'ordre
$sens=0; // (1 ou 0, sens normal : 0)

// Langue (Language)
// FRANCAIS
$LANG_start="Début";
$LANG_previous="Précédent";
$LANG_on="sur";
$LANG_next="Suivant >>";
$LANG_end="Fin >";
$LANG_picture="Photo";
$LANG_filename="Nom du fichier";
$LANG_modtime="Date de modification";
$LANG_filesize="Poids";
$LANG_width_height="Largeur-Hauteur";

// ENGLISH
/*
$LANG_start="Start";
$LANG_previous="Previous";
$LANG_on="on";
$LANG_next="Next";
$LANG_end="End";
$LANG_picture="Picture";
$LANG_filename="File name";
$LANG_modtime="Modification time";
$LANG_filesize="File size";
$LANG_width_height="Width-Height";
*/

//---------------------------------------------------------------------------------------------------
// FIN DES OPTIONS
//---------------------------------------------------------------------------------------------------

function mimetype($fichier)
{
if(eregi("\.gif$",$fichier)){$nom_type="GIF";}
else if(eregi("\.jpg$",$fichier)){$nom_type="JPG";}
else if(eregi("\.png$",$fichier)){$nom_type="PNG";}
else if(eregi("\.bmp$",$fichier)){$nom_type="BMP";}
return $nom_type;
}
??><?php
// LISTING DE TOUTES LES IMAGES
$tableau=""; $i=0;
$handle=@opendir("$rep");
while ($fichier = @readdir($handle))
{
$extension=substr($fichier,-3);
if($fichier!="." && $fichier!=".." && (eregi("gif",$extension)||eregi("jpg",$extension)))
{
if($ordre=="nom") {$listing[$fichier]=$i;}
else if($ordre=="taille") {$listing[$fichier]=filesize("$rep/$fichier");}
else if($ordre=="date") {$listing[$fichier]=filemtime("$rep/$fichier");}
else if($ordre=="type") {$listing[$fichier]=mimetype("$rep/$fichier");}
else {$listing[$fichier]=mimetype("$rep/$fichier","image");}
}
$i++;
}
@closedir($handle);

if(!is_array($listing))
{
echo "

\n";
echo "Exemple d'appel de ce script :
\n";
echo "index.php?rep=toto/images
\n";
}
else
{
// TRI DE LA LISTE DES FICHIER
if($ordre=="nom") {if($sens==0){ksort($listing);}else{krsort($listing);}}
else if($ordre=="date") {if($sens==0){arsort($listing);}else{asort($listing);}}
else if($ordre=="taille"||$ordre=="type") {if($sens==0){asort($listing);}else{arsort($listing);}}
else {if($sens==0){ksort($listing);}else{krsort($listing);}}

// INDICES DES IMAGES DEBUT, PRECEDENTE, SUIVANTE ET FIN
$i=0;
while (list($cle,$val) = each($listing))
{
if($image=="") {$image=$cle;}
if($i==0) {$debut=$cle;}
if($savesuiv==1) {$suivant=$cle; $savesuiv=0;}
if($image==$cle)
{
$savesuiv=1;
$stopprev=1;
$numphoto=$i+1;
}
if($stopprev=="") {$precedent=$cle;}
$fin=$cle;

echo "cle=$cle , val=$val , debut=$debut , precedent=$precedent , suivant=$suivant , fin=$fin
";

if($aff_links=="oui" && ($i+1)%$nb_links==0)
{
if($savesuiv==1) {$liens.="";}
$liens.="(";
if($savesuiv!=1) {$liens.="[\"index.php?rep=$rep&image=$cle\" ";}
$liens.=$i+1;
if($savesuiv!=1) {$liens.="]";}
$liens.=") ";
if($savesuiv==1) {$liens.="";}
}

$i++;
}

// BARRE DE NAVIGATION
$tableau.="\n\";
$tableau.=\"----
";
// Liens début et précédent
if($precedent!="")
{
$tableau.="< $LANG_start|";
$tableau.="<< $LANG_previous\n";
}
$tableau.=", $LANG_picture $numphoto $LANG_on $i, \";
$tableau.=\"";
// Liens suivant et fin
if($suivant!="")
{
$tableau.="$LANG_next|";
$tableau.="$LANG_end";
}
$tableau.=", \n\";
$tableau.="
";

// AFFICHAGE
if(file_exists("$rep/$image"))
{
// Navigation du haut
if($nav_haut=="oui") {echo "$tableau\n";}

// Image
$taillefic = GetImageSize("$rep/$image");
echo "\n";

// Navigation du bas
if($nav_bas=="oui") {echo "$tableau\n";}

// Liens sur toutes les images
if($aff_links=="oui") {echo "
$liens

\n";}

// Informations sur l'image
echo "\n";
if($aff_filename=="oui")
{
echo "$LANG_filename : $image
\n";
}
if($aff_modtime == "oui")
{
echo "$LANG_modtime : ".date("d/m/Y H:i",filemtime("$rep/$image"))."
\n";
}
if($aff_filesize == "oui")
{
$taille=filesize("$rep/$image");
if ($taille >1073741824) {$taille round($taille / 1073741824 * 100) / 100 . " G".$size_unit;}
elseif ($taille >1048576) {$taille round($taille / 1048576 * 100) / 100 . " M".$size_unit;}
elseif ($taille >1024) {$taille round($taille / 1024 * 100) / 100 . " K".$size_unit;}
else {$taille = $taille . " ".$size_unit;}
if($taille==0) {$taille="";}
echo "$LANG_filesize : $taille
\n";
}
if($aff_dimensions =="oui")
{
echo "$LANG_width_height : $taillefic[0] x $taillefic[1]
\n";
}
echo "\n";
}
else
{
echo "L'image passée en paramètre n'existe pas.";
}
}
?>

2 réponses

anonimwork Messages postés 14 Date d'inscription mardi 9 août 2005 Statut Membre Dernière intervention 7 juin 2006
7 juin 2006 à 14:07
Désolé j'ai fait une bétise, voici le code :


//---------------------------------------------------------------------------------------------------
// OPTIONS
//---------------------------------------------------------------------------------------------------

// Barre de navigation en haut de page
$nav_haut= "oui"; // ("oui" ou "non")

// Barre de navigation en bas de page
$nav_bas="oui"; // ("oui" ou "non")

// Afficher le nom du fichier image
$aff_filename="oui"; // ("oui" ou "non")

// Afficher le poids du fichier
$aff_filesize="oui"; // ("oui" ou "non")
$size_unit="o"; // ("o" ou "b" pour octets ou bytes)

// Afficher les dimensions de l'image
$aff_dimensions="oui"; // ("oui" ou "non")

// Afficher la date de modification de l'image
$aff_modtime="oui"; // ("oui" ou "non")

// Afficher des liens numerotes vers toutes les images
$aff_links="oui"; // ("oui" ou "non")
$nb_links=5; // interval

// Classer les images par (sort pictures with) :
// Nom de fichiers (filename) : "nom"
// Poids du fichier (file size) : "taille"
// Date de modification (modification date) : "date"
// Type de fichier (type of file, gif, jpg...) : "type"
$ordre="date";

// Inverser le sens de l'ordre
$sens=0; // (1 ou 0, sens normal : 0)

// Langue (Language)
// FRANCAIS
$LANG_start="Début";
$LANG_previous="Précédent";
$LANG_on="sur";
$LANG_next="Suivant >>";
$LANG_end="Fin >";
$LANG_picture="Photo";
$LANG_filename="Nom du fichier";
$LANG_modtime="Date de modification";
$LANG_filesize="Poids";
$LANG_width_height="Largeur-Hauteur";

// ENGLISH
/*
$LANG_start="Start";
$LANG_previous="Previous";
$LANG_on="on";
$LANG_next="Next";
$LANG_end="End";
$LANG_picture="Picture";
$LANG_filename="File name";
$LANG_modtime="Modification time";
$LANG_filesize="File size";
$LANG_width_height="Width-Height";
*/

//---------------------------------------------------------------------------------------------------
// FIN DES OPTIONS
//---------------------------------------------------------------------------------------------------

function mimetype($fichier)
{
if(eregi("\.gif$",$fichier)){$nom_type="GIF";}
else if(eregi("\.jpg$",$fichier)){$nom_type="JPG";}
else if(eregi("\.png$",$fichier)){$nom_type="PNG";}
else if(eregi("\.bmp$",$fichier)){$nom_type="BMP";}
return $nom_type;
}

// LISTING DE TOUTES LES IMAGES
$tableau=""; $i=0;
$handle=@opendir("$rep");
while ($fichier = @readdir($handle))
{
$extension=substr($fichier,-3);
if($fichier!="." && $fichier!=".." && (eregi("gif",$extension)||eregi("jpg",$extension)))
{
if($ordre=="nom") {$listing[$fichier]=$i;}
else if($ordre=="taille") {$listing[$fichier]=filesize("$rep/$fichier");}
else if($ordre=="date") {$listing[$fichier]=filemtime("$rep/$fichier");}
else if($ordre=="type") {$listing[$fichier]=mimetype("$rep/$fichier");}
else {$listing[$fichier]=mimetype("$rep/$fichier","image");}
}
$i++;
}
@closedir($handle);

if(!is_array($listing))
{
echo "

\n";
echo "Exemple d'appel de ce script :
\n";
echo "index.php?rep=toto/images
\n";
}
else
{
// TRI DE LA LISTE DES FICHIER
if($ordre=="nom") {if($sens==0){ksort($listing);}else{krsort($listing);}}
else if($ordre=="date") {if($sens==0){arsort($listing);}else{asort($listing);}}
else if($ordre=="taille"||$ordre=="type") {if($sens==0){asort($listing);}else{arsort($listing);}}
else {if($sens==0){ksort($listing);}else{krsort($listing);}}

// INDICES DES IMAGES DEBUT, PRECEDENTE, SUIVANTE ET FIN
$i=0;
while (list($cle,$val) = each($listing))
{
if($image=="") {$image=$cle;}
if($i==0) {$debut=$cle;}
if($savesuiv==1) {$suivant=$cle; $savesuiv=0;}
if($image==$cle)
{
$savesuiv=1;
$stopprev=1;
$numphoto=$i+1;
}
if($stopprev=="") {$precedent=$cle;}
$fin=$cle;

echo "cle=$cle , val=$val , debut=$debut , precedent=$precedent , suivant=$suivant , fin=$fin
";

if($aff_links=="oui" && ($i+1)%$nb_links==0)
{
if($savesuiv==1) {$liens.="";}
$liens.="(";
if($savesuiv!=1) {$liens.="[\"index.php?rep=$rep&image=$cle\" ";}
$liens.=$i+1;
if($savesuiv!=1) {$liens.="]";}
$liens.=") ";
if($savesuiv==1) {$liens.="";}
}

$i++;
}

// BARRE DE NAVIGATION
$tableau.="\n\";
$tableau.=\"----
";
// Liens début et précédent
if($precedent!="")
{
$tableau.="< $LANG_start|";
$tableau.="<< $LANG_previous\n";
}
$tableau.=", $LANG_picture $numphoto $LANG_on $i, \";
$tableau.=\"";
// Liens suivant et fin
if($suivant!="")
{
$tableau.="$LANG_next|";
$tableau.="$LANG_end";
}
$tableau.=", \n\";
$tableau.="
";

// AFFICHAGE
if(file_exists("$rep/$image"))
{
// Navigation du haut
if($nav_haut=="oui") {echo "$tableau\n";}

// Image
$taillefic = GetImageSize("$rep/$image");
echo "\n";

// Navigation du bas
if($nav_bas=="oui") {echo "$tableau\n";}

// Liens sur toutes les images
if($aff_links=="oui") {echo "
$liens

\n";}

// Informations sur l'image
echo "\n";
if($aff_filename=="oui")
{
echo "$LANG_filename : $image
\n";
}
if($aff_modtime == "oui")
{
echo "$LANG_modtime : ".date("d/m/Y H:i",filemtime("$rep/$image"))."
\n";
}
if($aff_filesize == "oui")
{
$taille=filesize("$rep/$image");
if ($taille >1073741824) {$taille round($taille / 1073741824 * 100) / 100 . " G".$size_unit;}
elseif ($taille >1048576) {$taille round($taille / 1048576 * 100) / 100 . " M".$size_unit;}
elseif ($taille >1024) {$taille round($taille / 1024 * 100) / 100 . " K".$size_unit;}
else {$taille = $taille . " ".$size_unit;}
if($taille==0) {$taille="";}
echo "$LANG_filesize : $taille
\n";
}
if($aff_dimensions =="oui")
{
echo "$LANG_width_height : $taillefic[0] x $taillefic[1]
\n";
}
echo "\n";
}
else
{
echo "L'image passée en paramètre n'existe pas.";
}
}
0
anonimwork Messages postés 14 Date d'inscription mardi 9 août 2005 Statut Membre Dernière intervention 7 juin 2006
7 juin 2006 à 14:07
bon désolé j'arrete, je n'y arrive pas

salut
0
Rejoignez-nous