Parašė bruzgis· 2009 Lap. 19 02:11:19
#2
opentablenw("");
echo "<table cellpadding='0' cellspacing='0' width='750'><tr>
<td width='150' class=tbl1 >Pavadinimas</td><td class=tbl1 width=60 >Komentarai</td><td class=tbl1 width=60 >Skaityta</td></tr>";
$result = dbquery(
"SELECT tn.*, tc.* FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_datestamp DESC LIMIT 0, 20"
);
while ($data = dbarray($result)) {
$komentarai = dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'");
echo "<tr><td class=tbl1><img src='".THEME."images/bullet.gif' alt=''> ".$data['news_cat_name'].": <a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."'>".$data['news_subject']."</a><br></td><td class='tbl1' style='padding-left:10px;'>" . $komentarai . "</td><td class='tbl1' style='padding-left:10px;'>".$data['news_reads']."</td></tr>";
}
echo "</table>";
closetablenw();
Prasom ;)