$menulink_maxcols = 3;
function isspider()
{
global $HTTP_USER_AGENT;
$spiders = array(
"^Googlebot/.*",
"Mediapartners-Google",
"^Lycos_Spider_.*",
"^UdmSearch/*",
"_Murcator_*",
);
while(list($key, $val) = each($spiders))
if (ereg($val, $HTTP_USER_AGENT))
return 1;
return 0;
}
function lastmod()
{
global $callfile, $real_callfile;
if (isset($real_callfile))
$c = $real_callfile;
else
$c = $callfile;
$c = ereg_replace("^/~shane/","/home/shane/public_html/", $c);
if (file_exists($c))
$f = $c;
else
trigger_error("$callfile does not exist", E_USER_ERROR);
$l1 = filemtime($f);
$l2 = filemtime("/home/shane/public_html/shared.inc");
return ($l1 >= $l2) ? $l1 : $l2;
}
function menulink($url, $title)
{
global $menulink_col, $menulink_maxcols;
if (!$menulink_col)
echo("
\n");
echo("| $title | \n");
$menulink_col++;
if ($menulink_col == $menulink_maxcols)
{
echo("
\n\n");
$menulink_col = 0;
}
}
function htmlheader()
{
global $callfile, $title, $meta, $rawmode;
global $menulink_col, $menulink_maxcols;
global $basehref;
?>
if (!empty($basehref))
echo "\n";
if (ereg("^/~shane/lists/.*/", $callfile))
echo("$title\n");
else
echo("$title\n");
?>
if (!$meta)
array($meta);
if (!$meta["author"])
$meta["author"] = "Shane Wegner";
while(list($key, $val) = each($meta))
echo("\n");
?>
menulink("/~shane/", "Top");
if ($callfile == "/~shane/index.html" || (!isspider() && !$rawmode)) {
menulink("/~shane/whatsnew.html", "What's New");
menulink("/~shane/projects.html", "Projects");
#menulink("/~shane/cgi-bin/story.cgi", "Interactive Story");
menulink("/~shane/lists/", "Mail Archives");
#menulink("/~shane/resume.html", "Resume");
menulink("/~shane/links.html", "Links");
#menulink("/~shane/guestbook.html", "Sign GuestBook");
#menulink("/~shane/guestbook.html?action=browse", "View GuestBook");
#menulink("/~shane/search.html", "Search");
#menulink("/~shane/pgp.html", "PGP Keys");
menulink("mailto:%73%68%61%6e%65%40%63%6d%2e%6e%75", "Contact Me");
}
if ($menulink_col < $menulink_maxcols)
echo("\n");
?>
# Certain lists are moving over to mailarchive.ca
$movelists = array(
'alt.music.celine-dion',
'comp.dcom.telecom.tech',
'comp.dcom.xdsl',
'comp.mail.sendmail',
'comp.periphs.scsi',
'rec.arts.startrek.current',
'rec.arts.startrek.misc',
'rec.arts.startrek.tech',
);
reset($movelists);
while(list($k, $v) = each($movelists)) {
if (preg_match("/~shane\/lists\/($v.*)$/", $callfile, $m)) {
$listurl = $m[1];
break;
}
}
if (!empty($listurl)) {
$listurl = preg_replace("/^([a-z0-9.-]+)\/index\.html/", "menu.phtml/$1/", $listurl, 1);
#echo "This list is moving to ".
#"www.mailarchive.ca
.\n";
}
}
function listsearch()
{
global $callfile;
return;
if (!isspider() && ereg("^/~shane/lists/(.*)/(....)-(..)/", $callfile, $regs)) {
?>
Search functions
}
}
function mangle_email($s)
{
$r = '';
for ($i = 0; $i < strlen($s); $i++) {
$c = substr($s, $i, 1);
$r .= sprintf("%%%02x", ord($c));
}
return $r;
}
function htmlfooter()
{
global $callfile, $rawmode;
$email = sprintf("shane-dated-%d@csy.ca",
time()+604800);
if (!ereg("^/~shane/lists/.*/", $callfile) &&
!isspider() && !$rawmode) {
?>
If you have any comments, questions, or suggestions regarding this page, please
feel free to