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.
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