Parašė bruzgis· 2010 Lie. 4 23:07:04
#94
uzvesiu ant kelio tiesiog
echo "<table><tr>";
$i = 0;
while(..) {
$i++:
if($i % 4 == 0) echo "</tr><tr>";
echo "<td>isvedamas kodas</td>";
}
toliau tikiuosi sugebesi pasidaryt, kadangi matau koduotojas dizainu esi B)
kazkas taip turetu atrodyt...
opentable("Atsitiktiniai serialai");
$result=dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY RAND() LIMIT 2");
$i=0;
if(dbrows($result)!=0){
echo "<table cellpadding='5' cellspacing='0' width='100%' align='center'><tr>";
while($data=dbarray($result)){
$result2 = dbquery("SELECT news_cat_name FROM ".DB_PREFIX."news_cats WHERE news_cat_id='$data[news_cat]'");
$category = dbresult($result2,0);
if($i % 4 == 0) echo "</tr><tr>";
$i++;
echo "<td>
<table width='100%' height='100%'>
<tr><td align='center'>
<strong><center><a href='/".seoname(trimlink($data['news_subject'],20))."-rn".$data['news_id'].".htm' title='".$data['news_subject']."' class='slink'>".trimlink($data[news_subject], 25)."</a></center></strong>
</td></tr>
<tr><td valign='top' align='center'>
<a href='/".seoname(trimlink($data['news_subject'],20))."-rn".$data['news_id'].".htm' title='".$data['news_subject']."'>
<img src='".$data['news_nuoroda']."' width='110px' height='150px' border='0'>
</td></tr>
</table>
</td>";
}
if($i % 4 != 0) echo "</tr>";
echo "</table>\n";
}
closetable();
Redagavo bruzgis· 2010 Lie. 4 23:07:14