rendered paste body<?php
session_start(site);
$showtimes = "select userid, showtime from cr_members where showtime >= subdate(now(), Interval 1 second) order by showtime desc limit 0,5";
$resultshowtime=mysql_query($showtimes) or die("query failed : ".$showtimes) ;
$show_count = "select count(*) as showcount from cr_members where showtime >= subdate(now(), Interval 1 second) order by showtime desc";
$result_showcount = mysql_query($show_count) or die("query failed : ".$show_count);
echo "<table border='0' cellpadding='0' cellspacing='0' width='164' style='border-style:solid ; border-width:1px; border-color:<? echo $bordercolor; ?>;'>
<tr>
<td width='164' height='60' valign='top' align='left'>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='164'>";
while($line = mysql_fetch_array($resultshowtime)){
$showname = $line['userid'];
$showtime = $line['showtime'];
list($date, $time) = explode(" ", $showtime);
list($year, $month, $day) = explode("-", $date);
list($hour, $min) = explode(":", $time);
$months = array("janvier", "février", "mars", "avril", "mai", "juin","juillet", "août", "septembre", "octobre", "novembre", "décembre");
$showtime2 = "$day ".$months[$month-1]." ${hour}h${min}";
if ( showcount < 5 ) {
echo "<tr><td align='left' colspan='2' width='164' style='padding-left:5px;'><a href=\"#\" OnClick=\"javascript:launchWindow('profile.php?member=$showname', '$showname', 622, 510, 'scrollbars=yes,resizable=no')\">ajouter votre nom</a></td>
</tr>"; } else {
echo "<tr><td align='left' width='50' style='padding-left:5px;'><a href=\"#\" OnClick=\"javascript:launchWindow('profile.php?member=$showname', '$showname', 622, 510, 'scrollbars=yes,resizable=no')\">".$showname."</a></td> <td width='114' align='left'> ".$showtime2."</td>
</tr>";
} }
echo "</table>";
echo "</td></tr></table>";
?>