clear("columnists", "columnists2"); /* page */ if (!cache_fetch($tpl, "main")) { $C = $GLOBALS['cols_journalists'] ? $GLOBALS['cols_journalists'] : 3; add_block($tpl, "journalists.htpl", "main"); $res = mysql_query("SELECT col_id, col_name, col_img FROM columnists WHERE col_vis AND col_lang=$lang ORDER BY col_pos"); $i = 0; while ($row = @mysql_fetch_array($res)) { $tpl->set($row); $res2 = mysql_query("SELECT * FROM articles WHERE art_col=$row[col_id] AND ".vis('art',0,-1)." ORDER BY art_date DESC LIMIT 1"); $row2 = @mysql_fetch_array($res2); if (is_array($row2)) { $i++; $tpl->set($row2); make_img($tpl, "img", "/upload/columnists/", $row['col_img'], '', 'left', 1, 0, 60); $tpl->set("href", href2('article', 0, $row2['art_id'], $row2), "target", $row2['art_newwin'] ? ' target="_blank"' : '', "hrefc", href("columnist", 0, $row['col_id'])); $tpl->parse("journalist_td", ".journalist_td"); if ($i % $C == 0) { $tpl->parse("journalist_tr", ".journalist_tr"); $tpl->clear("journalist_td"); } } @mysql_free_result($res2); } if ($i % $C == 1) { $tpl->parse("journalist_td2", ".journalist_td"); $tpl->parse("journalist_tr", ".journalist_tr"); $tpl->clear("journalist_td"); } if ($i > 0) $tpl->parse("main", "main"); @mysql_free_result($res); cache_store($tpl, "main"); } ?> CYPRUS MIRROR Daily News | COLUMNISTS