Sandaysoft

Support forum for Cumulus weather station software
It is currently Mon Sep 01, 2014 8:59 pm
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation) • Downloads
Please put your approximate location into your profile • Add your personal web site to the Cumulus user map
Read the Announcements and News section regularly!
Do not allow your PC to go into standby mode while Cumulus is running - read the readme.txt!
If you find Cumulus useful, please consider a donation -

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Mon Apr 30, 2012 8:24 am 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3276
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Your page does not display any data because there is none to display! All your array declarations in the javascript code are empty. So there is a problem in your PHP code somewhere which isn't adding the data to the page.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Mon Apr 30, 2012 5:47 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 444
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 7 - 64 bit
Mark - I believe the PHP to be fine as I've just cut n paste from the working page into my template.

Beteljuice - at best my JS is extremely limited, what would be the one-liner I need to add?

Duke

_________________
Duke

Nightingale Weather
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Mon Apr 30, 2012 11:01 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 2216
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Code:
.....

<script type="text/javascript">
   changeData(<?php echo $month; ?>-1);
</script>

</body>


_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Tue May 01, 2012 6:19 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 444
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 7 - 64 bit
beteljuice wrote:
.....
Code:
<script type="text/javascript">
   changeData(<?php echo $month; ?>-1);
</script>

</body>



Thanks beteljuice, that's actually what I had put in some where in the small hours of the morning but it still didn't work :bash: .

It is now how ever :shock: Turns out there were 2 issues, after I deleted everything not needed on the page and ran both through beyond compare.

1/ As beteljuice pointed out the code needed moving from the body tag to allow the script to run and to allow other scripts on the page to run. Having the code in the body tag stopped the clock scripts.

2/ @Mark, my apologies to you, you were also correct but I just could not see why. It was having the
Code:
  <?php
  require_once("uploads/monthalltimewebtags.php");
  ?>

below the list of scripts. Moving this from below the list of js scripts on the page to above them allowed it to work. I assume the script was being run before the tags were processed and therefore no data to post.

Am I correct in my thinking???

My thanks to you both.

Duke

_________________
Duke

Nightingale Weather
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Tue May 01, 2012 10:11 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1700
Location: World...
Weather Station: No weather station
Operating System: No operating system
Duke something I have found out over the past years is that all the PHP code that is in use on a page should be processed before anything else - well, the PHP processor/compiler on the server has to get and process its data before that data can be used anywhere else.

It has also been my experience over the past months that the AJAX/JavaScript code should be processed as late as possible thus I now place (almost all of) the JavaScript at the bottom of the page or I use the 'defer="defer"' option when calling/loading the JavaScript - remember, the page has to be drawn with all its data/graphics before it can be updated, thus 'pushing' the download and start of the JavaScript on the user's computer for as late as possible - so far, it has been working well with the scripts/templates I have been working on.


Top
 Profile  
 
 Post subject: Re: Monthly records page with PHP tags.
PostPosted: Tue May 01, 2012 10:39 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3276
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Ray, you probably know, but the reason to put the scripts at the end of the page is because loading and parsing a script is a 'blocking' action on the browser - it pauses all other downloads and page rendering while it downloads and parses each script. There are some ways around this, but they involve tricks like the defer (which doesn't work in all browsers) and dynamic loading.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group