Stuck trying Update to Ver 3 of Kens templates

Greetings Ken:
My dense brain has me stuck. Here: www.tristate-weather.com I can’t get the forecast to work.
I guess I don’t understand this statement in the settings.php file that state:
//in the following section, enable settings for ONE primary forecast organization
// pick which script AND org are to be used for your forecast here: (last uncommented pair will
// be the ones used on the wxforecast.php page and in your dashboard and sidebar
Everything I have tried I make matters worse.

How do I center my logo in the header.php file?

Somehow I broke the mesomap for the MWEST. Didn’t think I touched anything, but apparently an update file changed something I can’t find.

Thanks for the assistance and for maintaining these.

Sorry you’re having issues with the update to V3 :frowning:

I’d suggest changing the forecast URL of

$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "INZ087|Newburgh|http://forecast.weather.gov/MapClick.php?lat=37.943935120058626&lon=-87.3962801904297",

to

$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "INZ087|Newburgh|http://forecast.weather.gov/MapClick.php?lat=37.94449&lon=-87.40528649999999&unit=0&lg=english&FcstType=text&TextType=2",

as that is the point-printable forecast link you need to use. You can also remove the rest of the entries

"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",

since I doubt your visitors will be interested in my Northern California forecasts :slight_smile:

The logo centering can be done by changing header.php from

        <a href="index.php" title="Browse to homepage"><img src="tristate1.jpg" alt="Tristate-Weather.com" border="none" /></a>

to

        <a href="index.php" title="Browse to homepage"><img src="tristate1.jpg" alt="Tristate-Weather.com" style="border-style: none; margin-left: 50px;" /></a>

The 50px is one half the difference between the width of the page in narrow aspect (800px) and the width of your image (700px) … it won’t be centered if you allow use of the wide aspect with this method.

For your MWWN.php page, I see an error

Fatal error: Call to undefined function curl_fetch_file() in /virtual/users/e15346-16062/web/MWWN.php on line 58
… The MWWN doesn’t use cUrl at all, so it must be the code on the MWWN page itself. I suggest you change it to something like

<?php
$doPrintMWWN = false;
include("MWWN-mesomap.php");
print $MWWN_CSS; ?>

somewhere before the part of the page, and

<table width="99%">
<tr><td align="center">
<table width="620">
<tr><td style="text-align:left">
<?php print $MWWN_MAP; ?>
</td></tr>
<tr><td>
<?php print $MWWN_TABLE; ?>
</td></tr>
</table>
</td></tr>
</table>

as the content between the

tags.

Hope this helps…

Best regards,
Ken

Thank you Ken.
Where did you find this link:
http://forecast.weather.gov/MapClick.php?lat=37.94449&lon=-87.40528649999999&unit=0&lg=english&FcstType=text&TextType=2",

I clicked on a dozen maps and didn’t get a link formated like that on any of them! :smiley:

Easy,

go to www.weather.gov
search for your town by name, state or zip code
view the resulting page…
Look for the ‘Printable Forecast’ link near the bottom of the page … that’s the URL you need.

It will also work if you start with www.weather.gov and click through the map to find your city/area of interest. Then use the ‘Printable Forecast’ link at the bottom of the page for the URL you need to use.

Best regards,
Ken

Must of missed that tidbit in the instructions.

Thanks again sir!

Me again.

Updated a friends site to ver3.
Getting an error at the top of the home page I’m not able to cure.
www.tristateweather.net
Assistance please.
Thank you once again!

Have you uploaded the ./cache/ directory to your site?

Running http://www.tristateweather.net/check-fetch-times.php shows that the cache/ directory is not writable.

–checking NWS Forecast URL –
URL: http://forecast.weather.gov/MapClick.php?CityName=Boonville&state=IN&site=PAH&textField1=38.0451&textField2=-87.2737&e=0&TextType=2
Cache: ./cache/forecast.txt
GET /MapClick.php?CityName=Boonville&state=IN&site=PAH&textField1=38.0451&textField2=-87.2737&e=0&TextType=2 HTTP/1.1
Host: forecast.weather.gov Port: 80 IP=107.14.42.65
HTTP stats: dns=0.001 conn=0.001 put=0.000 get(39 blocks)=0.005 close=0.000 total=0.007 secs
fetch function elapsed= 0 secs.
RC=200 OK, bytes=5878
Error: Unable to write to ./cache/forecast.txt file.
–end NWS Forecast URL check –

–checking NWS Warning Zone ATOM/CAP Feed –
URL: http://alerts.weather.gov/cap/wwaatmget.php?zone=INZ087
Cache: ./cache/atom-advisory-INZ087.txt
GET /cap/wwaatmget.php?zone=INZ087 HTTP/1.1
Host: alerts.weather.gov Port: 80 IP=140.90.113.231
HTTP stats: dns=0.000 conn=0.042 put=0.000 get(10 blocks)=0.108 close=0.000 total=0.151 secs
fetch function elapsed= 1 secs.
RC=200 OK, bytes=250
Error: Unable to write to ./cache/atom-advisory-INZ087.txt file.
–end NWS Warning Zone ATOM/CAP Feed check –

–checking UV Forecast from temis.nl –
URL: http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-87.27505&lat=38.05218
Cache: ./cache/uv-forecast.txt
GET /uvradiation/nrt/uvindex.php?lon=-87.27505&lat=38.05218 HTTP/1.1
Host: www.temis.nl Port: 80 IP=145.23.254.72
HTTP stats: dns=0.000 conn=0.120 put=0.000 get(226 blocks)=1.129 close=0.000 total=1.250 secs
fetch function elapsed= 1 secs.
RC=200 OK, bytes=5653
Error: Unable to write to ./cache/uv-forecast.txt file.
–end UV Forecast from temis.nl check –


If there is already a cache/ directory on your site, you may have to use the site’s cPanel to change the directory permissions to 766 or 776 to have the PHP scripts be able to use the cache files.

Best regards,
Ken

Thank you Ken.
I had set the files in the cache to 775, but I had not set the cache directory to 775.
That fixed it.
Thanks!! :smiley: