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
|
<?php
$commaff= mysql_query("SELECT * FROM ".T_NEWS." ORDER BY id DESC LIMIT 0,2");
while ($donnees = mysql_fetch_array($commaff))
{
$max=100;
$chaine=$donnees['description'];
if(strlen($chaine)>=$max)
{
$chaine=substr($chaine,0,$max);
$espace=strrpos($chaine," ");
if($espace)
$chaine=substr($chaine,0,$espace);
$chaine .= ' ...';
}
$numero=$donnees[0];
$url=$donnees[1];
$url = preg_replace("`\[.*\]`U","",$url);
$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
$url = htmlentities($url, ENT_COMPAT);
$url = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $url );
$url = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $url);
$url = ( $url == "" ) ? $type : strtolower(trim($url, '-'));
echo'
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="5%" valign="top"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="47" valign="top" ><a class="actualitetextelien" href="'.$numero.'-'.stripslashes ($url).'.html"><img src="images/news/'.$donnees['images'].'" width="49" height="49" border="0" class ="corners iradius5 ishadow33 iborder1 icolorffffff"></a></td>
</tr>
</table></td>
<td width="95%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a class="actualitetextelien" href="'.$numero.'-'.stripslashes ($url).'.html">
<strong><img src="images/flecheblanche.gif" width="3" height="5" border="0"> '.stripslashes ($donnees['titre']).'</strong></a><br />
'.stripslashes ($chaine).'</td>
</tr>
</table>
</td>
</tr>
</table><div class="ligneblanche"></div>'; }
?> |
Partager