Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: naujienos nuoroda..

Parašė ---· 2009 Vas. 28 22:02:26
#5

Vo:
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
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_reads DESC LIMIT 0,9"
);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
echo "<table cellspacing='0' cellpadding='0' style='padding-left: 20px;'>";
$itemsubject = trimlink($data['news_subject'], 35);
echo "<tr><td>
<a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."' class='side'>$itemsubject</a>
</td>
</tr></table>";
}
}
   echo "</td><td></td><td style='padding-top: 0px; padding-right: 0px;' align='left' width='300'>";

   $result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0,9");
if (dbrows($result) != 0) {
   echo "<table cellpadding='0' cellspacing='0' align='left'>";
   while($data = dbarray($result)) {
      $itemsubject = trimlink($data['news_subject'], 35);
      echo "<tr><td>
      <a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."' class='side'>$itemsubject</a>
      </td>
      </tr>";
   }
   echo "</table>";
}