\n"; echo "\n"; echo "\n"; $atomlink = "$protocol://".$_SERVER["SERVER_NAME"]."/".$basedir.$rssdir."blog.php"; echo ""; echo "\t".$htmltitle."\n"; echo "\t".$blogtitle."\n"; echo "\thttp://".$_SERVER["SERVER_NAME"]."/".$basedir."\n"; $tiem = date(DATE_RFC2822, time()); echo "\t$tiem\n"; echo "\t$tiem\n"; $files = glob($_SERVER["DOCUMENT_ROOT"]."/".$basedir.$blogdir."*.post"); $guid = count($files); //sort by filename //initialize an array to house sort results $files2 = array(); $files2 = array_pad($files2,$guid,0); for ($i=0; $i<$guid; $i++) { $j = explode('-',basename($files[$i])); $j = $j[0]; $j = (int)$j; $j--; $files2[$j] = $files[$i]; } $slen = count($files2)-1; $ctr = 0; for ($i=$slen; $i>-1; $i--) { $shitpost=$files2[$i]; if ($ctr > 9) {break;}; $ctr++; $statz = stat($shitpost); $uid = $statz['uid']; $udata = posix_getpwuid($uid); $user = $udata['name']; $date = date(DATE_RFC2822, filemtime($shitpost)); $title = substr(strstr(basename($shitpost),'-'),1,-5); $contents = file_get_contents($shitpost); echo "\t\n"; echo "\t\t$title\n"; echo "\t\t\t\t\n"; echo "\t\thttp://teodesian.net/index.php?nav=8&post=".$shitpost."\n"; echo "\t\t$guid-teodesian.net\n"; echo "\t\t".$date."\n"; echo "\t\t".$user."\n"; echo "\t\n"; $guid--; } echo "\n"; echo ""; ?>