Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Download Elxis CMS:
Elxis 5.5 Hermes
.
Home
Help
Login
Register
Elxis CMS Forum
»
Extensions
»
Components
»
Weather component (error)
« previous
next »
Print
Pages: [
1
]
Author
Topic: Weather component (error) (Read 7484 times)
eliasbou
Portal members
Full Member
Posts: 190
Weather component (error)
«
on:
April 19, 2011, 16:40:22 »
Hi. After installation component weather in clean installation elxis in the appearance component I take and something waste, you know what can be. I thank.
[attachment deleted by admin]
Logged
acampball
Full Member
Posts: 162
Re: Weather component (error)
«
Reply #1 on:
April 19, 2011, 20:09:02 »
Write the address of the site
Logged
eliasbou
Portal members
Full Member
Posts: 190
Re: Weather component (error)
«
Reply #2 on:
April 20, 2011, 08:42:59 »
http://www.ofmessinia.gr/
Logged
acampball
Full Member
Posts: 162
Re: Weather component (error)
«
Reply #3 on:
April 20, 2011, 16:16:31 »
I'm confused.
Maybe I forgot to remove debugging information.
Get me you e-mail, i send new component
Logged
eliasbou
Portal members
Full Member
Posts: 190
Re: Weather component (error)
«
Reply #4 on:
April 21, 2011, 08:17:56 »
Hello. I got email and installed new component but did not exist no change. I tryed him
http://www.webico.gr/demo/elxis/
and for i got the same result.
I thank.
Logged
acampball
Full Member
Posts: 162
Re: Weather component (error)
«
Reply #5 on:
April 21, 2011, 16:37:22 »
Replace this file in /administrator/components/com_weather/includes and test.
[attachment deleted by admin]
Logged
eliasbou
Portal members
Full Member
Posts: 190
Re: Weather component (error)
«
Reply #6 on:
April 21, 2011, 18:04:33 »
Τhe same fault
Logged
datahell
Elxis Team
Hero Member
Posts: 10345
Re: Weather component (error)
«
Reply #7 on:
April 21, 2011, 22:16:57 »
The problem is caused here:
file: includes/weather.class.php
line: 148
$this->cache_file = $this->cache_path . '/' . $this->filename_safe(eUTF::utf8_to_ascii($this->location)."_".$this->lang);
I advice you not to use the utf-8 encoded location name as the filename for cache. After the conversions you do you change the cache filename and when you want to used the cached file the reverse conversion might not be the same...
Use the location's id instead to generate the cache file.
So add a new attribute in
weatherPlugin
class constructor named "locid" (note that I made all attributes required).
public function __construct($location, (bool)$browse_lang, (int)$locid) {
Then do this:
$this->cache_file = $this->cache_path.'/'.$locid.'_'.$this->lang;
I also advise you to use a prefix and get the md5 value for the string for the cache filename.
Example:
$this->cache_file = $this->cache_path.'/'.md5('weather_'.$locid.'_'.$this->lang);
and open weather.php and change this:
$plugin = new $plugin_class($row->location, $cweather->cfg->get('GFBROWSE_LANG', 1));
To this:
$plugin = new $plugin_class($row->location, $cweather->cfg->get('GFBROWSE_LANG', 1), $row->id);
Check if you need to update more files in order to feed the weatherPlugin constructor with the proper location id.
Related tip:
A cool way to get rid of special characters and tags for a string is to use the php's 5.2+ filter_var function:
$clean = filter_var($unclean_var, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH);
If your string contains non ascii characters then use only the "LOW" flag.
«
Last Edit: April 22, 2011, 13:09:10 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
acampball
Full Member
Posts: 162
Re: Weather component (error)
«
Reply #8 on:
April 22, 2011, 08:28:32 »
New version 1.2 updated on EDC.
Logged
eliasbou
Portal members
Full Member
Posts: 190
Re: Weather component (error)
«
Reply #9 on:
April 22, 2011, 20:01:20 »
With the new version all work OK, thank.
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Extensions
»
Components
»
Weather component (error)