#24 weather module

closed
nobody
None
5
2002-08-12
2001-11-19
No

merge from pn core

I used weather module but this module have one bug
that show currentlytemperature -18 C
who can help me to modify it!!
I don't know PHPScript
Thanks a lot!!

Discussion

  • Roy Verrips

    Roy Verrips - 2002-05-21

    Logged In: YES
    user_id=269765

    You need to make the following changes
    to /modules/PN_Weather/index.php Line 51

    FROM:
    if (substr($grabline,7,4) == "Temp") { $v_Temp =
    substr($grabline,15,20); }

    TO:
    if (substr($grabline,7,5) == "Temp ") { $v_Temp =
    substr($grabline,15,20); }

    Worked for me - http://www.verrips.co.za/modules.php?
    op=modload&name=PN_Weather&file=index

    Yours

    Snowmann

     
  • Nobody/Anonymous

    Logged In: NO

    The bug is caused by the information received from msnbc :

    function makeWeatherObj() {

    this.swCity = "Montreal";
    this.swSubDiv = "Quebec";
    this.swCountry = "Canada";
    this.swRegion = "Canada";
    this.swTemp = "58";
    this.swTempCel =
    Math.round((5/9)*(this.swTemp-32));

    module/PN_Weather/index.php can't discriminate between
    "this.swTemp" and "this.swTempCel".

    You simply have to change line 43 (in my index.php) which
    looks like this :
    if (substr($grabline,7,4) == "Temp") ...

    to something like this :
    if (substr($grabline,7,5) == "Temp ") ...

    don't forget the space between Temp and "

    Hope it'll help,

    Daniel Lemay

     
  • Johnny Robeson

    Johnny Robeson - 2002-08-12
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks