$result = dbquery(
"SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_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().") AND news_draft='0'
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",$items_per_page"
);
$numrows = dbrows($result);
if ($settings['news_style'] == "1") { $nrows = round((dbrows($result) - 1) / 2); }
while ($data = dbarray($result)) {
$news_cat_image = "";
$news_subject = "<a name='news_".$data['news_id']."'
id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
$news_cat_image = "<a href='".($settings['news_image_link'] == 0 ?
"news_cats.php?cat_id=".$data['news_cat'] : FUSION_SELF."?readmore=".$data['news_id'] )."'>";
if ($data['news_image_t2'] && $settings['news_image_frontpage'] == 0) {
$news_cat_image .= "<img src='".IMAGES_N_T.$data['news_image_t2']."'
alt='".$data['news_subject']."' class='news-category' /></a>";
} elseif ($data['news_cat_image']) {
$news_cat_image .= "<img src='".get_image("nc_".$data['news_cat_name'])."'
alt='".$data['news_cat_name']."' class='news-category' /></a>";
} else {
if (VIP) {
echo "Tavo VIP pasibaigs: ".showdate('longdate', $userdata['user_vip'])."<br>";
} else {
echo "Tu ne VIP narys! <a href='".BASEDIR."vip.php'>Uþsisakyk!</a><br>";
}