Daily Summary: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
→‎Some example Scripts: rewrite of section dealing with graphs, and clarification of dangers with adopting scripts by other people
m (→‎PHP scripts: added that coloured script was by Mark Crossley)
m (→‎Some example Scripts: rewrite of section dealing with graphs, and clarification of dangers with adopting scripts by other people)
 
=== Some example Scripts ===
As for the [[#PHP_scripts|PHP daily summary scripts section]] - '''Be aware if you use PHP scripts written by someone else''' .... ''These scripts may use "include ..." or "require ..." to bring in further scripts that introduce variables (such as those for accessing the database) or functions (to do standard actions) or templates (shared headers, navigation menus and footers) or text (any other common content) that is used with a number of pages on author's site. If you don't comment out those references to external scripts, or replace the references with your equivalents, the PHP parser may fail to produce a HTML page and nothing will be available to the browser. Thus you do need a simple understanding of PHP, a PHP book, or the ability to look up PHP instructions on the web if you are to be successful with tailoring these scripts to your site.''
 
If the script you decide to use accesses a database, be aware that not everyone has the same approach to missing data. Some will only work with perfect data, some treat zeroes as missing data, others expect missing data to have "Null" in the relevant column. Also, although David Jamieson invented a schema, and that is the default used by Cumulus MX; it is possible to use a different schema and that means the column names might be different between how you have set up your database and what is used by a particular script. As I often say, you do really need to develop some understanding of PHP and database access instructions to sucessfully get most of the PHP scripts database using scripts working. If you are new and inexperienced, using HTML, and JavaScript may be best for you.
 
Look in the Website Development section of the Cumulus support forum - '''Web general''' sub forum:
**[http://sandaysoft.com/forum/viewtopic.php?f=14&t=10755#p87081 Top 10 Records Page]- This script by Mark Crossley runs several queries against the daily summary table of a database and picks various extremes displaying the top ten extremes (e.g. ). The latest source php can be seen using a [https://weather.wilmslowastro.com/test/top10s/top10sContent.php?view=sce query-string on Mark Crossley's web site] and there have been several updates since the forum thread was created.
**[http://sandaysoft.com/forum/viewtopic.php?f=14&t=16534#p126964 What to do with data from MySQL] - This posting lists a number of web pages on PaulMy's web site where he presents statistics from the daily summary table of his database in different formats.
**[http://sandaysoft.com/forum/viewtopic.php?f=14&t=7834#p66013 ThisComparing daywith lastone year pageago] - This post has a query in a php file (as you save the download change '.txt' to '.php') that will extract from the daily summary table in a database, values for one year ago, twoto yearsdisplay agoalongside for example statistics for yesterday. An equivalent script using jQuery to feedread dayfile.txt directly is available for those who don't have a webdatabase. pageIf thatyou displayshave allsome programming skills, you can vary either of these scripts to for example display statistics for each day in the summarylast week (or month). I have written scripts that display the statistics for todaylast week using a combination of this daily table in database approach and Cumulus recent tags. I have another script that uses the correspondingdaily onestable in the databse to calculate the equivalent of what Cumulus 1 shows in View menu, this month selection, for earlierany past month and adds the equivalent of what Cumulus this month web tags show and the resulting statistics are shown for various selectable mixtures of past yearsmonths.
 
There are '''various scripts out there that output graphs''' from the values in recent history web tags, or values read off either a daily table in a database or dayfile.txt directly. There are two to highlight here:
There are various scripts out there that output graphs from the values read, I have not identified a particular one to reference here yet. If you find a site dislaying a graph you would like to copy on your own site, you might be able to see the PHP source that is responsible, but as I have commented [http://sandaysoft.com/forum/viewtopic.php?f=14&t=16425&p=126065#p126065 elsewhere] most authors do not make it easy to see their code. Of course one of the reasons for using PHP script is that processing is done quickly on the web server and only the resulting HTML is passed onto the client browser and this does protect interlectual property and adds security by not showing the database access code.
* An alternative to the Cumulus 1 or Cumulus MX trend web page is described in [http://sandaysoft.com/forum/viewtopic.php?f=18&t=12321 this topic] this can use all the sources mentioned.
* Highcharts (that cannot be used on a business web site) are exploited by Mark Crossley in [http://sandaysoft.com/forum/viewtopic.php?f=18&t=8672 this topic]; it is a very long topic, and discusses various issues to consider with using such data, as well as including the script.
There are various scripts out there that output graphs from the values read, I have not identified a particular one to reference here yet. If you find a site dislayingdisplaying a graph or table you would like to copy on your own site, you might be able to see the PHP source that is responsible, but as I have commented [http://sandaysoft.com/forum/viewtopic.php?f=14&t=16425&p=126065#p126065 elsewhere] most authors do not make it easy to see their code. Of course one of the reasons for using PHP script is that processing is done quickly on the web server and only the resulting HTML is passed onto the client browser and this does protect interlectual property and adds security by not showing the database access code.
 
=== Other jQuery approaches ===
5,838

edits

Navigation menu