Welcome to Geeklog, Anonymous Tuesday, July 08 2025 @ 01:57 pm EDT
Geeklog Forums
Weather Block
Status: offline
Forum User
Junior
Registered: 03/31/02
Posts: 23
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
6
15
Quote
Status: offline
Forum User
Full Member
Registered: 01/21/02
Posts: 269
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.

8
14
Quote
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."
11
10
Quote
Status: offline
Forum User
Junior
Registered: 03/31/02
Posts: 23
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
5
7
Quote
I am not pulling any info from the database. You can look at my site at Career Academy
----- "This is my router this is my switch. One is for routing but I don't know which."
----- "This is my router this is my switch. One is for routing but I don't know which."
10
8
Quote
Status: offline
Forum User
Junior
Registered: 03/31/02
Posts: 23
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
8
7
Quote
Status: offline
Forum User
Junior
Registered: 03/31/02
Posts: 23
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
8
10
Quote
Status: offline
Forum User
Junior
Registered: 03/31/02
Posts: 23
Got it...Had to set the city as default in the weather
table.
Again, thanks to everyone who helped.
Cregar
9
8
Quote
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.
9
10
Quote
Status: offline
Forum User
Full Member
Registered: 01/21/02
Posts: 269
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.
12
12
Quote
Ok, got it, squatty. Thanks!
EricInHouston
11
11
Quote
All times are EDT. The time is now 01:57 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content