".$echo['cannotOpenDir']." ./archives. ".$echo['checkCHMOD']); }
if(!is_readable("./data/news.txt")){ die($echo['error']."
".$echo['cannotReadFile']." news.txt. ".$echo['checkCHMOD']); }
if(!is_readable("./data/comments.txt")){ die($echo['error']."
".$echo['cannotReadFile']." comments.txt. ".$echo['checkCHMOD']); }
// Some Stats
$count_postponed_news = 0;
$count_unapproved_news = 0;
$todaynews = 0;
$count_comments = 0;
$count_my_news = 0;
$count_new_news = 0;
$news_db = file("./data/news.txt");
foreach ($news_db as $line)
{
$item_db = explode("|",$line);
$itemdate = date("d/m/y",$item_db[0]);
if($itemdate == date("d/m/y")) {
$todaynews++;
if($item_db[1] == $member_db[2]) $count_my_news++;
if(($item_db[0] > $member_db[9]) and ($member_db[9] != '')) $count_new_news++;
}
}
$stats_news = count( $news_db );
$stats_users = count( file("./data/users.db.php") ) - 1;
$count_postponed_news = count( file("./data/postponed_news.txt") );
if($count_postponed_news > 0){
ResynchronizePostponed();
}
if($config_auto_archive == "yes"){
ResynchronizeAutoArchive();
}
$count_unapproved_news = count( file("./data/unapproved_news.txt") );
$stats_archives = 0;
$handle = opendir("./data/archives");
while (FALSE !== ($file = readdir($handle)))
{
if( preg_match("/.news.arch/",$file) ){$stats_archives++;}
}
closedir($handle);
// $stats_news_size = formatsize(filesize("./data/news.txt"));
// $stats_comments_size = formatsize(filesize("./data/comments.txt"));
// Count Comments
$all_comments = file("./data/comments.txt");
foreach($all_comments as $news_comments){
$single_news_comments = explode("|>|", $news_comments);
$individual_comments = explode("||", $single_news_comments[1]);
$count_comments += count($individual_comments) - 1;
}
// Define Welcome Message
echo"
|
$member_db[2]";
if($todaynews != 1){ $s = "s"; }
if($member_db[1] != 4){
if($stats_users > 1){
$rand_msg[] = ", ".$echo['weHave']." $count_new_news ".$echo['newArticlesSLT']."";
$rand_msg[] = ", ".$echo['weHave']." $count_new_news ".$echo['newArticlesSLT']."";
$rand_msg[] = ", ".$echo['weHave']." $count_new_news ".$echo['newArticlesSLT']."";
}
if($todaynews == 0){
$rand_msg[] = ", ".$echo['noNewArticles']."";
$rand_msg[] = ", ".$echo['noNewArticles']."";
$rand_msg[] = ", ".$echo['noNewArticles2']."";
$rand_msg[] = ", ".$echo['noNewArticles2']."";
}
elseif($count_my_news == 0){
if($todaynews == 1){
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesNoneYours'];
}else{
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesOfYours']." $count_my_news.";
}
}
elseif($count_my_news == $todaynews){
if($count_my_news == 1){
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYouWroted'];
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYouWroted'];
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYouWroted'];
}else{ $rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYouWrotedAll'];
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYouWrotedAll'];
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticles'].". ".$echo['addNew1']."".$echo['addNew2'];
}
}
else{
if($count_my_news == 1){ $rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesYours1']; }
else{ $rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['newArticlesOfYours']." $count_my_news."; }
}
$rand_msg[] = $echo['wuouldYouLikeAdd'];
$rand_msg[] = ", ".$echo['weHaveToday']." $todaynews ".$echo['allOfArticles']." $stats_news.";
if($member_db[9] != ""){
$rand_msg[] = ", ".$echo['lastLogin']." ".langdate("d M Y H:i:s", $member_db[9])."";
$rand_msg[] = ", ".$echo['lastLogin']." ".langdate("d M Y H:i:s", $member_db[9])."";
}
$rand_msg[] = "";
srand((double) microtime() * 1000000);
echo $rand_msg[rand(0, count($rand_msg)-1)]." | ||||
| ".$echo['warningArchive1']." (".langdate("d M Y H:i:s", $member_db[9]).")".$echo['warningArchive2']."".$echo['warningArchive2']." | ||||
| ".$echo['freeSpace1']." $freespace ".$echo['freeSpace2']." | ||||
|
".$echo['install']."".$echo['install2']." | ||||
| ".$echo['safeSkin1']." '$config_skin', ".$echo['safeSkin2']." | ||||
| ".$echo['phpTooOld']." | ||||
".$echo['statistics']." |
".$echo['sysCheck']." |
|||
| ".$echo['active']." | $stats_news | ".$echo['folderWritable']." news.txt | "; if(is_writable("./data/news.txt")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |
| ".$echo['postponed']." | $count_postponed_news | ".$echo['folderWritable']." postponed_news.txt | "; if(is_writable("./data/postponed_news.txt")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |
| ".$echo['unactive']." | "; if($count_unapproved_news > 0){ echo"$count_unapproved_news"; }else{ echo"$count_unapproved_news"; } echo" | ".$echo['folderWritable'].$echo['unactiveWriteable']." | "; if(is_writable("./data/unapproved_news.txt")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |
| ".$echo['activeComments']." | $count_comments | ".$echo['folderWritable']." comments.txt | "; if(is_writable("./data/comments.txt")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |
| ".$echo['archive']." | $stats_archives | ".$echo['folderWritable']." users.db.php | "; if(is_writable("./data/users.db.php")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |
| ".$echo['users']." | $stats_users | ".$echo['folderWritable'].$echo['archiveDir']." | "; if(is_writable("./data/archives")){ echo "".$echo['sayYes'].""; } else{ echo "".$echo['sayNo'].""; } echo" | |