Просмотр файла template/newforumsmain.php

Размер файла: 1.34Kb
<?php
// mod by Golem http://veplog.ru

$filtime=filemtime(BASEDIR."local/forumsmain.dat");

$filtime=$filtime+0;

$ttime=time();

if($ttime>=$filtime){

$uir = opendir (BASEDIR."local/dataforum");

while($uile = readdir ($uir)){

if (( $uile != ".") && ($uile != "..") && ($uile != ".htaccess") && ($uile != "index.php") && !ereg ("topic", "$uile") && !ereg ("mainforum", "$uile")){
$urw[] = ''.date("YmdHis", filemtime(BASEDIR.'local/dataforum/'.$uile.'')).'||'.$uile.'||'.$at[$i].'';

}}

closedir ($uir);

$utal = count($urw);

rsort($urw);

$ufp = fopen(BASEDIR."local/forumsmain.dat","a+");

flock ($ufp,LOCK_EX);

ftruncate($ufp,0);
for ($ic=0; $ic<3; $ic++) {
$sexp = explode("||", $urw[$ic]);
$msg=file(BASEDIR."local/dataforum/$sexp[1]");

$msg=array_reverse($msg);

$dato = explode("|",$msg[0]);

$sexpi=str_replace (".dat","",$sexp[1]);

$udtext[]='&#187; <a href="forum/index.php?fid='.
$dato[8].'&amp;id='.$sexpi.'&amp;">'.$dato[3].'</a>['.nickname($dato[0]).', '.date_fixed($dato[9],"H:i").']';
fputs($ufp,"$udtext[$ic]\r\n");}
fflush ($ufp);
flock ($ufp,LOCK_UN);
fclose($ufp);

chmod ($ufp, 0666);

chmod (BASEDIR."local/forumsmain.dat", 0666);}
$tw = file(BASEDIR."local/forumsmain.dat");

$dattem=implode('',$tw);

$dattem=preg_replace ("|[\r\n]+|si","<br>",$dattem);

echo' '.$dattem.' ';

?>