Parašė Lordcraft· 2009 Bir. 16 16:06:54
#1
Ar eitu padaryti kad panelej rodytu visas naujausias naujienas isskirus viena ar du kategorijos ID?
pvz dabar yra tokia panele kuri rodo naujausias naujienas is tam tikro ID:
openside("Naujienos");
$result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_cat='20' AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") ORDER BY news_reads DESC LIMIT 0,5");
if (dbrows($result) != 0) {
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
while ($data = dbarray($result)) {
echo "<tr>
<td class='small'>
<img src='".THEME."images/bullet.gif'>
<a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."' class='side'>".trimlink($data['news_subject'], 23)."</a>
</td>
<td align='right'>".$data['news_reads']."</td>
</tr>";
}
echo "</table>";
} else {
echo "<div style='text-align:center'>".$locale['004']."</div>\n";
}
echo "";
closeside();
o kaip padaryti kad rodytu visas naujienas iskyrus tam tikra ID?