A
tongue in cheek review of
the news published this week regarding Wise County. Normally
posted every Sunday
before 10:00 p.m. unless I'm lazy.
//$dirName = "C:\Documents and Settings\Barry\My Documents\Hold Wisecountysports";
$dirName = "/home/users/web/b666/apo.greenbsg/thespin";
$dp = opendir($dirName);
chdir($dirName);
$i = 0;
while ($currentFile !== false)
{
$currentFile = readDir($dp);
if (is_numeric (substr($currentFile, 0, 6))) //ALL MY SPIN FILES BEGIN WITH SIX CHARACTERS OF THE DATE PUBLISHED
{
//Loading the array but I want the Year in Front for easy sorting later
$myYear = substr($currentFile, 4, 2);
$arrayOfFiles[] = $myYear . $currentFile;
}
}
$howManyTimesHaveIDoneThis = count($arrayOfFiles);
print "
THE ARCHIVES OF $howManyTimesHaveIDoneThis SPINS
";
//===========================
//ADDED A SEARCH BOX FOR GOOGLE FOR THE SPIN
//============================
Print <<
only search WISECOUNTY.COM
HERE;
//NOW WE WILL WORK WITH THE ARRAY BY FIRST SORTING IT BY DATE (WHICH IS WHY I PUT THE YEAR FIRST)
sort($arrayOfFiles);
foreach ($arrayOfFiles as $fileToLink)
{
//now i have to ignore the first two characters to get format of mm/dd/yy
$myMonth = substr($fileToLink, 2, 2);
$myDay = substr($fileToLink, 4, 2);
$myYear = substr($fileToLink, 6, 2);
$myCompleteDate = $myMonth ."/" . $myDay . "/" . $myYear;
//now to rip off first two characters to get legitimate html
$trueLink = substr($fileToLink, 2, 11);
Print "Link for $myCompleteDate ";
}
?>