Good-Shepherd-Catholic-Radio / Theme-2017

WordPress Theme
0 stars 0 forks source link

Refresh Radio Shows Header as each new Show is going to start #86

Open d4mation opened 7 years ago

d4mation commented 7 years ago

Originally, this wasn't going to be done because refreshing every 10 seconds or so is costly on the database.

However, Marc had a good idea where instead of either refreshing super often or checking if the Web Browser reported that it was, say, 10 AM (Which would be a nightmare with Timezones as well as inaccuracies in their computer's clock) that we could instead have PHP print out a number of (milli)seconds to count toward.

So, on initial page load (As a regular page load or as an Ajax Page Refresh), the Up Next Radio Shows would have the number of (milli)seconds that will pass before they should be rotated forward. Once this amount of time has passed, an Ajax Request will be processed to swap out the Radio Shows. This will then naturally produce another value to count toward and it will continue.

Example pulled up by Marc: https://stackoverflow.com/questions/6755940/using-javascript-countdown-with-server-side-time

d4mation commented 7 years ago

I marked this as v1.1 since this will take a fair amount of time to implement (and test) and it is a new feature rather than a bug fix.