Jump to content

mod jock on air now


Recommended Posts

hi guys can you please help me with this php code

also i dont understand jock-page.html please help

 

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

* @copyright Copyright © 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

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//------------------------------- Weekday Mornings 6a-10a -----------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//------------------------------ Weekday Middays 10a-3p ------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

 

//------------------------------- Weekday Afternoons 3p-7p ----------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//------------------------------- Weekday Nights 7p-11:59p ----------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

 

break;

 

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

 

case "6":

 

//------------------------------ Saturday Overnights 12a-6a ---------------------------

if ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//----------------------------- Saturday Mornings 6a-10a ------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//------------------------------- Saturday Middays 10a-3p -----------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//-------------------------------- Saturday Afternoons 3p-7p --------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//-------------------------------- Saturday Nights 7p-11:59p---------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

 

break;

 

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

 

case "0":

 

//------------------------- Sunday Overnights 12a-6a-------------------------------------

if ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//-------------------------- Sunday Mornings 6a-10a---------------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//-------------------------- Sunday Middays 10a-3p ----------------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//------------------------- Sunday Afternoons 3p-7p ---------------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

//-------------------------- Sunday Nights 7p-11:59p ----------------------------------------

elseif ( $x

 

Jock Name

/images/jock_pics/jock.jpg

 

'; }

 

// end switch

}

 

// end jock_rotator()

}

?>

 

 

 

also the timings on our schedule please help with that

 

[h=3]Mondays[/h] Tallica: half 3

Mike: 4pm-6pm

DANIEL 8 am-10 am

DANIEL 6 pm-8 pm

Phillip- 8-10pm

[h=3]Tuesdays[/h] Tallica: half 3

Mike: 4pm-6pm

Ethan&Chris 12-5

leon: 9-11pm

Rachel: 6-7pm

Alex: 8-10pm

 

[h=3]Wednesdays[/h] Tallica: after 1

Mike: 4pm-6pm

DJ AUBREY 5:00 PM 6:00 PM

Lee Mills 9-11pm

[h=3]Thursdays[/h] Tallica: after 1

Leoni 5-6pm

phillip: 7pm

[h=3]Fridays[/h] leon: 9-11pm

 

[h=3]Saturdays[/h] kojo: 5-9pm

Jamie- 7-9pm

[h=3]Sundays[/h] Damien- 8am-9am

Leoni 3-5pm

kojo: 5-9pm

empressiveme: 3-5pm

Alex: 8-10pm

Link to comment
Share on other sites

this script has cases 1-5 for Monday through Friday. you will need to break out each case because your mon-fri schedule is different daily. it was set up with a simple time check to show whos on air. however you have gaps between your shows and you will need to add extra checks to each case that shows that your auto dj is running.

 

also the jock-page.html file refers to the location of the dj profile page if you have one on your site.

 

try to modify it and post your results.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...