Location: PHPKode > projects > PHPEcho CMS > blocks/lastnews/index.php
<?php
/*  +--------------------------------------------
*   |
*   |     Product:       PHPEchoCMS
*   |     Author:        Anas Husseini
*   |     License:       GPL
*   |     Last updated:  25.03.07
*   |     For version:   2.0 
*   |     Desc:          Last News block
*   |        
*   +--------------------------------------------
*/

if( !@$BASE_LOAD )
{
    die('Application error.');
}

$block_display_name = $lang['028'];
$block_content = "";

$lastnewscount = query("select `lastnews` from `".PREFIX."settings`", 2);
$allnews = query ("select * from `".PREFIX."news` order by `id` desc limit ".$lastnewscount, 1);

$block_content .= "<ul type='square'>";

while ($news = mysql_fetch_array($allnews))
{
	$block_content .= "<li><a href='index.php?module=news&id=".$news['id']."'>".$news['title']."</a></li>";
}

$block_content .= "</ul>";

?>
Return current item: PHPEcho CMS