Radio Station Jock/DJ Roator - ON AIR NOW Module

Discuss the development and implementation of Joomla! modules here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
grickaby
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Oct 11, 2006 6:06 pm
Location: Dothan AL
Contact:

Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by grickaby » Fri May 18, 2007 3:37 pm

FOR ALL YOU RADIO STATION WEBMASTERS...

I've developed a very RAW "On Air Now" module to get your DJ's to rotate on your site according to the time they are on.

I'm using this on two sites, and will be rolling it out on 8 more.

Instructions are in the readme.txt
You do not have the required permissions to view the files attached to this post.

scleaves
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 16, 2007 3:37 am

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by scleaves » Tue Jul 17, 2007 1:37 am

Hey Dude!! This is perfect!! Just what I was looking for, thanks!

One caveat: you have overnights listed last, with an "elseif $x <5" - I found this to be ineffective, since the first time period - morning drive, starts the loop w "if $x <9". Since any number less than 5 is ALSO less than 9, they match out first and my morning guy has to Jock all night long - the condition for overnight is never met. I solved this by simply moving overnight into the first "if" position and changing morning drive to "elseif" like the rest.

Other than that one quirk, as I say, this is JUST what I needed - Thanks again!!!

SC

grickaby
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Oct 11, 2006 6:06 pm
Location: Dothan AL
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by grickaby » Tue Jul 17, 2007 1:10 pm

SC,

I'm thrilled it worked out well for you. If don't mind, re-post your revised script! :)

-GREG

scleaves
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 16, 2007 3:37 am

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by scleaves » Thu Jul 19, 2007 1:32 pm

Sure - here it is - again, all I did was move 'Overnights' to the top 'if' position, and then change 'Mornings' from 'if' to 'elseif'. Oh, I also removed the hyperlinks cause I didn't need them, but I may put them back later...
       
               
       
"; }

//-------------------------------------------------------------------------------------------
//Mornings - This is a simple php print script with a table inside. Edit the table to meet your needs.

    elseif ($x
       
               
       
"; }

//--------------------------------------------------------------------------------------------   
//Middays

    elseif ($x
       
               
       
"; }
   
//-------------------------------------------------------------------------------------------
//Afternoons

    elseif ($x
       
               
       
"; }

//-------------------------------------------------------------------------------------------
//NASCAR

    elseif ($x
       
               
       
"; }
   
//-------------------------------------------------------------------------------------------
//Nights

    elseif ($x
       
               
       
"; }
   

break;

//-------------------------------------------------------------------------------------------
//Weekend Script

case "6":  //Saturday
case "0":  //Sunday
    { print"
       
               
       
"; }
    break;
}
?>
There you go! Another thing I found out the hard way - be sure to check the time on your hosting server!!! In my case, our hosting provider was in another time zone, so that was messing me up, too. I threw a quick "echo $x;" at it, so it would just print the number, then once I knew how far offf I was, made my adjustments accordingly.

Thanks again!!

SC

User avatar
brianpeat
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jul 10, 2007 3:04 pm
Location: Hendersonville, TN, USA
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by brianpeat » Fri Aug 31, 2007 8:48 pm

This is a live saver...but my only problem with it, can it do half hour spots? I'm going to test it using :30 after the hour number, but I suspect that might not work.
Brian Peat,
Owner, Peat Creative
https://peatcreative.com

User avatar
brianpeat
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jul 10, 2007 3:04 pm
Location: Hendersonville, TN, USA
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by brianpeat » Sat Sep 01, 2007 2:04 pm

Okay, I edited this line:
$x = date("G"); // This equals the 24-hour format of an hour without leading zeros
and made it
$x = date("Hi"); // This equals the 24-hour format of an hour without leading zeros

and then I used a format like 0330 to mean 3:30 am. I think it's working because I don't get any php errors (I did when I tried to use a time format with a : as the separator). I'm still trying to figure out how to get time into the weekend portion, but if it's something that your mod can do, I'm sure I'll figure it out.

thanks for a great mod, this is exactly what my site needed.

EDIT: SUCCESS! I some how missed stand alone IF statement in the first thread of each day or section. The weekend stuff works fine now.
Last edited by brianpeat on Sat Sep 01, 2007 2:08 pm, edited 1 time in total.
Brian Peat,
Owner, Peat Creative
https://peatcreative.com

grickaby
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Oct 11, 2006 6:06 pm
Location: Dothan AL
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by grickaby » Mon Sep 03, 2007 2:46 pm

Dude...glad you got it figured out. As I mentioned in my first post it was very "raw". I'm really not much of a PHP programmer, but I knew that if I posted what I had others would run with it.

The time-zone issue has bitten me too. One of my stations host is in California and they are on the east coast! Oops!

Glad it's working out well for you.

Open-Source Forever

-GREG

spindoc
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Mon Jun 09, 2008 6:14 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by spindoc » Mon Oct 13, 2008 6:27 pm

I've been looking for this forever. Do you have it compatible with j1.5?

I tried to install it and it tells me :

XML Parsing Error at 6:43. Error 4: not well-formed (invalid token)
Module Install: No module file specified

grickaby
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Oct 11, 2006 6:06 pm
Location: Dothan AL
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by grickaby » Fri Jan 09, 2009 10:13 pm

I've got it installed on a 1.5.8 and working correctly: see: www.v935.com

You can download the latest version here: http://gregrickaby.com/jock-rotator-for-joomla.html

Please let me know if it works or not!

spindoc
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Mon Jun 09, 2008 6:14 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by spindoc » Sat Jan 10, 2009 12:07 am

Wonderful, thats great news, thanx for your hard work, I'll try it out right away!

dvid
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jul 31, 2009 7:00 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by dvid » Fri Jul 31, 2009 7:05 pm

Its a great module

But is it possible to make form weekdays
a monday
tuesday
etc etc
and how can we do that

djdanger
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Nov 09, 2009 12:39 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by djdanger » Mon Nov 09, 2009 12:56 pm

Hello there first of all this looks brilliant its just what i need fo my website im just a bit stuck and any help very much apreciated.
Ok so the way i will need it to work is each dj has a 2 hour spot through the days but need to beable to change every day not just weekday mornings afternoons and evening i need
e.g
monday 8 dj xxx monday 10 dj gss monday 12 djpp and every 2hours then auto into
Tuesday 8 dj ste tuesday 10 djk e.t.c
throughout the week can any 1 help please

imnbiz
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Nov 19, 2010 4:26 pm
Contact:

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by imnbiz » Fri Nov 19, 2010 4:28 pm

Hi,

Where can I find a good Radio Talk Show Host template?

jaimin_1985
Joomla! Intern
Joomla! Intern
Posts: 60
Joined: Fri Oct 29, 2010 6:53 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by jaimin_1985 » Thu May 05, 2011 5:57 am

Hello Guys,

Am trying to install this module in My Joomla 1.5 with legacy mode on, bit it shows following error.

"Module Install: No module file specified"

Please suggest

rodance
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 06, 2011 1:24 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by rodance » Wed Jul 06, 2011 1:41 pm

Help :( XML Parsing Error at 6:43. Error 4: not well-formed (invalid token)
Module Install: No module file specified with plugin legacy enabled

djultra1989
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jan 08, 2016 11:09 pm

Re: Radio Station Jock/DJ Roator - ON AIR NOW Module

Post by djultra1989 » Sat Jan 09, 2016 12:49 am

please help with my script i want my djs to do mondays tuesdays ect
so that it fits around our schedule?

<?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 <[email protected]>
* @copyright Copyright (c) 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/suppl ... _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 ) {
// Weekday Script
case "1": //Monday
case "2": //Tuesday
case "3": //Wednesday
case "4": //Thursday
case "5": //Friday

//------------------------------- Weekday Overnights 12a-6a ---------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Weekday Mornings 6a-10a -----------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------ Weekday Middays 10a-3p ------------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

//------------------------------- Weekday Afternoons 3p-7p ----------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Weekday Nights 7p-11:59p ----------------------------
elseif ( $x < 2359 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

break;

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

case "6":

//------------------------------ Saturday Overnights 12a-6a ---------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//----------------------------- Saturday Mornings 6a-10a ------------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------------- Saturday Middays 10a-3p -----------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------------- Saturday Afternoons 3p-7p --------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------------- Saturday Nights 7p-11:59p---------------------------
elseif ( $x < 2359 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

break;

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

case "0":

//------------------------- Sunday Overnights 12a-6a-------------------------------------
if ( $x < 600 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Mornings 6a-10a---------------------------------------
elseif ( $x < 1000 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Middays 10a-3p ----------------------------------------
elseif ( $x < 1500 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//------------------------- Sunday Afternoons 3p-7p ---------------------------------------
elseif ( $x < 1900 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }
//-------------------------- Sunday Nights 7p-11:59p ----------------------------------------
elseif ( $x < 2359 ) { echo '

<a href="jock-page.html">Jock Name<br /><img src="/images/jock_pics/jock.jpg"></a>

'; }

// end switch
}

// end jock_rotator()
}
?>

check our schedule for info

http://urban-radio.co.uk/schedule


Locked

Return to “Modules”