Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

embedding Yearly Data Summary into existing site

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
Post Reply
User avatar
PaulMy
Posts: 3830
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

embedding Yearly Data Summary into existing site

Post by PaulMy »

Hi David,
I have this working ok in my http://www.komokaweather.com/weather/datasummary.php page. As well in my AJAX/PHP template page http://www.komokaweather.com/wxrecords.php but would instead like to have it in the 'Almanac' flyout-menu maintaining the AJAX/PHP heading and side menu but it is not displaying properly. I am uploading the dayfile.txt to my Godaddy remote site root/weather folder and have edited readDayfile.php this way. The datasummary.css and .php, readDayfile.php and dayfile.txt are all in both the remote root and root/weather - I have been experimenting to make this work :bash: but without success. What have I done wrong?

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: embedding Yearly Data Summary into existing site

Post by daj »

Paul

From what I can see on this page (http://www.komokaweather.com/wxhistorical.php) you are then opening readDayfile.php which is the raw file for simply doing the import and building the table. It does not contain any stylesheet info etc. You need your containing page to include the CSS & JS links.

I am not up to speed on your sites setup, however I would guess that in your wxhistorical.php you should include the necessary lines to pull in the CSS & JS needed

Code: Select all

<link rel="stylesheet" type="text/css" media="screen" href="datasummary.css"  /> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js" type="text/javascript"></script>
In the main section of your wxhistorical.php.... <div id="main-copy"> .... I would include the readDayfile.php within the div

Code: Select all

<?php include('readDayfile.php');?>
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
PaulMy
Posts: 3830
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: embedding Yearly Data Summary into existing site

Post by PaulMy »

Hi David,
Thanks for your suggestion and I have tried that without success and get 'failed to open day file' message from the PHP/AJAX templates' flyout-menu, but is working fine from the direct link page. I don't actually have a grasp on how the PHP/AJAX templates flyout-menu work but have done some edit, cut and paste, and added your code to the sample newpage.php provided in Ken's templates and renamed as wxhistorical.php, but obviously not correctly. Perhaps Ken (Saratogowx) can provide some assistance on how to add it to his templates so will ask on that thread.

Thanks very much,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: embedding Yearly Data Summary into existing site

Post by daj »

The 'failed to open day file' message means that you have probably not set your $dayfile variable correctly in readDayfile.php.

What do you have it set to?

It may be you have it set to a relative path, which means relative to what page is opening it, so it will work in one setup and not in the other (in this case the PHP templates you use). I usually always set it to a full path so that it works regardless of what is opening it.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
PaulMy
Posts: 3830
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: embedding Yearly Data Summary into existing site

Post by PaulMy »

Thanks David,
Now edited from $dayfile='../weather/dayfile.txt'; to $dayfile='http ://www.komokaweather.com/weather/dayfile.txt'
and it is working. Now I'll try to do some fixing up of the heading location, etc. so everything displays properly. So simple once you know it :oops:

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
Post Reply