<?

$k_p=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`",$db), 0);
$k_n= mysql_result(mysql_query("SELECT COUNT(*) FROM `news` WHERE `time` > '".(time()-86400)."'",$db), 0);
$k= mysql_result(mysql_query("SELECT COUNT(*) FROM `news` WHERE `time` > '".(time()-86400)."'",$db), 0);
if ($k_n==0)$k_n=NULL;
else '+'.$k_n.'';
if ($k==0)$k=NULL;
else '+'.$k.'';
if ($k_n>0)$k_n=' <span style="color:#FF0000;">+'.$k.' new!</span> ';


echo "$k_n";


function vremja2($time=NULL) 
{
global $user;
if ($time==NULL)$time=time();
if (isset($user))$time=$time+$user['set_timesdvig']*60*60;
$timep=date("j-M-Y", $time);
$timep=str_replace("Jan","1",$timep);
$timep=str_replace("Feb","2",$timep);
$timep=str_replace("Mar","3",$timep);
$timep=str_replace("May","5",$timep);
$timep=str_replace("Apr","4",$timep);
$timep=str_replace("Jun","6",$timep);
$timep=str_replace("Jul","7",$timep);
$timep=str_replace("Aug","8",$timep);
$timep=str_replace("Sep","9",$timep);
$timep=str_replace("Oct","10",$timep);
$timep=str_replace("Nov","11",$timep);
$timep=str_replace("Dec","12",$timep);
return $timep;
}

$nt=mysql_fetch_array(mysql_query("SELECT `time` FROM `news` ORDER BY `id` DESC LIMIT 1",$db)); 
echo "(";
echo vremja2($nt[time]); 
echo ")";
?>
