getVarString("la",5,$cfgdeflang); // from language, set content directory if ($lang==$cfgdeflang) { $contentdir = $cfgdeflangdir; // $langsuffix is used in photo albums and topmenu, bottommenu, leftcol, and rightcol to allow for different languages for title, desc., keywords, etc. $langsuffix = ""; } else { $contentdir = "content-" . $lang; $langsuffix = "-" . $lang; } // get other querystring variables $page = $req->getVarFileName("p",40,1,$cfgdefhomepage,0); $ext = $req->getVarFileName("e",5,1,"txt",0); $pagepath = $contentdir . "/body/" .$page . "." . $ext; // allow for use of .php for security in addition to .txt without having to use e query varible $pagepathphp = $contentdir . "/body/" .$page . ".php"; // decide which text file to use, .txt or .php if (file_exists($pagepathphp)) { $pagepathtouse = $pagepathphp; $lastmoddate = filemtime($pagepathtouse); } else { if (file_exists($pagepath)) { $pagepathtouse = $pagepath; $lastmoddate = filemtime($pagepathtouse); } else { $pagepathtouse = "None"; $lastmoddate = filemtime("index.php"); } } // cs 9-13-09 allow for dirrect content directories for different languages $keywordspath = $contentdir . "/keywords/" .$page . "_keywords.txt"; $titlepath = $contentdir . "/title/" .$page . "_title.txt"; $descpath = $contentdir . "/description/" .$page . "_desc.txt"; $stylepath = $contentdir . "/styles/" . $page . ".css"; // cs 9-7-09 add ability to have custom top, bottom, left column, and right column for a given page $pagetoppath = $contentdir . "/pagetop/" . $page . "_top.inc"; $pagebottompath = $contentdir . "/pagebottom/" . $page . "_bottom.inc"; $pageleftcolpath = $contentdir . "/pageleftcol/" . $page . "_leftcol.inc"; $pagerightcolpath = $contentdir . "/pagerightcol/" . $page . "_rightcol.inc"; ?> getVarFileName("a",40,1,"",0); if ($album!="") { // cs 9-13-09 allow for albums to be shown in different languages. // Default lang uses keywords.txt, desc.txt, title.txt; other langs use for example keywords-de.txt, desc-de.txt, title-de.txt $keywordspath = "img/albums/" .$album . "/keywords" . $langsuffix . ".txt"; $titlepath = "img/albums/" .$album . "/title" . $langsuffix . ".txt"; $descpath = "img/albums/" .$album . "/desc" . $langsuffix . ".txt"; $albumpage = $req->getVarInt("ap",1); $albumpagecsvfile = "img/albums/" .$album . "/" . $albumpage . ".csv"; if (file_exists($albumpagecsvfile)) { // as rough estimate of last mod date use .csv file for this page; tbd: make more accurate and figure in title, description, portion of photos.php page that matters, keywords, etc. $lastmoddate = filemtime($albumpagecsvfile); } } break; case "archives": // check for archives page and figure news archives include into last mod date $newsarchivesfile = $contentdir . "/inc/newsarchives.inc"; if (file_exists($newsarchivesfile)) { $lastmoddatena = filemtime($newsarchivesfile); if ($lastmoddatena>$lastmoddate) { $lastmoddate = $lastmoddatena; } } break; // all three coffee break pages use the coffee break include file case "coffee-break-fire-training": case "coffee-break-is-training": case "hot-coffee-fire-training": // check for coffee break include and figure that into last mod date $coffeebreakincfile = $contentdir . "/inc/coffee-break.inc"; if (file_exists($coffeebreakincfile)) { $lastmoddatena = filemtime($coffeebreakincfile); if ($lastmoddatena>$lastmoddate) { $lastmoddate = $lastmoddatena; } } break; case "weather": // check for weather which updates all the time $lastmoddate = time(); break; case "search": // search pages have more query parameters; example: zoom_query=rockwood&zoom_page=2&zoom_per_page=10&zoom_and=0&zoom_sort=0 $lastmoddate = time(); $zoom_page = $req->getVarInt("zoom_page",1); $zoom_per_page = $req->getVarInt("zoom_per_page",10); $zoom_and = $req->getVarInt("zoom_and",1); $zoom_sort = $req->getVarInt("zoom_sort",0); $zoom_query = $req->getVarString("zoom_query",60,""); // tbd: do zoom_cat too break; default: // end switch on $page } // roughly check for .csv use and include those into last mod date // tbd: account for other table use too $posstablename = $contentdir . "/tables/" . $page . ".csv"; if (file_exists($posstablename)) { $lastmoddateta = filemtime($posstablename); if ($lastmoddateta>$lastmoddate) { $lastmoddate = $lastmoddateta; } } $robotspath = $contentdir . "/robots/" .$page . "_robots.txt"; // Calculate page being viewed. Used in footer and social bookmarking: // make sure ampersands are escaped so XHTML validates // hackers try to abuse this so change: // $viewingthispage = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; // $viewingthispage = htmlspecialchars($viewingthispage); // cs 9-13-09 generalize the URL - get it from configuration.inc file $viewingthispage = $cfgviewingthispage; $viewingqs = ""; //querystring $viewingqs = $viewingqs . "p=" . $page; if ($page=="photos") { if ($album!="") { $viewingqs = $viewingqs . "&a=" . $album . "&ap=" . $albumpage; } } if ($page=="search") { // zoom_query=rockwood&zoom_page=2&zoom_per_page=10&zoom_and=0&zoom_sort=0 if ($zoom_query!="") { $viewingqs = $viewingthispage . "&zoom_query=" . $zoom_query . "&zoom_page=" . $zoom_page . "&zoom_per_page=" . $zoom_per_page . "&zoom_and=" . $zoom_and . "&zoom_sort=" . $zoom_sort; } } // make canonical url if ($viewingqs!="") { $viewingthispage = $viewingthispage . "?" . $viewingqs; } $viewingthispagecanonical = $viewingthispage; if ($lang!=$cfgdeflang) { // cs 9-13-09 not default language, add on lang parameter $viewingthispagecanonical = $viewingthispage . "&la=" . $lang; } // put lang in query string for all urls $viewingthispage = $viewingthispage . "&la=" . $lang; ?> "; if ($page=="photos") { if ($album!="") { echo "page " . $albumpage . ", "; // get date last modified of this album page, that is, the .csv for it } } include_once($titlepath); echo "--" . $cfgdeftitle ."\n"; } else { ?> <? echo $page . "--" . $cfgdeftitle; ?> \n"; } else { ?> " /> \n"; } else { ?> " /> "; } else { ?>