(GPLv2)
or write to the Free Software Foundation, Inc., 51 Franklin Street,
Fifth Floor, Boston, MA02110-1301, USA.
********************************************************************************/
if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_news.php")) {
die("
Error: This file cannot be opened directly! |
");
}
global $dblink;
/*
$news_result = $dblink->get_list("SELECT id,nome FROM memht_news WHERE enabled=1 ORDER BY id DESC LIMIT 20");
foreach ($news_result as $row_news) {
$nid = intval($row_news['id']);
$nnome = outCode($row_news['nome']);
echo "\n";
}
*/
echo "
";
echo "";
// $news_result = $dblink->get_list("SELECT id,nome,imgfile,testo_home FROM memht_news WHERE enabled=1 ORDER BY id DESC LIMIT 5");
$news_result = $dblink->get_list("SELECT id,nome,imgfile,testo_home FROM memht_news WHERE enabled=1 ORDER BY id DESC LIMIT 6");// à»ÅÕè¹ LIMIT 5 à»ç¹ LIMIT 6
$num=0; // ¡Ó˹´¤èÒµÑÇá»Ã $num =0
foreach ($news_result as $row_news) {
$nid = intval($row_news['id']);
$nnome = outCode($row_news['nome']);
$imgfile = outCode($row_news['imgfile']);
$testo_home = outCode($row_news['testo_home']);
//echo "\n";
//echo "\n";
// echo "";
// echo "";
$num++; // à¾ÔèÁµÑÇá»Ã $num
if($num==1){ // check µÑÇá»Ã $num
echo " |
"; // ¢Öé¹á¶ÇãËÁè
} // »Ô´ if
echo ""; // ¢Ö鹤ÍÅÑÁãËÁè
if($imgfile !="" ){
echo " ";
}
echo " | ";
echo " $nnome | ";
//echo "
";
//echo "";
//echo "$testo_home | ";
//echo "
";
if($num==2){ // check µÑÇá»Ã $num ÇèÒà»ç¹¤ÍÅÑÁ·ÕèÊͧ ãËé»Ô´ á¶Ç
echo ""; // »Ô´ á¶Ç
$num=0; // ãËé $num à·èҡѺ 0 ¤×ÍàÃÔèÁ¹Ñº ¤ÍÅÑÁ à»ç¹ 0
}//»Ô´ if
}
echo "
";
///////////////////////////////////////////////////////////////////////////////////////////////////////////
echo '
';
echo "ข่าวสาร
\n";
echo '
';
$result = $dblink->get_list("SELECT * FROM memht_argomenti ORDER BY nome");
foreach ($result as $row) {
$aid = intval($row['id']);
$nome = outCode($row['nome']);
echo "
";
echo " $nome [อ่านข่าวทั้งหมด]\n";
// new
echo " ";
$news_result = $dblink->get_list("SELECT id,nome,imgfile,testo_home,data FROM memht_news WHERE enabled=1 and argomento='$aid' ORDER BY id DESC LIMIT 6");
foreach ($news_result as $row_news) {
$nid = intval($row_news['id']);
$nnome = outCode($row_news['nome']);
$imgfile = outCode($row_news['imgfile']);
$testo_home = outCode($row_news['testo_home']);
$data = outCode($row_news['data']);
//echo "\n";
//echo "\n";
echo "";
echo " ";
echo "$nnome [".printdate($data)."] | ";
echo "
";
}
echo "
";
echo "
\n";
}
echo "
\n";
?>