Created
February 21, 2012 15:52
-
-
Save gregrickaby/1877119 to your computer and use it in GitHub Desktop.
Jock Rotator Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 <[email protected]> | |
* @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 & 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 | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can i use this with a link too?