$page = $_SERVER['PHP_SELF'];
$dirs = explode('/', $page);
$curpage = $dirs[3];
if($curpage !== "index.php"){
$dotpos = strpos($curpage, '.');
$lnkpage = substr($curpage, 0, $dotpos);
// replace any _## in the string
$pattern = "/_[0-9][0-9]/";
$lnkpage = preg_replace($pattern, "", $lnkpage);
$stnpage = '(' . $lnkpage . ')';
// create links to the archived images
$arch24 = $lnkpage . '_24.php';
$arch48 = $lnkpage . '_48.php';
// create links to the current and archive files
$current = "
Current";
$hour_24 = "
24 hours";
$hour_48 = "
48 hours";
$arch_div = '
' . $current . $hour_24 . $hour_48 . '
';
}
else{
// create links to the archived images
$arch24 = REF_EHZ_AV . '_24.php';
$arch48 = REF_EHZ_AV . '_48.php';
// create links to the current and archive files
$current = "
Current";
$hour_24 = "
24 hours";
$hour_48 = "
48 hours";
$arch_div = '
' . $current . $hour_24 . $hour_48 . '
';
}
?>
Redoubt echo $stnpage, $arch_div ?>