on air now php

djultra

Member
hi guys i hope someone can help me with a certain
php on air code at all,


<?php
/**
* File mod_jock.php
*
* This file builds the Jock Rotator. The Jock Rotator is nothing more than a PHP switch satement.
* It reads your server's time/date and asks: "Is it before 10:00am? Yes? Then display this jock."
*
* @version 3.0.2
* @author Greg Rickaby <greg@gregrickaby.com>
* @copyright Copyright (c) 2013
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @link http://gregrickaby.com/jock-rotator-for-joomla
* @alter 2013.07.04
*
*/
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );


/**
* Force Time Zone
*
* This forces Jock Rotator to ignore the server Time Zone (which is usually GMT) and allows you to specify your own.
* To find your timezone visit: http://unicode.org/cldr/data/diff/supplemental/territory_containment_un_m_49.html
*
* @author Greg Rickaby
* @since 1.4
* @requires PHP 5.1+
*/
date_default_timezone_set( 'America/Chicago' );


/**
* Jock Rotator Function
*
* This executes the jock rotator.You can place this function anywhere in your template and
* the Jock Rotator will appear.
*
* @author Greg Rickaby
* @since 3.1
*/
jock_rotator();


/**
* Time switching
*
* TO CUSTOMIZE: edit the HTML in each respective time-slot below.
*
* @author Greg Rickaby
* @since 1.0
*/
function jock_rotator() {

$i = date( 'w' );
$x = date( 'Hi' );

switch ( $i ) {

################################### Monday - Friday ###################################

case "1":
case "2":
case "3":
case "4":
case "5":

//------------------------------- Weekday Overnights 12a-6a ---------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Weekday Mornings 6a-10a -----------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------ Weekday Middays 10a-3p ------------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

//------------------------------- Weekday Afternoons 3p-7p ----------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Weekday Nights 5p-6:59p ----------------------------
elseif ( $x < 2359 ) { echo '

<a href="http://spwr.co.uk/presenters-djs?layout=edit&id=11">DJ AUBREY<br /><img src="images/presenters/jay.png"></a>

'; }

break;

####################################### Saturday ######################################

case "6":

//------------------------------ Saturday Overnights 12a-6a ---------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//----------------------------- Saturday Mornings 6a-10a ------------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Saturday Middays 10a-3p -----------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------------- Saturday Afternoons 3p-7p --------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------------- Saturday Nights 7p-11:59p---------------------------
elseif ( $x < 2359 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

break;

########################################## Sunday ######################################

case "0":

//------------------------- Sunday Overnights 12a-6a-------------------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Mornings 6a-10a---------------------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Middays 10a-3p ----------------------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------- Sunday Afternoons 3p-7p ---------------------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Nights 7p-11:59p ----------------------------------------
elseif ( $x < 2359 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

// end switch
}

// end jock_rotator()
}
?>


now my presenters have different times as of when they go on air?


here are the times




Mondays
DANIEL 8 am-10 am

DANIEL 6 pm-8 pm

Phillip- 8-10pm

Tuesdays
Ethan&Chris 12-5

leon: 9-11pm

Rachel: 6-7pm



Wednesdays
DJ AUBREY 5:00 PM 6:00 PM

Lee Mills 9-11pm

Thursdays
Leoni 5-6pm

Fridays
leon: 9-11pm



Saturdays
kojo: 5-9pm

Jamie- 7-9pm

Sundays
Damien- 8am-9am

Leoni 3-5pm

kojo: 5-9pm


so please help
 
Hi DJUltra

This is a bit off topic as its a programming question rather than an internet radio one but I'll point you in the right direction. You should really get someone with a little programming skill to help you implement this. Basically you have changed the comment rather than the actual code to reflect the time of DJ AUBREY :

Code:
//------------------------------- Weekday Nights 5p-6:59p ----------------------------
elseif ( $x < 2359 ) { echo '

<a href="[URL]http://spwr.co.uk/presenters-djs?layout=edit&id=11[/URL]">DJ AUBREY<br /><img src="images/presenters/jay.png"></a>

'; }

You need to change the variable you're comparing $x to in order to reflect the times of your DJ's. If this goes over your head you need to get a programmer to look at this for you as we can't teach you to code here I'm afraid.

Good Luck!
 
Last edited:
Top