Answers for "display the link when time matching"

0

display the link when time matching

<?php 
    // Variables
    $h = date('G');
    $m = date('i');
    $d = date('l');

    //WLSG Schedule
    if ($d != 'Monday') $wlsgDayToggle = 'radio-offline';
    if ($h > 0) $wlsgTimeToggle = 'radio-online';
    if ($h < 1) $wlsgTimeToggle = 'radio-online';
    else $wlsgTimeToggle = 'radio-offline';

    //UCR Schedule
    if ($d != 'Sunday') $ucrDayToggle = 'radio-offline';
    if ($h > 23) $ucrTimeToggle = 'radio-online';
    if ($m > 40) $ucrTimeToggle = 'radio-online';
    if ($m < 59) $ucrTimeToggle = 'radio-online';
    else $ucrTimeToggle = 'radio-offline';
?>
Posted by: Guest on October-21-2020
0

display the link when time matching

a.radio-online { display: inline; }
a.radio-offline { display: none; }
Posted by: Guest on October-21-2020
0

display the link when time matching

<div id="radio-online">
    <p><a class="<?php echo $wlsgDayToggle; ?> <?php echo $wlsgTimeToggle; ?>" href="#" title="Online! Listen Now!" target="_blank">Online! Listen Now!</a></p>
    <p><a class="<?php echo $ucrDayToggle; ?> <?php echo $ucrTimeToggle; ?>" href="#" title="Online! Listen Now!" target="_blank">Online! Listen Now!</a></p>
</div>
Posted by: Guest on October-21-2020

Browse Popular Code Answers by Language