/*
Left-hand menu
Bill Adams (bill (AT) evil.inetarena.com)
This should be "required" from another php program.
License: GNU LGPL.
*/
// First, figure out who we are sans the path and extension. This
// will be used in "footer.php3" in addition to this file.
if (ereg("/(.*)\.php3", $PHP_SELF, $regs)) { $iam = $regs[1]; }
//print "I am '$iam'
\n";
/*
This is the array that defines the menu bar. Each of the keys
needs to match the string returned from "$iam" so that
the code below knows to not make a link. The 'name' is
the text that appears between the tags and
the link is, well, the link in the part of
the tag. Entries that start with a plus '+', get that many
(non-breakable spaces) in front of them. The
'breakNN' puts a bit of space between the menu items. Be sure
not to repeat the NN otherwise you will only get your first
break. You also have to set the value to 1 or it will not
show up.
*/
if( $move_down ){ echo "
\n"; }
$menubar = array(
'index' => array( 'name' => 'Main Page', 'link' => '/index.php3' ),
'linux' => array( 'name' => 'Linux', 'link' => '/linux.php3' ),
'news' => array( 'name' => 'News Links', 'link' => '/news.php3' ),
'web-resources' => array( 'name' => 'Web',
'link' => '/web-resources.php3' ),
'php3/index' => array( 'name' => 'PHP3',
'link' => '/php/index.php3' ),
'games' => array( 'name' => 'Game Links',
'link' => '/games/' ),
'break01' => 1,
'search_engines' => array( 'name' => 'Search',
'link' => '/search_engines.php3' ),
'+google' => array( 'name' => 'Google', 'link' => 'http://www.google.com/' ),
'break02' => 1,
'food' => array( 'name' => 'Food', 'link' => '/food.php3' ),
'+food1' => array( 'name' => 'Epicurious',
'link' => 'http://food.epicurious.com/e_eating/e02_recipes/recipes.html' ),
'+food2' => array( 'name' => 'S.O.A.R.',
'link' => 'http://soar.berkeley.edu/recipes/' ),
'break03' => 1,
'music' => array( 'name' => 'Music', 'link' => '/music.php3' ),
'+music1' => array( 'name' => 'BMG',
'link' => 'http://www.bmgmusicservice.com/' ),
'+music2' => array( 'name' => 'Play',
'link' => 'http://www.playfromcolumbiahouse.com/' ),
'break04' => 1,
'tv' => array( 'name' => 'TV/Movies', 'link' => '/tv.php3' ),
'break05' => 1,
#'otherhomepages' => array( 'name' => 'Home Pages',
# 'link' => 'otherhomepages.html' ),
'pdx' => array( 'name' => 'PDX', 'link' => '/pdx.php3' ),
'realestate' => array( 'name' => 'Real Estate',
'link' => '/realestate.php3' ),
'funny' => array( 'name' => 'Funny', 'link' => '/funny.php3' ),
'health' => array( 'name' => 'Health', 'link' => '/health.php3' ),
'travel' => array( 'name' => 'Travel', 'link' => '/travel.php3' ),
'stores' => array( 'name' => 'Stores', 'link' => '/stores.php3' ),
'misc' => array( 'name' => 'Misc.', 'link' => '/misc.php3' ),
'break06' => 1,
'about' => array( 'name' => 'About This Site', 'link' => '/about.php3'),
'break' => 1
);
?>
// Here we put all of the text and links on the page.
$skip_em = 0;
//Extra info to remember
$extra_info = '';
if( $menu_right ){
$extra_info .= 'menu_right=1';
}
while( list( $key, $info ) = each( $menubar )) {
if( $info == 1 ) { #Do we have a break?
echo " \n";
$skip_em = 0;
continue;
}
$bold_this = 1;
while( substr( $key, 0, 1 ) == '+' ) {
$bold_this = 0;
echo ' ';
$key = substr( $key, 1 );
}
if( $bold_this ) {echo '';}
if( $iam == $key ) {
echo $info["name"];
$skip_em = 1;
} else {
if( $bold_this ) { $skip_em = 0; }
if( ! $skip_em ) {
if( $extra_info ){
echo '',
$info["name"], '';
} else {
echo '', $info["name"], '';
}
$skip_em = 0;
}
}
if( $bold_this ) echo '';
if( ! $skip_em or $bold_this) echo "
\n";
}
?>