$target not found or unreadable.\n

"); } $whole_page = file($target); // if the line contains a magic word, something special happens // normal lines are dumped to the page as they are foreach ($whole_page as $baseline){ if (substr($baseline, 0, 1) == ":"){ magicline(substr($baseline,1)); // cut of the ":" } else{ echo($baseline); } } } // well, actually this check if $page is a valid page request // either first, recent or a 8-digit number yyyymmdd. function check_page_format($page){ global $page_type; $page_type= 0; if (!$page || $page=="") $page="recent"; if ($page == "recent"){ $page = date_to_blogdate(find_previous(time() + SECS_IN_DAY)); } if ($page == "first"){ $page = date_to_blogdate(find_next(blogdate_to_date(first_year() . "0000"))); } if (strlen($page) == 8 && is_numeric($page)){ // page is a date $page_type = DAY; return $page; } if (strlen($page) == 4 && is_numeric($page)){ // page is a year $page_type = YEAR; return $page; } return($page); } function first_year(){ if (!($handle = opendir(ENTRYPATH))){ die("

Error opening folder" . ENTRYPATH . "

\n"); } while (false !== ($file = readdir($handle))) { if(is_numeric($file)){ return $file; // the first year must be this } } } ?>