On my own implementation, I once was manually saving (adding to archive) the generated this month page as close as I was able to be available to the end of each month, and I added a carrier page allowing me to choose to display the current this month or any archived one from a menu of anchor links without having to select the archived page to load by typing its file name into my browser. Of course I forgot some months, or was away from home, and found myself subsequently creating missing past months. My posts yesterday reminded me that I once was using a variant of the daily summary script that was enhanced to give me the value and time-stamp information I needed to create those missing this month pages in my archive; a somewhat slow process as the summary script only shows one criterion at a time and the this_month has a lot of lines!
By now, you are probably wondering what I am talking about and why I have made this post to resurect a thread after 7 years. Well basically, I have from first availability in 2011 of the thisMonth page in Cumulus archived past pages so I have implemented the original request shown in the first post in this thread that said in February 2011:
scramblers wrote:I wish to view any stats that are only available on the netbook ie This Month and This Year.
I was thinking that I would like to add these two sets of information to the standard Cumulus website as separate webpages and be available via the navigation bar. On each page there would be a dropdown box so that you could select a particular month or year.
Reading on through the thread, the request resurfaces without mention of selecting a past month/year, and from version 1.9.2 (build 1002) 5th July 2011 Steve added thismonthT.htm
(also mentioned in this thread) and that has been available ever since and is also in Cumulus MX, but of course Steve's implementation only includes current month and year, and as soon as they might represent a complete month or year they are reset to show a blank ready for the new month or year.
For many months now I have had an automatic solution working that means I
don't need to manually save a web page to have ability to see any past month. Instead I have web pages written in PHP that display monthlyrecordT.htm
like output that show the statistics for more than one month on the same page, I can choose between web pages that show either such statistics for a number of consecutive months
or show statistics for the same single month in a number of different years
. For a belt and braces approach in case the database gets corrupted (as has happened once) I am still adding to the web-page archive, but it can be done any time after end of month now using the saved web tags mentioned at the end below to feed into my PHP extended version of the standard thismonth web page..
The standard Cumulus end of day
batch script functionality is what has been automatically storing each completed month. In Cumulus.ini
Code: Select all
That command file, amongst other housekeeping tasks for extra back ups, runs a PHP script that copies the contents of any new lines added to dayfile.txt
to a database table with one row per day (think of it as my totally different version of importCumulus File), and at the end of a month it also stores a row with the thismonth type statistics for the completed month in a separate table. The live Cumulus web tags for this month have by then been reset for the next month (although I do get Cumulus to save the older ones - see later), so the completed month statistics are quickly determined by running a series of SQL interrogations of all the rows in the daily table for that completed month (I did mention this, although only in passing, earlier this year in http://sandaysoft.com/forum/viewtopic.php?f=4&t=16706
). By the way the mention of delay in the batch command name reflects that the PHP script it calls will include a delay in those specific conditions when it needs to access a log file that Cumulus creates or locks at roll over time (some of the values for my daily summary table row when relevant can come from other logs like log.xml, today.ini, and month.ini as well as dayfile.txt). I have outlined the schema for my database tables in previous postings elsewhere on the forum.
(I've not done same automation for thisyear yet, for that I do still manually save the page at end of each year and have a annual web page that shows on a single page the statistics for every one of my 10 years of weather station operation. Automating a once a year task does not have any priority for busy me, but it would work very similarly to end of month).
Cumulus MX does offer some access to past data by its database functionality, by default creating a table with daily statistics. In addition as http://sandaysoft.com/forum/viewtopic.php?f=27&t=12908&start=30#p112768
tells us in December 2015
Steve wrote:build 3035 also archives the month.ini and year.ini file at the end of the month/year as monthYYYYMM.ini and yearYYYY.ini. It doesn't currently do anything with them, for now they are just created so you can refer to them manually.
See also http://sandaysoft.com/forum/viewtopic.php?f=4&t=13857
for a discussion about this.
By the way for eliminating my manual archiving chore, back in May 2015 I had made Cumulus 1 do something similar by including this in Cumulus.ini
Code: Select all
But that addition just meant I had the figures automatically saved for each month, I still had to manually edit those figures into a purely HTML web page until my already mentioned automatic system was implemented. The differences between pure HTML and using PHP are discussed earlier in this thread.
I use a similar approach for saving the monthly cumulus web tags including this in Cumulus.ini
Code: Select all
ExtraLocal36=\Web pages\Templates for Cumulus to Process\cumuluswebtagsMonthT.cum
means that Cumulus always stores the monthly web tags in a file with a name relating to the month and I don't lose the web tags at rollover for the end of the month. Note that I use the extension .cum for any template files that I want processed by Cumulus, so I don't get them inadvertently muddled up with processed .HTML or .PHP or .JS files. The template file contains a subset of the Cumulus web tags as the RHS to a series of PHP variable assignments and has some similarities to the ImportCumulusFile others use.