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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| <div class="container" style="border-top:0px;">
<?php
// AFF ACTUALITES : GROSSES ACTU
$requete_video = "SELECT * from news order by date desc, heure desc limit 0,11";
$resultat_video = send_sql($requete_video);
// on distribue les résultats en 3 array : $col[0], $col[1] et $col[2]
// -> grâce au MODULO (x%y = reste de la division de x par y)
// ICI : ($index%3) renvoie alternativement : 0, 1 ou 2
$index = 0;
while($row = mysql_fetch_assoc($resultat_video)) {
$col[$index%3][] = $row;
$index++;
}
// affichage sur 3 colonnes
for ($i=0; $i<3; $i++)
{
?>
<div class="news3colonnes">
<?php
$list_video = array(); // on vide (en créant un array vierge)
foreach($col[$i] as $list_video)
{
$requete_photo="SELECT fichier from news_photos as vp, photos as p where p.photo_id=vp.photo_id and vp.new_id='".$list_video['new_id']."'";
$resultat_photo=send_sql($requete_photo);
$list_photo=mysql_fetch_assoc($resultat_photo);
$requete_topic="SELECT count(topic_id) as cpt_commentaire from phpbb_posts where topic_id='".$list_video['topic_id']."'";
$resultat_topic=send_sql($requete_topic);
$list_topic=mysql_fetch_assoc($resultat_topic);
$size = resize_image_force($CONF_URL_SERV.'/images/'.str_replace('.jpg', '-thb.jpg', $list_photo['fichier']), 135, 76);
?>
<div class="slider_div3">
<div class="project_img3" style="overflow:hidden;">
<center>
<a class="lien_no" href="<?php echo link_actu($list_video['new_id']); ?>" title="<?php echo utf8_encode($list_video['titre']); ?>">
<img class="project_img3" src="<?php echo $CONF_URL_SERV.'images/'.str_replace('.jpg', '-thb.jpg', $list_photo['fichier']); ?>" alt="<?php echo utf8_encode($list_video['titre']); ?>" width="<?php echo $size['width']; ?>" height="<?php echo $size['height']; ?>" />
</a>
</center>
</div>
<h3 class="slider_div" href="<?php echo link_actu($list_video['new_id']); ?>" title="<?php echo utf8_encode($list_video['titre']); ?>">
<?php echo utf8_encode($list_video['titre']); ?>
</h3>
<div class="relative gris_clair size11" style="top:0px;width:290px">
Posté le <?php echo date_jjmmaaaa(convert_datetime($list_video['date']." ".$list_video['heure'])); ?> à <?php echo date_hhmmss(convert_datetime($list_video['date']." ".$list_video['heure'])); ?>
-
<a class="lien_deja_u gris_clair" href="<?php echo $CONF_URL_SERV."forum/".clean_url($list_video['titre'])."-t".$list_video['topic_id'].".html"; ?>" title="<?php echo $list['titre_fr']; ?>">
Lire les commentaires (<?php echo ($list_topic['cpt_commentaire']-1); ?>)
</a>
</div>
<a class="slider_div" href="<?php echo link_actu($list_video['new_id']); ?>" title="<?php echo utf8_encode($list_video['titre']); ?>">
<?php echo resize_txt(utf8_encode(strip_tags($list_video['texte'])), 240, 'oui'); ?>
</a>
<a class="lien_no gris_clair size11" href="<?php echo link_actu($list_video['new_id']); ?>" title="<?php echo utf8_encode($list_video['titre']); ?>">
Lire tout >>
</a>
</div>
<?php
} // fin foreach
?>
</div>
<?php
} // fin for
?>
<?php // FIN AFF ACTUALITES 1?> |
Partager