Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * File mod_jock.php
- *
- * @version 1.7.1
- * @date 11.16.11
- * @author Greg Rickaby
- *
- */
- // don't allow other scripts to grab and execute our file
- defined('_JEXEC') or die('Direct Access to this location is not allowed.');
- /**
- * Force Time Zone (Requires PHP 5.1+)
- *
- * @since 1.4
- * @author Greg Rickaby
- *
- This forces the Jock Rotator to ignore the server Time Zone (which is usually GMT) and allows you to specify your own. You must be running PHP 5.1 or above. If your server doesn't use PHP 5.1 or above, ask your server admin to upgrade. You could also delete this section.
- Example Time Zones:
- Eastern time = America/New_York
- Central time = America/Chicago
- Mountain time = America/Denver
- Pacific time = America/Los_Angeles
- To find your timezone visit: http://unicode.org/cldr/data/diff/supplemental/territory_containment_un_m_49.html
- */
- date_default_timezone_set( 'America/Chicago' );
- /**
- * Begin Jock Rotator
- *
- * @since 1.0
- * @author Greg Rickaby
- *
- The Jock Rotator is nothing more than a PHP Case Statement. What it does is look at the server date and time, and asks: "Is it before 10:00am? Yes? Then display this jock. etc..." Edit the HTML in each respective time-slot below to customize.
- $i = equals the numerical value of the day of the week
- Sunday = 0
- Monday = 1
- Tuesday = 2
- Wednesday = 3
- Thursday = 4
- Friday = 5
- Saturday = 6
- $x = equals the 24-hour format of an hour with minutes (without the leading zero). You must use 24-hour time!
- Examples:
- 0000 = Midnight
- 900 = 9:00 AM
- 1200 = Noon
- 1430 = 2:30 PM
- 1845 = 6:45 PM
- */
- $i = date( "w" ); // day of the week
- $x = date( "Hi" ); // hour and minutes
- switch ($i) { // start the case statement
- ############################# Start 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;
- ################################# Start 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;
- ################################# Start 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
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement