73.7 °F

Hum: 33% Dew: 42.8 °F
Baro: 1013.82 hPa
Wind: NE @ 0.0 mph
Rain: No Rain Today
Data Updated: 22:48
TNET Weather Station - Mesa, AZ USA
Home   Forecasts   Graphs   Radar   Trends   Webcams   Weather Links   Archives   PROJECTS & SCRIPTS   About Us
TNET Weather Based Projects and Scripts > PHP No Database Dayfile.txt Parser

PHP (No Database) Dayfile.txt Parser


A simple PHP5 based script that uses the Cumulus dayfile.txt file to generate a table of a selected months data.

Requirements

Configuration


The source is in text form. You need to download it and save it on your server as dayfile.php

After you have saved it, you need to change the setting section to match what you require. For most, the default settings will work.

Default Settings are:

$SITE['dayfile']    = './dayfile.txt';
$SITE['realtime']   = './realtime.txt';

Dayfile


The dayfile.txt file is NOT automatically sent to your website, nor is it something you can normally do via Cumulus itself as it has no options for sending a file only once a day.

The dayfile.txt is updated on your Cumulus workstation once a day after midnight.

You can use another FTP tool or something like:

You just need to know where it is being uploaded to so that you can set the script properly.

Realtime.txt


The realtime.txt file is used to obtain the unit types for wind, rain, pressure and temp. None of the other data is used for this script.

Options


There are currently two options that can be passed to the script.

By Default, the script will display the current months data. The two options will allow you to change that.


OptionEffect
m=XXMonth is changed to the value you provide
y=XXXXYear is changed to the value you provided (4 digit years only)

Note that options are passed on the URL line after the script name. The first option needs to start with a ? and the second with an &

Examples:


ExampleResult
http:/....sonesite/dayfile.php?y=2009&m=12Displays Dec of 2009
http:/....sonesite/dayfile.php?y=2010&m=1Displays Jan of 2010

Sample


A number of months are available here:

CSS code


The current script is really intended to be include by another page which has an external or inline CSS style page.

You could use the following to get a start on how to make it look...

#daytable {
    width: 750px;
    border-collapse: collapse;
}

#daytable th {
    color: #ffffff;
    font-size: 75%;
    background-color: #6B6B6B;
    vertical-align: bottom;
    border: 1px solid black;
    line-height: 120%;
    text-align: center;
}

#daytable td {
    font-size: 90%;
    vertical-align: top;
    width: 9%;
    text-align: center;
    border: 1px solid black;
    padding: 2px;
}

#daytable .day {
    width: 4%;
    background-color: #6B6B6B;
    color: #ffffff;
}
Copyright © 2017 TNET Systems Inc. - All rights reserved. Weather Collection for this website is done via Cumulus 1.9.4 build #1093 and Weather Display
Boltwire Cumulus Plugin by TNET using Boltwire v3.4.16 Hosting by TNET
Protens Server - IP: 54.166.199.178 [ec2-54-166-199-178.compute-1.amazonaws.com] - Views #49