//SHOW LAST WEEK ARCHIVE $unixNow = strtotime("now"); $unixNextweek = strtotime ("+1 week"); $unixOneweek = $unixNextweek - $unixNow; $unixLastweek = $unixNow - $unixOneweek; $lastweek = getdate($unixLastweek ); if ($lastweek['mday'] < 10) { $daynum = "0".$lastweek['mday']; } else { $daynum = $lastweek['mday']; } if ($lastweek['mon'] < 10) { $montnum = "0".$lastweek['mon']; } else { $montnum = $lastweek['mon']; } $lastweekarchive = "/home/public_html/PATH/TO/ARCHIVES/".$lastweek['year']."_".$montnum."_".$daynum.".php"; if (file_exists($lastweekarchive)) { echo "
This day a week ago: "; echo $montnum."/".$daynum."/".$lastweek['year']."
"; } //SHOW LAST MONTH ARCHIVE $today = getdate(); $this_month = $today['mon']; $this_day = $today['mday']; $this_year = $today['year']; if ($this_month == "1") { $last_month = "12"; $this_year = $this_year-1; } else { $last_month = $this_month-1; } if ($this_day < 10) { $this_day = "0".$this_day; } if ($last_month < 10) { $last_month = "0".$last_month; } $lastmontharchive = "/home/public_html/PATH/TO/ARCHIVES/".$this_year."_".$last_month."_".$this_day.".php"; if (file_exists($lastmontharchive)) { echo "This day a month ago: "; echo $last_month."/".$this_day."/".$this_year."
"; } ?>