Posted on: 04/02/02 06:03pm
By: Cregar
Hi all,
I am a new user and just downloaded the weather block. How do you install it? I didn't see any install instructions.
Thank
lib-custom.php
Posted on: 04/04/02 06:47am
By: squatty
The Weather block is a PHP block. You need to add the phpblock function code to your lib-custom.php file:
function phpblock_getweather () {
global $_CONF;
$path = $_CONF['path_html'] . "weather";
include_once($path . "/display_weather.php"

;
$display = getweather();
return $display;
}
After you've added the code to lib-custom, create the PHP block from the block admin.
The PHP block should call the function phpblock_getweather.
PHP Block Weather
Posted on: 04/04/02 08:30am
By: Anonymous (Sinjin)
I live in a rural Alabama town and I can not get the weather block to get my city. I wrote a simple PHPblock to pull images off the weather site of our local TV station.
function phpblock_weather ()
{
$retval .= "<img src=\"";
$retval .= "http://files.raycommedia.com/waff/weather_images/temps.jpg\" width=170";
$retval .= "\">";
return $retval;
}
?>
You place this at the end of your lib-custom.php file. Also you would need to find the picture of your local weather of your choice.
-----
"This is my router this is my switch. One is for routing but I don't know which."
PHP Block Weather
Posted on: 04/04/02 04:56pm
By: Cregar
What about the sql file. Do I create a new database or
add it as a table to the geeklog database?
Thanks again for any help
PHP Block Weather
Posted on: 04/04/02 05:10pm
By: Anonymous (Sinjin)
I am not pulling any info from the database. You can look at my site at
Career Academy[*1]
-----
"This is my router this is my switch. One is for routing but I don't know which."
PHP Block Weather
Posted on: 04/04/02 08:32pm
By: Cregar
Ok...once I update the config file and add the php block
I get this error:
1146: Table 'geeklog.weather' doesn't exist
Thanks
Craig
PHP Block Weather
Posted on: 04/04/02 10:14pm
By: Cregar
Ok...I got everything working except in guest view...no
weather info shows up. It works great when logged in
as a user but not when your a guest. I tried setting the
default settings in the database for the guest user but
the info still doesn't show up.
Helllppppp
Thanks again for all the great support your giving.
Cregar
PHP Block Weather
Posted on: 04/04/02 10:19pm
By: Cregar
Got it...Had to set the city as default in the weather
table.
Again, thanks to everyone who helped.
Cregar
lib-custom.php
Posted on: 04/19/02 03:38pm
By: Anonymous (Anonymous)
How do you set the default for users? I know that they can set it themselves, but how do you set one for people who haven't set it, yet? Visitors and people without their default set get a link to a nonexistent image file and a -18 degrees celcius reading.
lib-custom.php
Posted on: 04/20/02 08:40pm
By: squatty
It's in the data...
There should be a record in your weather table with a sbgdefault = 1: SELECT * FROM weather where sbgdefault = 1;
The weather block will use this record for all anonymous users.
lib-custom.php
Posted on: 04/23/02 12:17pm
By: Anonymous (ericinhouston)
Ok, got it, squatty. Thanks!
EricInHouston