define(array(template => 'indexi.html')); $tpl->define(array(news_row => 'latest_news_row.html')); // Latest 2 News ... $tpl->assign(array(VAR_NEWS_ROW => NULL)); $sql = "SELECT * FROM content_tbl WHERE section = '02' AND status = 'E' ORDER BY createdtime DESC LIMIT 2 "; $rs = $ado->Execute($sql); while ($contentObj = $rs->FetchNextObject()) { $contentImg = NULL; if (!empty($contentObj->THUMBNAIL_IMAGE) && file_exists(BACKEND_FOLDER.CONTENT_FOLDER.$contentObj->THUMBNAIL_IMAGE)) { $imgWidth = 122; $imgHeight = 64; $size = @getimagesize(BACKEND_FOLDER.CONTENT_FOLDER.$contentObj->THUMBNAIL_IMAGE); $width = ($size[0] > $imgWidth) ? $imgWidth : $size[0]; $height = ($size[1] > $imgHeight) ? $imgHeight : $size[1]; $contentImg .= "Click to view detail ..."; } else { $contentImg .= "Click to view detail ..."; } #$tpl->assign(array(VAR_THUMBNAIL => "".$contentImg."")); $tpl->assign(array(VAR_THUMBNAIL => $contentImg)); $tpl->assign(array(VAR_CONTENT_ID => $contentObj->ID)); $topic = ReplaceKeyword(stripslashes($contentObj->TOPIC), $keyword); #$tpl->assign(array(VAR_TOPIC => "".$topic."")); $tpl->assign(array(VAR_TOPIC => $topic)); #$brief = ReplaceKeyword(stripslashes($contentObj->BRIEF_DESC), $keyword); #$tpl->assign(array(VAR_BRIEF => $brief)); #$tpl->assign(array(VAR_LASTUPDATE => date("d M, Y h:i:s a", strtotime($contentObj->LASTUPDATE)))); #$tpl->assign(array(VAR_READ => "Read (".number_format($contentObj->VIEWED).")")); $tpl->parse(VAR_NEWS_ROW, ".news_row"); } // End of Latest 2 News ... $tpl->parse(TEMPLATE, "template"); $tpl->FastPrint(TEMPLATE); ?>