Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jock Rotator Usage
<?php
/**
* File mod_jock.php
*
* This file builds the Jock Rotator. The Jock Rotator is nothing more than a PHP Case Statement.
* It reads your server's time/date and asks: "Is it before 10:00am? Yes? Then display this jock."
*
* @version 2.5.0
* @author Greg Rickaby <greg@gregrickaby.com>
* @copyright Copyright (c) 2012
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @link http://gregrickaby.com/go/jock-rotator
* @alter 02.21.2012
*
*/
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' );
/**
* Begin The Jock Rotator
*
* TO CUSTOMIZE: edit the HTML in each respective time-slot below.
*
* @author Greg Rickaby
* @since 1.0
*
*/
$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 '
<center><img src="/images/now_playing/700_the_farm_logo.jpg"><br />700 The Farm</center>
'; }
//------------------------------- Weekday Mornings 6a-10a -----------------------------
elseif ($x < 900 ) { echo '
<center><a href="http://www.700thefarm.com/index.php/eli-and-stan"><img src="/images/now_playing/6a_9a_eli_stan.jpg"><br />Eli &amp; Stan 6a-9a</a></center>
'; }
//------------------------------ Weekday Middays 9a-Noon ------------------------------
elseif ($x < 1200 ) { echo '
<center><a href="http://boortz.com"><img src="/images/now_playing/9a_12p_neal_boortz.jpg"><br />Neal Boortz 9a-12p</a></center>
'; }
//------------------------------- Weekday Afternoons Noon-1p ----------------------------
elseif ($x < 1300 ) { echo '
<center><img src="/images/now_playing/12p_farm_report.jpg">Noon Farm Report</center>
'; }
//------------------------------- Weekday Afternoons 1p-4p ----------------------------
elseif ($x < 1600 ) { echo '
<center><a href="http://www.mikeonline.com/"><img src="/images/now_playing/1p_4p_mike_gallagher.jpg"><br />Mike Gallagher 1p-4p</a></center>
'; }
//------------------------------- Weekday Nights 7p-11:59p ----------------------------
elseif ($x < 2359 ) { echo '
<center><img src="/images/now_playing/700_the_farm_logo.jpg"><br />700 The Farm</center>
'; }
break;
########################################## Saturday ######################################
case "6":
//------------------------------ Saturday All Day ---------------------------
if ($x < 2359 ) { echo '
<center><img src="/images/now_playing/700_the_farm_logo.jpg"><br />700 The Farm</center>
'; }
break;
############################################ Sunday ######################################
case "0":
//------------------------- Sunday All Day-------------------------------------
if ($x < 2359 ) { echo '
<center><img src="/images/now_playing/700_the_farm_logo.jpg"><br />700 The Farm</center>
'; }
// end mod_jock.php
} ?>
@viper70785

This comment has been minimized.

Copy link

commented Mar 9, 2015

can i use this with a link too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.