WXforum.net
May 21, 2013, 10:09:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6615  •  Posts: 178469  •  Topics: 18111
Please welcome Christea, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Need some help with website  (Read 819 times)
0 Members and 1 Guest are viewing this topic.
TriCountyWeather
Member
*
Offline Offline

Posts: 22


WWW
« on: December 21, 2008, 05:15:17 PM »

Hey,
 I am wanting to add the Noaa Forecast to my site, but everythime i do, i keep screwing up somehow. Basically, all I want is the graphics and the highs and lows, not the rest of it. my website is Tricountyweather.com, and i made a test page that shows what I want it to look like, but of course its not going to work since the script is not there. http://www.tricountyweather.com/wxforumtest.htm

If someone could give me a pointer I would be very appreciative!
scott
Logged
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3729


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #1 on: December 21, 2008, 06:15:28 PM »

Hi Scott,

I think what you want to use is the advforecast2.php script (http://saratoga-weather.org/scripts-carterlake.php#advforecast ) .. that will provide you with the icons/temps/text and you can use it in your page... but... there's a catch .. it has to run as a PHP script, and normally .html pages aren't parsed for PHP.

If you want a .html page to include a PHP page, you'll have to use a Server-Side-Include like
Code:
<!--#include virtual="fcst.php" -->

In a fcst.php page, have it just have
Code:
<?php
$doPrintNWS 
false;
include(
"advforecast2.php");

print 
$Status;

?>

  <table width="640" style="border: none;">
    <tr align="center" style="background-color: #FFFFFF;">
      <td><b>National Weather Service Forecast for: </b><span style="color: green;">
           <?php echo $forecastcity?></span><br />
        Issued by: <?php echo $forecastoffice?>
      </td>
    </tr>
    <tr>
      <td align="center">Updated: <?php echo $forecastupdated?>
          </td>
    </tr>
    <tr>
      <td align="center">&nbsp;
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr valign ="top" align="center">
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
            print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>

          </tr>
          <tr valign ="top" align="center">
          <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
            print 
"<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
          }
          
?>

          </tr>
        </table>
     </td>
   </tr>
</table>

and that will cause the forecast to be fetched by advforecast2.php, printed in fcst.php and directly included in your html page where you placed the <!--#include virtual="fcst.php" -->

Don't forget to configure advforecast2.php with your NOAA zone and point-printable forecast URL, and to have the carterlake-icons.zip uploaded to your site as forecast/images/

Instructions are on the scripts page cited above...

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
weatherforyou
Forecaster
*****
Offline Offline

Posts: 461


My weather is on WeatherForYou.com. Is yours?


WWW
« Reply #2 on: December 21, 2008, 07:25:44 PM »

There's a couple of forecast image options at http://www.weatherforyou.com/snapshots/ that would accomplish this.  Also the HAMweather scripts can accomplish this (example at http://www.grantspassweather.com/forecast.php ) although I also have the full forecast under it, too.
Logged

Joe Torsitano

TriCountyWeather
Member
*
Offline Offline

Posts: 22


WWW
« Reply #3 on: December 21, 2008, 08:39:57 PM »

The htm page is just a test page that I threw up there just so everyone can see what I am wanting to do. I have the script working fine
on the mobile page, just on the main page, im not wanting the whole forecast to be on there. I just want the top part of the script and not all the text below. Everytime that I try to make it look as i want, i mess up the script and it dosent work. The wxforumtest.htm is just basically the template I want it to look like. I didnt want to throw it into a php page just yet until i can figure out what I am missing or doing wrong. Scott
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.096 seconds with 18 queries.
anything