1
mjz55
VLWeather - how to change default
  • 2008/5/25 15:27

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


How do you change the default city?

2
Nick_James
Re: VLWeather - how to change default

By modifying the Weather block!

1 Select Admin/Blocks
2 Then Select EDIT for the Weather block.
3 Under OPTIONS enter the 4 letter default ICAO station

So how do you find the weather station code?

If the block is up and running:
1 Go to the Weather block
2 Select CHANGE SETTINGS for the block from the menu.
3 Use the drop down menus to pick your weather station.
4 Your 4 digit weather code will be displayed.

======================================================
If you have not already installed the module:

1 Then edit the XOOPS_VERSION.PHP file
2 Line 36 has the code for setting the block options

Quote:
$modversion['blocks'][1]['options'] = "KSFO|both_imperial";


3 Change the station to the station you desire.
4 Then load the module.

To find your station:
1 Go to the SQL folder
2 Look in the vlweather.sql file for your station.

======================================================

Note:
If you are only after providing Weather for your local area and not for the world, trim that SQL file down to size. There is no point in installing 5,131 Weather stations if your users are only going to pick between 1 to 4 stations.

Why make it hard on them?

======================================================
Nicholas James
President - LaDads
http://www.ladads.info

3
mjz55
Re: VLWeather - how to change default
  • 2008/5/26 13:54

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Nick_James, thanks. I'm alot closer now. Just a few more tweeks.

1. If you go to my site at http://www.paconstables.org on the right side 3rd block down is the weather. If you click on change settings, select country, there are 13 more choices than the US. Where is that coming from? There is no note of them in the sql file or anywhere else I could find.

2.If you click on the weather link from the left side (last link), then click on forcast for your location, it pulls up dupage county, Il. Where is that coming from? And if you click on detailed conditions for your locations you get a "forbidden" page.

Thanks for you help!

4
Nick_James
Re: VLWeather - how to change default

I can't see the 'save' settings unless I am a user. You would need to activate me so that I can log in.
Nicholas James
President - LaDads
http://www.ladads.info

5
Nick_James
Re: VLWeather - how to change default

Quote:

mjz55 wrote:
... If you click on change settings, select country, there are 13 more choices than the US...


Only 13? The unadulterated SQL list has at least 100 other country choices. Recheck that SQL file.

If you know how to edit your installed SQL database, you can probably find and delete them from that rather than uninstalling and reinstalling.

I think I had two other minor problems to deal with on this module

1: Correcting the time. There was a minor problem with getting the time right because of daylight savings time.

2: On the main weather page, one of the links didn't work.

I forget the exact solution to those two issues because it was a long time back. They might be posted here under my name from 2 years back.
Nicholas James
President - LaDads
http://www.ladads.info

6
mjz55
Re: VLWeather - how to change default
  • 2008/5/26 17:05

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Nick_James, you are activated.

Yes I have a dead link on the module page too as you can see above. I also removed all countries except for US, which is why I'm wondering why those other 13 show up.

Just searched for your name and nothing came up from before regarding this module.

7
Nick_James
Re: VLWeather - how to change default

Those other 13 show up with all of their associated locations because you missed cutting out the part of the SQL list AFTER the United States. I reviewed the list and it looks complete.

Start and end with:
Quote:
('SUAG', 'Artigas', 'UY', 'Uruguay', 'Artigas', ''),
...
('FVFA', 'Victoria Falls', 'ZW', 'Zimbabwe', NULL, NULL);


Prune back to
Quote:
('PGUM', 'Agana, Guam, Mariana Islands', 'UM', 'United States Minor Outlying Islands', NULL, NULL),


if you don't want the minor outlying islands.
Nicholas James
President - LaDads
http://www.ladads.info

8
Nick_James
Re: VLWeather - how to change default

Okay.

In the cache folder, I changed the 'config.php' file.

2 changes
1) The vlweatherset was changed to my default icao. In your case it should be KORD.
2) The vlweatherset offset was changed to my timezone offset.


Quote:

// KSFO == San Francisco, KORD = Chicago
// US == US (duh)

$vlweatherset['icao'] = 'KNEW';
$vlweatherset['country'] = 'US';

// Possibilities are:
// both_imperial (imperial first, metric in parens)
// only_imperial
// both_metric (metric first, imperial in parens)
// only_metric

$vlweatherset['pref_units'] = 'both_imperial';

// default time offset from GMT
// -8 for SFO, -6 for Chicago, etc.

$vlweatherset['timeoffset'] = -6.0;

?>
Nicholas James
President - LaDads
http://www.ladads.info

9
Nick_James
Re: VLWeather - how to change default

Then in the vlweatherblock.php file

I changed:
Quote:

// include_once(XOOPS_ROOT_PATH . "/modules/vlweather/cache/config.php');

$vlweatherset['icao'] = $options[0];
// $vlweatherset['country'] = 'US';
$vlweatherset['pref_units'] = $options[1];
// $vlweatherset['timeoffset'] = -8.0;



to

Quote:
include_once(XOOPS_ROOT_PATH . '/modules/vlweather/cache/config.php');

// $vlweatherset['icao'] = $options[0];
// $vlweatherset['country'] = 'US';
// $vlweatherset['pref_units'] = $options[1];
// $vlweatherset['timeoffset'] = -6.0;


Once your config.php file is set correctly, you can uncomment that line in the vlweatherblock.php file.

Then comment out the two lines below that would undo those settings.
Nicholas James
President - LaDads
http://www.ladads.info

10
Nick_James
Re: VLWeather - how to change default

Your second link was not working because the spot where the ICAO is meant to go was empty.

Quote:

I think the above corrections should fix that. The code is looking to insert the $icao into that text line. So for some reason, your $icao was nul.
Nicholas James
President - LaDads
http://www.ladads.info

Login

Who's Online

366 user(s) are online (241 user(s) are browsing Support Forums)


Members: 0


Guests: 366


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits