View file localnews.php

File size: 833B
<?php
$file=file(BASEDIR."manager/news.dat");
$file=array_reverse($file);
$news_count=count($file);

$data1 = explode("|",$file[0]);

if($data1[3]==""){
$newdate = 0;
}else{
$newdate = date_fixed($data1[3],"d.m.y");
}

//echo ' ('.$newdate.')<br>';

//---------------------- Последние новости -----------------------------//
if($config_lastnews>0){
if($config_lastnews>$news_count){$config_lastnews=$news_count;}

for($ln=0;$ln<$config_lastnews;$ln++){

$dtn = explode("|",$file[$ln]);

echo'<b>'.$dtn[0].'</b> ('.date_fixed($dtn[3],"d.m.y").')<br>'.bb_code($dtn[1]).'<br>';
echo'<a href="'.BASEDIR.'manager/news/komm.php?id='.(int)$dtn[5].'&amp;'.SID.'">Комментарии</a> ';

$filekomm = file(BASEDIR."manager/datakomm/$dtn[5].dat");
$totalkomm = count($filekomm); 

echo '('.(int)$totalkomm.')<br>';
}}

?>