Exemple #1
0
function getSunStatus()
{
    if ($_REQUEST['scheme']) {
        return $_REQUEST['scheme'];
    }
    $cm = dateToMinutes(time());
    $sunSet = getSunset();
    $sunRise = getSunrise();
    if ($cm > $sunSet || $cm < $sunRise) {
        return 'night';
    } else {
        return 'day';
    }
}
Exemple #2
0
?>
;
      /* sunset <?php 
echo date('H:i:s', getSunset(false));
?>
 */
      sunRise = <?php 
echo getSunrise();
?>
;
      /* sunrise <?php 
echo date('H:i:s', getSunrise(false));
?>
 */
      currentRefMinutes = <?php 
echo dateToMinutes(time());
?>
;
      /* current <?php 
echo date('H:i:s', time());
?>
 */
      currentSunState = '<?php 
echo getSunStatus();
?>
';

      // switches the themes for night and day time
      if('<?php 
echo $_REQUEST['scheme'];
?>