Here's my menubar.php with Ken's script. I have a few different things in there, but this gives you an idea Bob.
<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Base-USA template set)
############################################################################
#
# Project: Sample Included Website Design
# Module: menubar.php
# Purpose: Provides the menubar for the system
# Authors: Kevin W. Reed <kreed@tnet.com>
# TNET Services, Inc.
# Ken True <webmaster@saratoga-weather.org>
# Saratoga-Weather.org
#
# Copyright: (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
############################################################################
# This document uses Tab 4 Settings
############################################################################
//Version 1.01 - 28-Jul-2012 - added support for nws-alerts scripts
require_once("Settings.php");
require_once("common.php");
include_once('usaextremes.php');
############################################################################
?>
<!-- menubar -->
<div class="doNotPrint">
<div class="leftSideBar">
<p class="sideBarTitle">Navigation</p>
<?php
// NOTE: when adding new links to the site, put them in as <li></li> entries in
// the <ul></ul> shown below. The order of the links is the order they appear
// in the left navigation menu.
// Be careful to only use html as shown below, otherwise the program that
// automatically shows which page you're on won't work quite right.
// Don't use single-quotes in the following area unless you prefix it with a
// backslash.
// Correct: "Steve\'s page"
// Wrong: "Steve's page" <=== this will cause a PHP error in menubar.php
//
// Be sure to include a title="..." tag so folks can see more info via a tooltip
// as they mouse over the link in the menu.
//Don't change the next line in any way
$html = '
<ul>
<li><a href="wxindex.php" title="Home">Home</a></li>
<li><a href="wxforecast.php" title="5-day Forecast">Forecast</a></li>
<li><a href="wxsimforecast.php" title="WXSIM Forecast">WXSIM Forecast</a></li>
<li><a href="wxradar.php" title="Radar">Radar</a></li>
<li><a href="wxadvisory.php" title="Watches, Warnings, Advisories">Advisories</a></li>
<li><a href="wxtrends.php" title="Daily weather statistics">Daily Stats</a></li>
<li><a href="wxgraphs.php" title="24, 72, & Monthly Graphs">Graphs</a></li>
<li><a href="wxastronomy.php" title="Sun and Moon Data">Astronomy</a></li>
<li><a href="wxlinks.php" title="Useful Links">Links</a></li>
<li><a href="wxabout.php" title="About This Site">About Us</a></li>
<li><a href="wxstatus.php" title="Station Status">Status</a></li>
</ul>
'; // end of links set for site. Don't change this line in any way
if (isset($SITE['flyoutmenu']) and $SITE['flyoutmenu']) {
global $FlyoutMenuText;
print "<div class=\"flyoutmenu\">\n";
print $FlyoutMenuText;
print "</div>\n";
} else {
gen_navlinks($html); // generate the links set with highlight for the current page
}
?>
<?php
if(isset($showSidebar) and $showSidebar) {
include_once("ajax-sidebar.php");
}
# Note: add other links and stuff to the left sidebar above the </div><!-- end leftSidebar -->
# as shown in the sample below.
# Keep in mind that the width allowed is about 110px
#
# if you don't want anything to appear extra here, just delete the lines
# <!-- external links -->
# down to and including
# <!-- end external links -->
?>
<!-- external links -->
<!-- NOAA Weather Radio from Weather Underground -->
<p class="sideBarTitle">NOAA Radio</p><br>
<a href="javascript:%20void(0)" onclick="window.open('http://www.wunderground.com/wxradio/smallplayer.html?stationid=thepathfinder100|575|2875', 'windowname1', 'width=325, height=225'); return false;" title="NOAA Weather Radio Live - click to listen"><img src="/images/NOAA-1.gif" width="100" height="85" border="1" alt="Link to Live NOAA Weather Radio" style="margin-left: 3px"/></a>
</ul>
<br>
<p class="sideBarTitle">Daylight Hours</p>
<div class="sideBarText" style="font-weight:lighter; font-size: 6.5pt; text-align: center; margin-bottom:-4px">
<?php
//Make piechart
$testtime = substr($hoursofpossibledaylight,0,2);
$testminute = substr($hoursofpossibledaylight,3,2);
$testminute=$testminute/60;
$testresult=$testtime+$testminute;
$testljus=round(($testresult/24)*100,1);
$testmorker=100-$testljus;
?>
<span class="thisPage" style="position: relative; font-weight:lighter">
<?php
$time_arr = explode(':', $hoursofpossibledaylight, 2);
echo (int)$time_arr[0] . " hrs " . (int)$time_arr[1] . " min";
echo '<br/>of Daylight Today<br/>';
?>
</span>
<img style="margin-top:4px" src="http://chart.apis.google.com/chart?chs=100x60&chma=0,0,0,0&chd=t:<?php echo $testmorker;?>,<?php echo $testljus;?>&cht=p3&chp=1.6&chf=bg,s,FFFFFF&chco=000000,FFFF19" alt="graph"/>
<br />
<span style="position:relative; float:left; margin-top:-36px; margin-left:18px; font-weight:lighter; color:#FFFFFF"> <!-- was -5 -->
<?php echo $testmorker . "%"; ?>
</span>
<span style=" position:relative; float:right; margin-top:-36px; margin-right:18px; font-weight:lighter; color:#000000"> <!-- was 5 -->
<?php echo $testljus . "%"; ?>
</span>
<span class="thisPage" style=" position:relative; font-weight:lighter; top:-8px">
<?php
echo '<br/>Which is <br/>';
$time_arr = explode(':', $changeinday);
if (substr($time_arr[0],0,1) != "-") { // -0 when getting shorter
echo (int)$time_arr[1] . " Min Longer";
} else {
echo (int)$time_arr[1] . " Min Shorter";
}
echo ('<br />Than Yesterday');
?>
</span>
</div> <br>
<br/>
<p class="sideBarTitle">USA Extremes</p>
<br />
<table align="center" cellspacing="0" cellpadding="0" border="0" width="90">
<tr>
<td align="center"><span style="font-size: 75%; color: black;">Past 24 hours</span></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><span style="font-size: 90%; font-weight:bold; color: red;">High Temp</span></td>
</tr>
<tr>
<td align="center"><span style="font-size: 80%; color: black;"><?php print $usahigh; ?></span></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><span style="font-size: 90%; font-weight:bold; color: blue;">Low Temp</span></td>
</tr>
<tr>
<td align="center"><span style="font-size: 80%; color: black;"><?php print $usalow; ?></span></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><span style="font-size: 90%; font-weight:bold; color: green;">Precipitation</span></td>
</tr>
<tr>
<td align="center"><span style="font-size: 80%; color: black;"><?php print $usaprecip; ?></span></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
<br />
<p class="sideBarTitle">Weather Links</p>
<ul>
<li><a href="http://www.weather.gov/" title="USA National Weather Service">NOAA/NWS</a></li>
<li><a href="http://www.erh.noaa.gov/er/bgm/index.php" title="Weather-Display Forum">NWS Binghamton</a></li>
<li><a href="http://www.wunderground.com/" title="Weather Underground">Weather Underground</a></li>
<li><a href="http://www.weather-watch.com/smf" title="Weather-Display Forum">Weather-Display Forum</a></li>
<li><a href="http://www.wxforum.net/index.php" title="Weather-Display Forum">WXForum</a></li>
</ul>
<br>
<br>
<!-- end external links -->
<?php if($SITE['allowThemeSwitch']) { // insert code for theme switcher ?>
begin Color Theme Switcher Plugin http://www.642weather.com/weather/scripts.php -->
<div class="thisPage" style="margin-left: 5px; font-weight: normal;">
<?php print_css_style_menu(1); ?>
</div>
<!-- end Color Theme Switcher Plugin http://www.642weather.com/weather/scripts.php -->
<?php } // end code for theme switcher ?>
</div><!-- end leftSidebar -->
</div><!-- end doNotPrint -->
<!-- end of menubar -->
<?php
if (isset($_REQUEST['show']) and strtolower($_REQUEST['show']) == 'settings') {
print "<!-- current settings\n" . htmlentities(print_r($SITE,true)) . " -->\n";
}
// generate navigation links script - Ken True - webmaster@saratoga-weather.org
function gen_navlinks($html) {
preg_match('|<ul>(.*)</ul>|is', $html, $betweenspan); // find the navigation div
$rawlinks = $betweenspan[1];
// Chop up each link and place in array
preg_match_all("/<li.*>(.*)<\/li>/Uis", $rawlinks, $betweenspan);
$links = $betweenspan[1];
$ourPage = $_SERVER['PHP_SELF'];
$doDebug = false;
echo "<!-- this page='$ourPage' -->\n";
if (isset($_REQUEST['page']) ) { // support testing
$ourPage = $_REQUEST['page'];
echo "<!-- using page='$ourPage' as test -->\n";
$doDebug = true;
}
if (isset($_REQUEST['debug']) ) { // support testing
$doDebug = true;
}
$t = pathinfo($ourPage); // extract base filename from link
if ($doDebug) {print "<!-- pathinfo\n" . print_r($t,true) . "-->\n"; }
$ourPage = $t['basename'];
// Now generate the code
print "<!-- navigation links -->\n";
print "<ul>\n";
foreach ($links as $i => $link) {
if (preg_match('|<a.*href="([^"]+)"[^>]*>(.*)</a>|i',$link,$matches) ) {
if($doDebug) { print "<!-- Matches for i=$i '$link': \n" . print_r($matches,true) . "-->\n"; }
//Matches: Array
//(
// [0] => <a href="index.php" title="Current Conditions/Home">Home</a>
// [1] => index.php
// [2] => Home
//)
if ($matches[1] == $ourPage) {
// we're on our page
print "<li><span class=\"thisPage\">" . langtransstr($matches[2]) . "</span></li>\n";
} else {
$t = langtransstr($matches[2]);
print "<li>" . str_replace($matches[2],$t,$matches[0]) . "</li>\n";
}
} else { // must be just text
print "<li>" . $link . "</li>\n";
} // end if has an <a href=
}
print "</ul>\n<!-- end of navigation links -->\n";
} // end of gen_navlinks function
?>