Skip to content

Instantly share code, notes, and snippets.

@gregrickaby
Created February 21, 2012 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregrickaby/1877119 to your computer and use it in GitHub Desktop.
Save gregrickaby/1877119 to your computer and use it in GitHub Desktop.
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
Copy link

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