This is my autoarchive.php
<?PHP
error_reporting (E_ALL ^ E_NOTICE);
$cutepath = __FILE__;
$cutepath = preg_replace( "'\\\auto_archive\.php'", "", $cutepath);
$cutepath = preg_replace( "'/auto_archive\.php'", "", $cutepath);
$now[year] = date("Y");
$now[month] = date("n");
$now[stamp] = $now[year] + $now[month];
$db_content = file("$cutepath/auto_archive.db.php");
list($last_archived[year], $last_archived[month]) = split("\|", $db_content[0] );
$last_archived[stamp] = $last_archived[year] + $last_archived[month];
if($now[stamp] > $last_archived[stamp]){
$error = FALSE;
$arch_name = time();
if(!@copy("$cutepath/data/news.txt","$cutepath/data/archives/$arch_name.news.arch")) { $error = "Can not copy news.txt"; }
if(!@copy("$cutepath/data/comments.txt","$cutepath/data/archives/$arch_name.comments.arch")) { $error = "Can not copy comments.txt"; }
$handle = fopen("$cutepath/data/news.txt","w") or $error = "Can not open news.txt";
fclose($handle);
$handle = fopen("$cutepath/data/comments.txt","w") or $error = "Can not open comments.txt";
fclose($handle);
$fp = @fopen("$cutepath/auto_archive.db.php", "w");
if(!$errors){ fwrite($fp, $now[year]."|".$now[month]."\n"); }
else{ fwrite($fp, "0|0|$error\n"); }
foreach($db_content as $line){
@fwrite($fp, $line);
}
@fclose($fp);
}
?>
And this is my autoarchive.db.php
2005|12
2005|11
2005|10
and this is how is show the archive news:
My Webpage
But still not working...why news are archived in December-February2006?
Bella