Welcome to Geeklog, Anonymous Wednesday, April 24 2024 @ 06:42 pm EDT

Geeklog Forums

Weather Block


Status: offline

Cregar

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
--
"Get Geeked"
Cregar
 Quote

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"Wink; $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?
 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."
 Quote

Status: offline

Cregar

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
--
"Get Geeked"
Cregar
 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."
 Quote

Status: offline

Cregar

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
--
"Get Geeked"
Cregar
 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
 Quote

Status: offline

Cregar

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
--
"Get Geeked"
Cregar
 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.
 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?
 Quote

ericinhouston

Anonymous
Ok, got it, squatty. Thanks! EricInHouston
 Quote

All times are EDT. The time is now 06:42 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