aqui va el codigo con el While
Código PHP:
Ver original<?php
$i = $j = 0;
$lastdate = "";
{
/*Alternando color de la fila*/
if ($colorfila==0){
$color= "#FFFFFF";
$colorfila=1;
}else{
$color="#EBFAE2";
$colorfila=0;
}
/*cerrando el if de color fila*/
$date_formatted = date("Ymd", $row['timestamp']); if($date_formatted != $lastdate)
{
if ($lastdate)
{
//echo "<tr><td height=\"1\"></td></tr>";
$j = 0;
}
echo "<tr><td height=\"1\"></td></tr><tr><td class=\"datehead\" colspan=\"$colspan\">".QuickDate($row['timestamp'], FALSE, FALSE)."</td></tr><tr><td height=\"1\"></td></tr>";
$lastdate = $date_formatted;
}
$css_class = "post" . (($j%2)+1);
$i++; $j++;
$url = buildURL
($target_view, array($xcityid, $row['catid'], $row['catname'], $row['subcatid'], $row['subcatname'], $row['adid'], $row['adtitle']));
$title_extra = "";
if(!$xsubcatid)
{
$subcatlink = buildURL
("ads", array($xcityid, $row['catid'], $row['catname'], $row['subcatid'], $row['subcatname']));
$title_extra = " - <a href=\"$subcatlink\" class=\"adcat\">$row[catname] $path_sep $row[subcatname]</a>";
}
?>
<tr style="background-color:<?php echo $color; ?>" onmouseover="this.style.background='#FEFED4';" onmouseout="this.style.background='<?php echo $color; ?>';" class="<?php echo $css_class; ?>">
<td>
<a href="<?php echo $url; ?>" class="posttitle">
<?php
if($row['picfile'] && $ad_thumbnails)
{
$imgsize = GetThumbnailSize("{$datadir[adpics]}/{$row[picfile]}", $tinythumb_max_width, $tinythumb_max_height);
?>
<img src="<?php echo "$datadir[adpics]/$row[picfile]"; ?>" alt="Anuncios Gratis" border="0" width="80" height="60" align="left" style="margin-right:5px;">
<?php
}
else {
echo '<img src="images/default.gif" alt="Anuncios Gratis" border="0" width="80" height="60" align="left"
style="margin-right:5px;">';
}
?>
<?php echo $row['adtitle']; ?></a>
<?php
$loc = "";
if($row['area']) $loc = $row['area'];
if($xcityid <= 0) $loc .= ($loc ? ", " : "") . $row['cityname']; // Version 5.0
if($loc) echo "($loc)";
?>
<?php
if($ad_preview_chars)
{
echo "<span class='adpreview'>";
$row['addesc'] = preg_replace("/\[\/?URL\]/", "", $row['addesc']); echo substr($row['addesc'],0,$ad_preview_chars); if (strlen($row['addesc'])>$ad_preview_chars) echo "..."; echo "</span>";
}
?>
</td>
</tr>
<?php
}
}
?>