clear('cmt_row'); if ($rcat['cat_link'] == "interviews") { $SQL = "int_id AS news_id, int_title AS news_title, int_newwin AS news_newwin, UNIX_TIMESTAMP(int_date) AS news_dt, COUNT(cmt_id) AS cnt FROM news_comment LEFT JOIN interview ON int_id=cmt_news WHERE ".vis('int')." AND cmt_table='interview' AND cmt_vis=1 GROUP BY cmt_news ORDER BY int_id DESC"; } else { $SQL = "news_id, news_cat, news_title, news_identifier, news_newwin, UNIX_TIMESTAMP(news_date) AS news_dt, news_time, COUNT(cmt_id) AS cnt FROM news_comment LEFT JOIN news ON news_id=cmt_news WHERE ".vis('news', $rcat['cat_id'])." AND cmt_table='news' AND cmt_vis=1 GROUP BY cmt_news ORDER BY news_date DESC"; } $res2 = mysql_query("SELECT $SQL LIMIT ".$GLOBALS['comments_latest']); while ($row = @mysql_fetch_array($res2)) { $j++; $tpl->set($row); if ($rcat['cat_link'] == "interviews") { $href = href2("interview", 0, $row['news_id'], $row); } else { $href = href2("news", $rcat['cat_id'], $row['news_id'], $row); } $tpl->set("href", $href, "target", $row['news_newwin'] ? ' target="_blank"' : '', "bg", $news_bg[($j-1) % $N]); make_item_dt($tpl, $row['news_dt'], $row['news_time']); $tpl->parse("cmt_row", ".cmt_row"); } @mysql_free_result($res2); if ($j == 0) continue; $tpl->set($rcat); make_img($tpl, "ximg", "/upload/page/", $rcat['cat_ximg'], '', 'absmiddle'); $tpl->parse("cmt_cat", ".cmt_cat"); } @mysql_free_result($res); $tpl->parse("main", "main"); // cache_store($tpl, "main"); // } ?> CYPRUS MIRROR Daily News | Comments