include "_header.php"; function write_to_log($s){ $fn="common/local/logs/modified_headers.txt"; $fp=fopen($fn, 'a'); fwrite($fp,str_pad(date("Y-m-d h:i a"), 22).$s); fclose($fp); } @unlink('common/local/logs/modified_headers.txt'); function CheckModifiedHeaders($lastModified) { if(function_exists('getallheaders')){ $headers = getallheaders(); if(!empty($headers['If-Modified-Since'])) { $arraySince = explode(";", $headers['If-Modified-Since']); $lastVisit= strtotime($arraySince[0]); if($lastVisit >= $lastModified){ while (@ob_end_clean()); header("HTTP/1.1 304 Not changed"); header("Last-Modified: " . gmdate("D, d M Y H:i:s",$lastModified) . " GMT"); header("Connection: close"); exit; } } } } if(isset($_GET['photo'])){ $id=$_GET['photo']; } elseif(isset($_GET['id'])){ $id=$_GET['id']; } $id=floor($id); $sql=" SELECT *, UNIX_TIMESTAMP(gravestone.lastview) as lv, UNIX_TIMESTAMP(dt_submit) as ds, UNIX_TIMESTAMP(dt_updated) as du, cemName FROM gravestone,cemeteries,countylist WHERE entryid=$id and cemID=cemeteryID and cemCID=CID and CID=CountyID "; $result = mysql_query($sql) or die("Query failed"); $row = mysql_fetch_assoc($result); $image_path=$row['CT_PhotoPath']; $updated=$row['du']; if($row['du']==0)$updated=$row['ds']; CheckModifiedHeaders($updated); header("Cache-Control: public"); header("Cache-Control: max-age=360"); header("Last-Modified: " . gmdate("D, d M Y H:i:s",$updated) . " GMT"); $_VAR['META_DESCRIPTION']=$row['first']." ".$row['last']; $_VAR['META_DESCRIPTION'].=" - ".$row['CT_Name']." County ".$_VAR['STATE_NAME'].' - '; $_VAR['META_DESCRIPTION'].=preg_replace('/\s+/', ' ',strip_tags($row["comments"])); function dot($s,$l=22){ if(strlen($s)>$l){ return trim(substr($s,0,$l)).' ...'; } else { return $s; } } $htitle=$row['last'].", ".$row['first']." - ".$row['CT_Name'].", ".$_VAR['STATE_NAME']; $hkey=$row['CT_Name'].", ".$row['last'].", ".$row['first']; if(!isset($_GET['printer_friendly'])){ //DrawHeader($htitle,$hkey,'','index, follow'); DrawHeader($htitle,$hkey,''); } else { print "\n"; print "
";
startFrame(230);
if(!empty($_VAR['STATE_GENWEB_URL']) || !empty($_VAR['CT_HomePage'])){
print "Recommended Links\r\n"; if(!empty($row['CT_HomePage'])) echo "- {$row['CT_Name']} Tyrone Link \r\n"; } // end $sql="select * from gravestone where entryid<>{$row['entryid']} and approved='Y' and "; $sql.=" last='".mysql_escape_string($row['last'])."' "; $sql.="and CID={$row['CID']} limit 11"; $result = mysql_query($sql); if(mysql_num_rows($result)>0){ print " Similar Parish Records\r\n"; $count++; } if(mysql_num_rows($result)>$count) echo "- More... "; echo " "; } else { $sql="select * from gravestone where approved='Y' and entryid<>{$row['entryid']} "; $sql.="and last='".mysql_escape_string($row['last'])."' limit 11"; $result = mysql_query($sql); if(mysql_num_rows($result)>0){ print " More "{$row['last']}" Entries"; $count++; } if(mysql_num_rows($result)>$count) echo "- More... "; } } if(file_exists("photos/gpplinks.html")){ print " Gravestone Photo Links |
} // END LEFT COLUMNS
print "";
if(!isset($_GET['printer_friendly'])){
print " ";
print "";
print "";
print " ";
print "";
} else {
print ""; if(file_exists($_VAR['ROOT_PATH'].'/common/local/main_logo.html')){ include $_VAR['ROOT_PATH'].'/common/local/main_logo.html'; } else { print ""; } } if($row['approved']!='Y') echo " This photo is pending approval from the county coordinator. ";
?>
|