Bonjour, J'ai un site qui affiche des photos et diverses infos depuis une base de donnée, jusqu'a maintenant, tout aller bien. Je fais une mise à jour des themes et addon puis install un ssl et la viens les problemes. Sur la pages d'accueil, je n'ai aucun probleme, mais sur la page qui suit, bien que toutes les infos sont importés de la base de données, mais les photos, elles, restent vides. J'ai essayé de faire un back up mais les photos restent vides. Je commence a secher ..
<?php
if(!$_GET['id'])
header('Location: index.php');
else
$mon_id=$_GET['id'];
get_bien_images($mon_id);
// envoi du msg
if($_POST['nom'])
{
$to = get_bien_contact_email($mon_id);
$sub = "Message de ". $_POST['nom']." ".$_POST['prenom']." venant du site immoplusmons.be";
$headers = "From:". $_POST['mail'];
$message = "Telephone:". $_POST['tel'] . "\nMessage:\n" . $_POST['msg'] . "\nBien en question <a href='http://immoplusmons.be/bien?id=$mon_id'>http://immoplusmons.be/bien?id=$mon_id</a>";
if(mail($to, $sub, $message, $headers))
echo "<script>alert('Votre message à bien été envoyé');</script>";
else
echo "<script>alert('Un problème technique empeche l\'envoi de votre message');</script>";
}
?>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head("bien"); ?>
<script>
function toggle()
{
if(src== "http://immoplusmons.be/cache/<? echo $mon_id; ?>1")
document.getElementById("plan").src = "http://immoplusmons.be/cache/<? echo $mon_id; ?>/plan_2.gif";
else
document.getElementById("plan").src = "http://immoplusmons.be/cache/<? echo $mon_id; ?>/plan_1.gif";
}
</script>
</head>
<body <?php body_class(); ?> >
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<?php if ( has_nav_menu( 'top' ) ) : ?>
<div class="navigation-top">
<div class="wrap">
<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
</div><!-- .wrap -->
</div><!-- .navigation-top -->
<?php endif; ?><div class="TopBien" style="background-image:url(/cache/<? echo $mon_id; ?>.gif)" /></div>
<div id="BandoBien">
<ul class="nodot DetailBien">
<? if($p= get_bien_taillel($mon_id))
echo "<li class='surfacel'>Surface du living <br /> $p </li>";
if($p= get_bien_surfacej($mon_id))
echo "<li class='surfacej'>Surface du terrain <br /> $p </li>";
if($p= get_bien_facade($mon_id))
echo "<li class='facade'>Largeur de la façade <br /> $p </li>";
if($p= get_bien_sh($mon_id))
echo "<li class='totale'>Surface Habitable <br /> $p M²</li>";
if($p= get_bien_st($mon_id))
echo "<li class='jardin'>Surface totale <br /> $p A</li>";
?>
</ul>
</div>
<div class="vendeur">
<img src="<? echo get_bien_contact_photo_url($mon_id); ?>" class="photo_ven" />
<ul class="nodot ven">
<li class="maj"><? echo get_bien_contact($mon_id); ?></li>
<li class="vert"><b>A VOTRE SERVICE</b></li>
<li><? echo get_bien_contact_tel($mon_id); ?></li>
<li><? echo get_bien_contact_email($mon_id); ?></li>
</ul>
</div>
<p class="presktitre">Pour mieux visualiser, retrouvez les plans de l'endroit</p>
<img id="plan" src="cache/<? echo $mon_id; ?>/plan_1".gif <?
if(file_exists("cache/$mon_id/plan_2.gif"))
echo "fonction.toggle() ";
?> />
</div>
<div class="col_droite_content">
<h2 class="PlusBas"> Descriptif du bien</h2>
<p class="descriptif_bien"><? echo get_bien_desc($mon_id); ?> </p>
</div>
<hr class="sep" />
<?
if($ret = get_bien_classnrj($mon_id))
{
$cl = $ret[0];
$ce = $ret[1];
}
else {
$cl="?";
$ce = "??";
}
?>
<table class="BilanNrj">
<tr>
<td><img width="200" src="bilan/<? echo $cl; ?>.png" alt="bilan energie" /></td><td class="bilan <? echo 'b'.$cl; ?>" ><? echo $ce ?></td>
</tr></table>
<!-- photos -->
<?
$imgsrcs[] = "cache/$mon_id.gif";
$nb=1;
if(file_exists("cache/$mon_id/2.gif"))
{
$imgsrcs[] = "cache/$mon_id/2.gif" ;
$nb++ ;
}
if(file_exists("cache/$mon_id/3.gif"))
{
$imgsrcs[] = "cache/$mon_id/3.gif" ;
$nb++ ;
}
if(file_exists("cache/$mon_id/4.gif"))
{
$imgsrcs[] = "cache/$mon_id/4.gif";
$nb++ ;
}
if(file_exists("cache/$mon_id/5.gif"))
{
$imgsrcs[] = "cache/$mon_id/5.gif";
$nb++ ;
}if(file_exists("cache/$mon_id/6.gif"))
{
$imgsrcs[] = "cache/$mon_id/6.gif";
$nb++ ;
}if(file_exists("cache/$mon_id/7.gif"))
{
$imgsrcs[] = "cache/$mon_id/7.gif";
$nb++ ;
}if(file_exists("cache/$mon_id/8.gif"))
{
$imgsrcs[] = "cache/$mon_id/8.gif";
$nb++ ;
}
if(file_exists("cache/$mon_id/9.gif"))
{
$imgsrcs[] = "cache/$mon_id/9.gif";
$nb++ ;
}
if(file_exists("cache/$mon_id/10.gif"))
{
$imgsrcs[] = "cache/$mon_id/10.gif";
$nb++ ;
}
if(file_exists("cache/$mon_id/11.gif"))
{
$imgsrcs[] = "cache/$mon_id/11.gif";
$nb++ ;
}
if(file_exists("cache/$mon_id/12.gif"))
{
$imgsrcs[] = "cache/$mon_id/12.gif";
$nb++ ;
}
?>
<div align="center"><ul class="nodot images">
<?
foreach($imgsrcs as $imgsrc)
{
echo "<li><a href='$imgsrc' rel='groupe'><img src='$imgsrc' class='imgFull colorbox-123' /></a></li>";
}
?>
</ul>
</div>
</div> <!-- site content -->
<? get_footer(); ?>
function get_bien_images($id)
{
$bdd = Connection();
mysqli_set_charset($bdd, "utf8");
// recuperation premiere image
$cache_dir = "cache/";
$fn = $cache_dir.$id.".jpg";
if(!file_exists($fn)){
$reqimg = "SELECT photo1 FROM biens WHERE id=$id";
$reqimg = mysqli_real_escape_string ($bdd,$reqimg);
$resi = mysqli_query($bdd,$reqimg);
$rowi = mysqli_fetch_array($resi, MYSQLI_ASSOC);
if(!$rowi)
echo mysqli_error($bdd);
ob_clean();
$img = imagecreatefromstring($rowi['photo1']);
imagegif($img,$fn);
ob_flush();
flush();
imagedestroy($img);
mysqli_free_result($resi);
}
//recuperation autres images
if(!file_exists($cache_dir.$id))
{
mkdir($cache_dir.$id);
$reqimg = "SELECT photo2, photo3,photo4,Photo5 as photo5,Photo6 as photo6, Photo7 as photo7, Photo8 as photo8,Photo9 as photo9, Photo10 as photo10, Photo11 as photo11, Photo12 as photo12, plan_1, `plan 2` FROM biens WHERE id=$id";
$reqimg = mysqli_real_escape_string ($bdd,$reqimg);
$resi = mysqli_query($bdd,$reqimg);
$rowi = mysqli_fetch_array($resi, MYSQLI_ASSOC);
if(!$rowi)
echo mysqli_error($bdd);
ob_clean();
for($i=2; $i<13; $i++)
{
if($rowi['photo'.$i])
{
$fn = $cache_dir.$id."/".$i.".gif";
$img = imagecreatefromstring($rowi['photo'.$i]);
imagegif($img,$fn);
ob_flush();
flush();
imagedestroy($img);
}
}
if($rowi['plan_1'])
{
$fn = $cache_dir.$id."/plan_1.gif";
$img = imagecreatefromstring($rowi['plan_1']);
imagegif($img,$fn);
ob_flush();
flush();
imagedestroy($img);
}
if($rowi['plan 2'])
{
$fn = $cache_dir.$id."/plan 2.gif";
$img = imagecreatefromstring($rowi['plan 2']);
imagegif($img,$fn);
ob_flush();
flush();
imagedestroy($img);
}
mysqli_free_result($resi);
}
}
function get_bien_classnrj($id)
{
$req = "SELECT `sous_classe_energenique` from biens where biens.id=$id";
$bdd = Connection();
mysqli_set_charset($bdd, "utf8");
$req = mysqli_real_escape_string ($bdd,$req);
$res = mysqli_query($bdd,$req);
if(!$res)
{
echo mysqli_error($bdd);
return false;
}
$row = mysqli_fetch_array($res, MYSQLI_ASSOC);
$ce = $row['sous_classe_energenique'];
if($ce > 510 )
$class="g";
if( 331 < $ce && $ce <510)
$class="f";
if( 231 < $ce && $ce <425)
$class="e";
if( 151 < $ce && $ce <340)
$class="d";
if( 91 < $ce && $ce <255)
$class="c";
if( 51 < $ce && $ce <170)
$class="b";
if( $ce <85)
$class="a";
$ret[0] = $class;
$ret[1] = $ce;
mysqli_free_result($res);
Deco($bdd);
return $ret;
}
Voila ce que ca donne:
https://gyazo.com/8020b2a3516316b85d39ba1179abd804
Voila, voila, avez-vous une solution ou une idée pour cela, Merci :)
EDIT MODERATION : Ajout du LANGAGE dans les BALISES DE CODE.
Afficher la suite