Author Topic: Font Size in advforecast2.php Script?  (Read 1531 times)

0 Members and 1 Guest are viewing this topic.

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Font Size in advforecast2.php Script?
« on: December 21, 2008, 11:08:19 PM »

I'm installing the advforecast2.php script with the option to display only the current and next time period forecast. However, the font is quite large. I thought I could figure out where to change the font size, but I haven't been able to no matter what I've tried. Does anyone know how to change the font size?

The page I'm testing it on is here until I work this out:

    http://www.wxbeacon.com/vws/AAAcurrent.php

Thanks!

Kevin...
« Last Edit: December 21, 2008, 11:26:59 PM by WeatherBeacon »
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Font Size in advforecast2.php Script?
« Reply #1 on: December 22, 2008, 12:07:34 AM »
Hi Kevin,

The advforecast2.php script doesn't do any formatting by itself (other than table markup).

Rather than modify the advforecast2.php script to do what you want, how about including it 'silently' and using your own code to print the results you want like this
Code: [Select]
<?php
$doPrintNWS 
false;
require(
"advforecast2.php"); 
?>

<table style="font-size: 9pt;">
<tr align="center" valign="top">
<?php print "<td>$forecasticons[0]</td><td>$forecasticons[1]</td>\n"?>
</tr>
<tr align="center" valign="top">
<?php print "<td>$forecasttemp[0]</td><td>$forecasttemp[1]</td>\n"?>
</tr>
</table>

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: Font Size in advforecast2.php Script?
« Reply #2 on: December 22, 2008, 12:10:32 AM »

Thanks, Ken! I'll give that a try, hopefully before my server goes down for maintenance in about 20 minutes.

Regards,

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: Font Size in advforecast2.php Script?
« Reply #3 on: December 22, 2008, 12:15:00 AM »

Much better! As usual, thanks much, Ken!

(Clearly I need to learn some php. :oops:)

Sincerely,

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Font Size in advforecast2.php Script?
« Reply #4 on: December 22, 2008, 01:50:01 PM »
You're very welcome, Kevin!

I've tried to make all the scripts work in three modes:
1) a standalone page (so folks can see and test)
2) an included page (just the main contents without the <html><head></head><body> and </body></html> sections
3) totally quiet (no visible printing), so that the internal arrays could be accessed so you can pick and choose what to print and how.

My suggestion was to use the (3) option since you only wanted to see just a bit of the available output.

I encourage folks to leave the basic scripts unmodified (except for the settings area) so that it's easier for them to replace the script when updates arrive (which they will as the source websites change over time) .. then an update to the script will be a simple matter of copying the settings from the old script into the updated script, and you're done with the update.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything