Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 11:08 am EST
Geeklog Forums
Weather Block
Status: offline
squatty
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.
In a world without walls and fences, who needs Windows and Gates?
In a world without walls and fences, who needs Windows and Gates?
5
12
Quote
Sinjin
Anonymous
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."
7
7
Quote
Sinjin
Anonymous
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."
9
5
Quote
Status: offline
Cregar
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
--
"Get Geeked"
Cregar
--
"Get Geeked"
Cregar
6
7
Quote
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.
4
7
Quote
Status: offline
squatty
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.
In a world without walls and fences, who needs Windows and Gates?
In a world without walls and fences, who needs Windows and Gates?
8
9
Quote
ericinhouston
Anonymous
Ok, got it, squatty. Thanks!
EricInHouston
10
8
Quote
All times are EST. The time is now 11:08 am.
- 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