WXforum.net
May 20, 2013, 12:56:34 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6609  •  Posts: 178313  •  Topics: 18104
Please welcome TargY, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Multiple Cities for NWS Forecast Script  (Read 318 times)
0 Members and 1 Guest are viewing this topic.
Farmtalk
Fitzweather
Forecaster
*****
Offline Offline

Posts: 3488



WWW
« on: July 31, 2012, 09:09:20 AM »

The page that Ken has for downloading the NWS forecast script has multiple cities to choose from on the forecast because of a drop down menu..I added some towns that I wanted, and include the following script into my webpage but when I tested it out, there is no dropdown or anything for displaying the other towns?? Is there something I'm doing wrong??

Quote
<?php
$doIncludeNWS = true;
include("advforecast2.php"); ?>

www.fitzweather.com/index.php
Logged

"Make it simple but significant"

Administrator- www.fitzweather.com
Administrator- www.triviacre.com
CNYWeather
Forecaster
*****
Offline Offline

Posts: 1386



WWW
« Reply #1 on: July 31, 2012, 09:34:26 AM »

The dropdown comes from Settings.php

Do you have that uploaded to your site also?
Logged

Farmtalk
Fitzweather
Forecaster
*****
Offline Offline

Posts: 3488



WWW
« Reply #2 on: July 31, 2012, 09:57:29 AM »

No I dont, how do I get that???
Logged

"Make it simple but significant"

Administrator- www.fitzweather.com
Administrator- www.triviacre.com
Curly
Forecaster
*****
Offline Offline

Posts: 476


WWW
« Reply #3 on: July 31, 2012, 10:18:06 AM »

If you are not using the Saratoga Base template, just use include advforecast2.php. You don't need $doIncludeNWS = true;
You will need to un-comment the $NWSforecasts array.
« Last Edit: July 31, 2012, 10:29:33 AM by Curly » Logged
neondesert
Forecaster
*****
Offline Offline

Posts: 628



WWW
« Reply #4 on: July 31, 2012, 10:24:10 AM »

The page that Ken has for downloading the NWS forecast script has multiple cities to choose from on the forecast because of a drop down menu..I added some towns that I wanted, and include the following script into my webpage but when I tested it out, there is no dropdown or anything for displaying the other towns?? Is there something I'm doing wrong??

Quote
<?php
$doIncludeNWS = true;
include("advforecast2.php"); ?>

www.fitzweather.com/index.php

In order to get the drop down menu to display you have to make a change in advforecast2.php

In the Settings section you will see this code:
Code:
// ----------------------SETTINGS---------------------------------------------

// V3.00 -- this following array can be used for multiple forecasts in standalone mode
//  for template use, add a $SITE['NWSforecasts'] entry in Settings.php to have these entries.
//  to activate the definitions below, replace the /* with //* to uncomment the array definition
/*
$NWSforecasts = array(
 // the entries below are for testing use.. replace them with your own entries if using the script
 // outside the AJAX/PHP templates.
 // ZONE|Location|point-forecast-URL  (separated by | characters
"CAZ513|Saratoga, CA (WRH)|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"PAZ061|Omaha, NE (CRH)|http://forecast.weather.gov/MapClick.php?CityName=Allentown&state=PA&site=MTR&textField1=40.5535&textField2=-75.6032&e=1&TextType=2",
"ALZ064|Gulf Shores, AL (SRH)|http://forecast.weather.gov/MapClick.php?CityName=Gulf+Shores&state=AL&site=MOB&textField1=30.27&textField2=-87.7015&e=0&TextType=2",
'MDZ022|Salisbury, MD (ERH)|http://forecast.weather.gov/MapClick.php?lat=38.36818&lon=-75.59761047363281&unit=0&lg=english&FcstType=text&TextType=2',
'AKZ101|Anchorage, AK (ARH)|http://forecast.weather.gov/MapClick.php?lat=61.21806&lon=-149.90027780000003&unit=0&lg=english&FcstType=text&TextType=2',
'HIZ005|Honolulu, HI (HRH)|http://forecast.weather.gov/MapClick.php?lat=21.30694&lon=-157.85833330000003&unit=0&lg=english&FcstType=text&TextType=2',
);
//*/

Near the top, where it reads $NWSforecasts = array( , right above this there is a /*   
Just add an extra forward slash so it looks like this //*

This will uncomment the array definition.  Then all you need to do is add the info for the areas you would like in your drop down selector.

** Curly was responding at the same time as me.  He is stating the same thing, I just wanted to give you a little more detail on what steps you need to take.  Wink
Logged

Larry
"But it's a DRY Heat!"

Farmtalk
Fitzweather
Forecaster
*****
Offline Offline

Posts: 3488



WWW
« Reply #5 on: July 31, 2012, 10:31:19 AM »

Thanks Larry and Curly!! Got it to work!!!

www.fitzweather.com/advforecast2.php
Logged

"Make it simple but significant"

Administrator- www.fitzweather.com
Administrator- www.triviacre.com
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.102 seconds with 18 queries.
anything