1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<h3>Derniers dons :</h3>
<?
mysql_connect('mysql5-6','jojo','jojo');
mysql_select_db('jojo');
$d=mysql_query("SELECT * FROM don WHERE intitule='donne' AND accept='oui' ORDER BY id DESC LIMIT 0,6");
$max=100;
while ($a=mysql_fetch_array($d))
{
$desc=$a['desc'];
$image=$a['photo_1'];
?>
<div class="right_articles">
<p><a href="dons.php?annonce=<? echo $a['titre']; ?>&id=<? echo $a['id']; ?>"><?php if ($image!=""){ echo '<img src="upload/'.$image.'" alt="'.$a['titre'].'" title="'.$a['titre'].'" class="image" width="60px" height="60px" id="hover" />'; } else {?><img src="images/image.png" alt="<? echo $a['titre']; ?>" title="<? echo $a['titre']; ?>" class="image" id="hover" /><?php } ?></a>
<b><a href="dons.php?annonce=<? echo $a['titre']; ?>&id=<? echo $a['id']; ?>" title="<? echo $a['titre']; ?>"><? echo $a['titre']; ?></a></b>
<?
if (strlen($desc) >= $max) {
$desc = substr($desc, 0, $max);
$espace = strrpos($desc, " ");
$desc = substr($desc, 0, $espace)."...";
}
?>
<br /><? echo $desc; ?></p>
</div>
<?
}
?>
<!-- Dernières demandes -->
<h3>Dernières demandes :</h3>
<?
$de=mysql_query("SELECT * FROM don WHERE intitule='demande' AND accept='oui' ORDER BY id DESC LIMIT 0,6");
$max=100;
while ($dem=mysql_fetch_array($de))
{
$desc_dem=$dem['desc'];
$img_dem=$dem['photo_1'];
?>
<div class="right_articles">
<p><a href="demandes.php?annonce=<? echo $dem['titre']; ?>&id=<? echo $dem['id']; ?>"><? if ($img_dem!=""){ echo '<img src="upload/'.$img_dem.'" width="60" height="60" id="hover" />'; }else {?> <img src="images/image.png" class="image" id="hover" /><? } ?></a>
<b><a href="demandes.php?annonce=<? echo $dem['titre']; ?>&id=<? echo $dem['id']; ?>" title="<? echo $dem['titre']; ?>"><? echo $dem['titre']; ?></a></b>
<?
if (strlen($desc) >= $max) {
$desc_dem = substr($desc_dem, 0, $max);
$espace = strrpos($desc_dem, " ");
$desc_dem = substr($desc_dem, 0, $espace)."...";
}
?>
<br /><? echo $desc_dem; ?></p>
</div>
<?
}
?> |
Partager