Adding code to a section in the header.
-
Hi,
I am using the Customizr for a radio station and need to add some code that will display the presenter online to the header section of the site.
The code i wish to place on the header is php –
<?php
$h = date(‘G’); //set variable $h to the hour of the day.
$m = date(‘i’); //set variable $m to the min of the hour.
$d = date(‘w’); //set variable $d to the day of the week.
$year = date(‘Y’); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h;// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = ‘img/hosts/petem.jpg’;
else if ($d == 1 && $h >= 4 && $h < 8) $img = ‘img/hosts/angelaa.jpg’;
else if ($d == 1 && $h >= 8 && $h < 12) $img = ‘img/hosts/shonw.jpg’;
else if ($d == 1 && $h >= 12 && $h < 13) $img = ‘img/hosts/pottsie.jpg’;
else if ($d == 1 && $h >= 13 && $h < 15) $img = ‘img/hosts/mikef.jpg’;
else if ($d == 1 && $h >= 15 && $h < 19) $img = ‘img/hosts/lizzy.jpg’;
else if ($d == 1 && $h >= 19) $img = ‘img/hosts/danic.jpg’;
else if ($d == 2 && $h < 0) $img = ‘img/hosts/danic.jpg’;// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = ‘img/hosts/petem.jpg’;
else if ($d == 2 && $h >= 4 && $h < 8) $img = ‘img/hosts/angelaa.jpg’;
else if ($d == 2 && $h >= 8 && $h < 12) $img = ‘img/hosts/shonw.jpg’;
else if ($d == 2 && $h >= 12 && $h < 13) $img = ‘img/hosts/pottsie.jpg’;
else if ($d == 2 && $h >= 13 && $h < 15) $img = ‘img/hosts/mikef.jpg’;
else if ($d == 2 && $h >= 15 && $h < 17) $img = ‘img/hosts/lizzy.jpg’;
else if ($d == 2 && $h >= 17 && $h < 20) $img = ‘img/hosts/westmar.jpg’;
else if ($d == 2 && $h >= 20) $img = ‘img/hosts/danic.jpg’;
else if ($d == 3 && $h < 0) $img = ‘img/hosts/danic.jpg’;// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = ‘img/hosts/petem.jpg’;
else if ($d == 3 && $h >= 4 && $h < 8) $img = ‘img/hosts/angelaa.jpg’;
else if ($d == 3 && $h >= 8 && $h < 12) $img = ‘img/hosts/shonw.jpg’;
else if ($d == 3 && $h >= 12 && $h < 13) $img = ‘img/hosts/pottsie.jpg’;
else if ($d == 3 && $h >= 13 && $h < 15) $img = ‘img/hosts/mikef.jpg’;
else if ($d == 3 && $h >= 15 && $h < 19) $img = ‘img/hosts/lizzy.jpg’;
else if ($d == 3 && $h >= 19) $img = ‘img/hosts/danic.jpg’;
else if ($d == 4 && $h < 0) $img = ‘img/hosts/danic.jpg’;// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = ‘img/hosts/petem.jpg’;
else if ($d == 4 && $h >= 4 && $h < 8) $img = ‘img/hosts/angelaa.jpg’;
else if ($d == 4 && $h >= 8 && $h < 12) $img = ‘img/hosts/shonw.jpg’;
else if ($d == 4 && $h >= 12 && $h < 13) $img = ‘img/hosts/pottsie.jpg’;
else if ($d == 4 && $h >= 13 && $h < 15) $img = ‘img/hosts/mikef.jpg’;
else if ($d == 4 && $h >= 15 && $h < 19) $img = ‘img/hosts/lizzy.jpg’;
else if ($d == 4 && $h >= 19) $img = ‘img/hosts/danic.jpg’;
else if ($d == 5 && $h < 0) $img = ‘img/hosts/danic.jpg’;// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = ‘img/hosts/petem.jpg’;
else if ($d == 5 && $h >= 4 && $h < 8) $img = ‘img/hosts/angelaa.jpg’;
else if ($d == 5 && $h >= 8 && $h < 10) $img = ‘img/hosts/shonw.jpg’;
else if ($d == 5 && $h >= 10 && $h < 12) $img = ‘img/hosts/patm.jpg’;
else if ($d == 5 && $h >= 12 && $h < 13) $img = ‘img/hosts/pottsie.jpg’;
else if ($d == 5 && $h >= 13 && $h < 15) $img = ‘img/hosts/edp.jpg’;
else if ($d == 5 && $h >= 15 && $h < 18) $img = ‘img/hosts/lizzy.jpg’;
else if ($d == 5 && $h >= 18 && $h < 20) $img = ‘img/hosts/jeremyb.jpg’;
else if ($d == 5 && $h >= 20 && $h < 22) $img = ‘img/hosts/exfyl.jpg’;
else if ($d == 5 && $h >= 22) $img = ‘img/hosts/stickyb.jpg’;
else if ($d == 6 && $h < 0) $img = ‘img/hosts/stickyb.jpg’;// SATURDAY SCHEDULE
else if ($d == 6 && $h >= 4 && $h < 6) $img = ‘images/horario/pmw.jpg’;
else if ($d == 6 && $h >= 6 && $h < 7) $img = ‘images/horario/geoffh.jpg’;
else if ($d == 6 && $h >= 7 && $h < 7) $img = ‘images/horario/tomf.jpg’;
else if ($d == 6 && $h >= 7 && $h < 7) $img = ‘images/horario/tomf.jpg’;
else if ($d == 6 && $h >= 7 && $h < 9) $img = ‘images/horario/jimmyj.jpg’;
else if ($d == 6 && $h >= 9 && $h < 11) $img = ‘images/horario/jasonr.jpg’;
else if ($d == 6 && $h >= 11 && $h < 13) $img = ‘images/horario/hollyk.jpg’;
else if ($d == 6 && $h >= 13 && $h < 14) $img = ‘images/horario/hollyk.png’;
else if ($d == 6 && $h >= 14 && $h < 17) $img = ‘images/horario/hollyk.png’;
else if ($d == 6 && $h >= 17 && $h < 23) { $img = ‘images/horario/byron.png’; $locutor = ‘Byron’; $hora = ‘5:00 PM – 11:00 PM’; $text = ‘ELECTRONIC MUSIC RADIO SHOW’; if(mb_strlen($text)>13) { $text=mb_substr($text, 0, 13); $text.=’…’; } }
else if ($d == 6 && $h >= 23) $img = ‘images/horario/hairballj.jpg’;
else if ($d == 0 && $h < 0) $img = ‘images/horario/hairballj.jpg’;// SATURDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 2) $img = ‘img/hosts/darrelm.jpg’;
else if ($d == 0 && $h >= 2 && $h < 4) $img = ‘img/hosts/techtronic.jpg’;
else if ($d == 0 && $h >= 4 && $h < 5) $img = ‘img/hosts/bigjon.jpg’;
else if ($d == 0 && $h >= 5 && $h < 6) $img = ‘img/hosts/joebear.jpg’;
else if ($d == 0 && $h >= 6 && $h < 8) $img = ‘img/hosts/russh.jpg’;
else if ($d == 0 && $h >= 8 && $h < 9) $img = ‘img/hosts/ronk.jpg’;
else if ($d == 0 && $h >= 9 && $h < 10) $img = ‘img/hosts/rockpoint.jpg’;
else if ($d == 0 && $h >= 10 && $h < 11) $img = ‘img/hosts/churchatqc.jpg’;
else if ($d == 0 && $h >= 11 && $h < 12) $img = ‘img/hosts/desertcf.jpg’;
else if ($d == 0 && $h >= 12 && $h < 16) $img = ‘img/hosts/kristenm.jpg’;
else if ($d == 0 && $h >= 16 && $h < 17) $img = ‘img/hosts/cdogg.jpg’;
else if ($d == 0 && $h >= 17 && $h < 18) $img = ‘img/hosts/snarf_daff.jpg’;
else if ($d == 0 && $h >= 18 && $h < 19) $img = ‘img/hosts/sonicsociety.jpg’;
else if ($d == 0 && $h >= 19 && $h < 21) $img = ‘img/hosts/jscott.jpg’;
else if ($d == 0 && $h >= 21) $img = ‘img/hosts/ghostlytalk.jpg’;
else if ($d == 1 && $h < 0) $img = ‘img/hosts/ghostlytalk.jpg’;echo'<div style=”float: left; width: 90px”>
</div><div style=”float: left; width: 141px; height: 80px; margin-top: 10px; color: #FFFFFF; font-family: Tahoma; font-size: 15px;”>’.$text.’ <br \>’.$hora.'<br \> Con: ‘.$locutor.'</div>’;
?>I would like to display this in the same area as the tag line section.
If anyone could help with this and point me in the right direction to doing this i would appreciate it a lot.
Thanks
Ben
- The topic ‘Adding code to a section in the header.’ is closed to new replies.