Can not open directory ./archives for reading, check if it exists or is properly CHMOD'ed"); }
    if(!is_readable("./data/news.txt")){ die("Error !!!
Can not open file news.txt for reading, check if it exists or is properly CHMOD'ed"); }
    if(!is_readable("./data/comments.txt")){ die("Error !!!
Can not open file comments.txt for reading, check if it exists or is properly CHMOD'ed"); }
// Some Stats
    $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;
    $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[] = ", we have $count_new_news new articles since your last login";
                $rand_msg[] = ", we have $count_new_news new articles since your last login";
                $rand_msg[] = ", we have $count_new_news new articles since your last login";
        }
            if($todaynews == 0){
                        $rand_msg[] = ", we don't have new articles today";
                        $rand_msg[] = ", we don't have new articles today, the first one can be yours.";
                }
        elseif($count_my_news == 0){
                if($todaynews == 1){
                                $rand_msg[] = ", today we have $todaynews new article{$s} but it is not yours";
            }else{
                                $rand_msg[] = ", today we have $todaynews new article{$s} but $count_my_news of them are yours";
                        }
        }
        elseif($count_my_news == $todaynews){
                if($count_my_news == 1){
                                $rand_msg[] = ", today we have $todaynews new article{$s} and you wrote it";
            }else{
                                $rand_msg[] = ", today we have $todaynews new article{$s} and you wrote all of them";
                                $rand_msg[] = ", today we have $todaynews new article{$s} and all are yours";
                                $rand_msg[] = ", today we have $todaynews new article{$s}, want to add some more?";
                        }
        }
        else{
                        if($count_my_news == 1){ $rand_msg[] = ", today we have $todaynews new article{$s}, 1 of them is yours"; }
                        else{ $rand_msg[] = ", today we have $todaynews new article{$s}, $count_my_news of them are yours"; }
        }
                $rand_msg[] = ", are you in a mood of adding some news?";
        $rand_msg[] = ", today we have $todaynews new article{$s}, from total $stats_news";
        if($member_db[9] != ""){
                $rand_msg[] = ", your last login was on ".date("d M Y H:i:s", $member_db[9]);
                $rand_msg[] = ", your last login was on ".date("d M Y H:i:s", $member_db[9]);
                }
        $rand_msg[] = "";
        srand((double) microtime() * 1000000);
                echo $rand_msg[rand(0, count($rand_msg)-1)]." | ||||
| Warning! According to CuteNews, your estimated free space is $freespace. Take action to enlarge your free space or some data files could be damaged during the writeing procedure. Backup your data now. | ||||
| Attention! CuteNews found that the installation module is still located in the /inc folder. Please delete or rename the /inc/install.mdu file for security reasons. | ||||
| Attention! CuteNews was unable to load the selected '$config_skin' skin, and automatically reverted to the default one. Please ensure that the proper skin files exists or select another skin. | ||||
| Attention! Your version of PHP ($phpversion) is too old. Please consider contacting your server administrator and updating to the latest stable PHP version. | ||||
| Some stats | System SelfCheck | |||
| Active News | $stats_news | Can write to news.txt | "; if(is_writable("./data/news.txt")){ echo "Yes"; } else{ echo "No"; } echo" | |
| Active Comments | $count_comments | Can write to comments.txt | "; if(is_writable("./data/comments.txt")){ echo "Yes"; } else{ echo "No"; } echo" | |
| Archives | $stats_archives | Can write to users.db.php | "; if(is_writable("./data/users.db.php")){ echo "Yes"; } else{ echo "No"; } echo" | |
| Users | $stats_users | Can write to archives dir | "; if(is_writable("./data/archives")){ echo "Yes"; } else{ echo "No"; } echo" | |
| News.txt Size | $stats_news_size | |||
| Comments.txt Size | $stats_comments_size | |||