Author Topic: Problem adding forecast/icons to index.php  (Read 3339 times)

Offline joew

  • Jr. Member
  • **
  • Posts: 36
    • TigerDenWX
Problem adding forecast/icons to index.php
« on: October 08, 2012, 12:50:15 PM »
Hi All,

I'm looking to see if someone might have an idea/fix for a problem I'm having modifying the file index.php to replace the Cumulus forecast with forecast/icons from Saratoga-Weather "http://saratoga-weather.org/scripts-carterlake.php?z=4#advforecast".

The problem is that instead of only outputting the forecast/icons on the left side of the page (which it does) it also outputs the remainder of the forecast (which it is supposed to discard) on the right side of the page messing up that side of the page!
Try the following URL to see:  http://tigerden.hopto.org/tigerdenwx/tstindex.php

I am new to php and have tried various things for the last 3 days without any luck so any ideas would be deeply appreciated. I've attached the files tstindex.php, index_forecast.php, and advforecast2.php. The modifications to index.php (tstindex.php) begins about lines 88 to 94.

Regards,
Joe

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Problem adding forecast/icons to index.php
« Reply #1 on: October 10, 2012, 01:21:43 PM »
Hi Joe,

To me it looks good on the Index page.
Your icon is displayed correctly, with underneath the corresponding text.
Also, the extended forecast text is displayed beside the icon, which looks good to me.
Which text part do you want to eliminate from the page?

Cheers,

Arthur

Offline joew

  • Jr. Member
  • **
  • Posts: 36
    • TigerDenWX
Re: Problem adding forecast/icons to index.php
« Reply #2 on: October 10, 2012, 06:00:48 PM »
Hi Arthur,

Thanks for the reply. I think you probably looked at my Index page after I implemented a work around last night that seems to have temporarily masked the problem. My fix while  temporarily rectifing the problem really doesn't fix the root cause. If you want to see what I was seeing use this Link:   http://tigerden.hopto.org/tigerdenwx/tstindex.php. My fix to eliminate the problem was to comment out line 135 and replace it with line 136 which simply eliminated the "alt=..." and "title=..." portion of the "img src=..." in the file index.php (of course I reversed this in tstindex.php so that you could see the problem).  I re-enclosed the file tstindex.php here as I believe the origonal version of the file I enclosed did not reflect the workaround I now have implemented until I can find the root cause.

If you try  http://tigerden.hopto.org/tigerdenwx/advforecast2.php you will see what the Saratoga script returns. Then execute http://tigerden.hopto.org/tigerdenwx/index_forecast.php you will see that it discards the unwanted information, but when you go to tstindex.php the discarded info is on the right side of the page starting underneath the forecast icon with "Hazardous Weather Outlook" and ends at the bottom with '"/>' and the rest of what was supposed to be printed out in the "forecast box".  By the way the line "Hazardous Weather Outlook" is actually a link from the http://tigerden.hopto.org/tigerdenwx/advforecast2.php which is for "warnings" generated from NOAA. If there are no warnings the problem does not seem to occur. I tried modifying the "advforecast2.php" script to eliminate all the warning links from being output, but could not seem to find a combination that changed the output.

Anyway that's where I currently stand at the moment, using a kludge until I can figure out a better way.

Cheers,
Joe


Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Problem adding forecast/icons to index.php
« Reply #3 on: October 10, 2012, 08:28:41 PM »
Hi Joe,

I've tried to look at your site and think it was down.

I have a bit of trouble to understand what you want to do exactly, I'm not 100% bilingual  :(
If I understand well, you want to add WU forecast to your main page, but not the regular layout
with icons and brief forecast in a row at top and long text at bottom?

You want to show only tonight and tomorrow forecast in a columnar layout?

Please confirm, I'll check it tomorrow morning (it's now near 10pm here)!

Regards,
Jacques

Please, consider supporting this site 

Offline joew

  • Jr. Member
  • **
  • Posts: 36
    • TigerDenWX
Re: Problem adding forecast/icons to index.php
« Reply #4 on: October 11, 2012, 12:25:50 AM »
Hi Jacques,

I wouldn't worry about not being 100% bilingual ;D ! I'm 0% bilingual :( !

I'm not sure why it appeared that my site was down. I tried all the links I furnished in my earlier posts and they all worked.  Are you getting an error message or blank screen or something else. Let me know what you are experiencing if you still cannot see my site.

Quote
You want to show only tonight and tomorrow forecast in a columnar layout?

Image DesiredOutput.png shows an example of what I am trying to substitute the original Forecast output with. This is happening as I want it too.
The problem is illustrated with images Part1ofbadoutput.png (top) and Part2ofbadoutput.png(bottom) that appear in addition when I have the problem.

I hope this clears up what I am trying to accomplish and maybe helps with my previous reply to Arthur and my original post.

Let me know if you need any other information.

Regards,
Joe



Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Problem adding forecast/icons to index.php
« Reply #5 on: October 11, 2012, 12:26:09 PM »
Hi Joe,

I've checked your project and the only problem is that you are using NWS Forecast script
on the index page, then you have 2 php variables "$forecast".

To solve that problem I have modified your tsindex.php file to use newest "$forecastenc" webtags
to avoid that collision. But this webtag wasn't supported in current "wt_data_inc.php" file
then, I've update it this morning.

Then you have to do this:
1 - Download new file Webtags 192a,zip from download section and replace file you were using
     (wt_data_inc.php or wt_data_intl.php file depends on which one you're using)
2 - Put the file where you indicated to Cumulus to process it.
3 - Put new tsindex.php file in your website.

After Cumulus process, all could be good now!

Give me some news!!  ;)

Regards,
Jacques
Ps. index_forecast.php file is no longer needed! ;D
Please, consider supporting this site 

Offline joew

  • Jr. Member
  • **
  • Posts: 36
    • TigerDenWX
Re: Problem adding forecast/icons to index.php
« Reply #6 on: October 11, 2012, 05:45:44 PM »
Hi Jacques,

Many thanks for the solution to my problem! :) :) :)   I had spent several days trying to nail down the problem with no luck :'( !  I guess I couldn't see the forest for all the trees :-[ !  Anyway all is now good! :)

Regards,

Joe