Jump to content

[Useful] Now On Air Script


mattskills
 Share

Recommended Posts

  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

You said that the DJ name shows correctly. As in when a live show is on air (NOT auto dj), the name shows, but the image doesnt. You confirmed that to me.

Now you say that that's not the case?

 

ultra89, I can't help you if you cannot help me by providing detailed information. We are going around in circles here.

Studiio - All-In-One Radio Communication Platform
SMS | Phone Calls | Social Media | Content

Link to comment
Share on other sites

no lol basically when the image is not on autodj i don't show up with the current dj, so say i have a dj thats on from 3pm till 5pm for example it will not show there image? it just stays on autodj image when it should be changing to that current dj's image
Link to comment
Share on other sites

	// Set the timezone	// See full list of timezones here: http://php.net/manual/en/timezones.php	date_default_timezone_set('Europe/London');
// Set default text and default image | When a show is not on air, this text and image will display	$default_on_air = ''; // Default text	$default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image
// Shows array, edit this information for each show	$shows = [		[			'show_name' => "Monday", // Show name			'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 01, // Start Time (24 hour format)			'end_time' => 23,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/images/offline.png'		],		[			'show_name' => "Tuesday", // Show name			'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 01, // Start Time (24 hour format)			'end_time' => 23,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/images/offline.png'                ],		[			'show_name' => "Wednesday", // Show name			'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 01, // Start Time (24 hour format)			'end_time' => 23,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/images/offline.png'		],		[			'show_name' => "Thursday Jukebox", // Show name			'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 01, // Start Time (24 hour format)			'end_time' => 23,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/images/offline.png'		],		[			'show_name' => "Friday Strawbs", // jay's show			'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 18, // Start Time (24 hour format)			'end_time' => 20,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'                ],		[			'show_name' => "Saturday Strawbs", // Jay's Show			'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 18, // Start Time (24 hour format)			'end_time' => 20,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'                ],		[			'show_name' => "Sunday Sunday", // 80's 			'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)			'start_time' => 18, // Start Time (24 hour format)			'end_time' => 20,  // End Time (24 hour format)			'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'		]	];
/////////////////////////////////////////////////////	////////// DO NOT EDIT BELOW THIS LINE //////////////	/////////////////////////////////////////////////////
$now_day = date('l');	$now_time = date('G');
$output = array($default_on_air, $default_image_on_air);
for($i = 0; $i = $now_time && $shows[$i]['end_time'] 	return $output;
} ?>ON AIR NOW:
<?php echo onAirNow()[1]; ?>



Link to comment
Share on other sites

Well first of all, half of your script is commented out and incorrectly formatted. So it won't run.

You are not using the script exactly how I posted it in my other thread. Ensure you use a proper code editor as the code structure is very important.

 

I've just spent the last half hour fixing up your formatting issues, let me know how you go:

// James' Show On Air Script
// http://broadcastingworld.com/
function onAirNow() {
   // Set the timezone
   // See full list of timezones here: http://php.net/manual/en/timezones.php
   date_default_timezone_set('Europe/London');


   // Set default text and default image | When a show is not on air, this text and image will display
   $default_on_air = ''; // Default text
   $default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image


   // Shows array, edit this information for each show
   $shows = [
       [
           'show_name' => "Monday", // Show name
           'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 01, // Start Time (24 hour format)
           'end_time' => 23,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/images/offline.png'
       ],
       [
           'show_name' => "Tuesday", // Show name
           'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 01, // Start Time (24 hour format)
           'end_time' => 23,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/images/offline.png'
       ],
       [
           'show_name' => "Wednesday", // Show name
           'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 01, // Start Time (24 hour format)
           'end_time' => 23,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/images/offline.png'
       ],
       [
           'show_name' => "Thursday Jukebox", // Show name
           'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 01, // Start Time (24 hour format)
           'end_time' => 23,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/images/offline.png'
       ],
       [
           'show_name' => "Friday Strawbs", // jay's show
           'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 18, // Start Time (24 hour format)
           'end_time' => 20,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
       ],
       [
           'show_name' => "Saturday Strawbs", // Jay's Show
           'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 18, // Start Time (24 hour format)
           'end_time' => 20,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
       ],
       [
           'show_name' => "Sunday Sunday", // 80's
           'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
           'start_time' => 18, // Start Time (24 hour format)
           'end_time' => 20,  // End Time (24 hour format)
           'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
       ]
   ];
   /////////////////////////////////////////////////////
   ////////// DO NOT EDIT BELOW THIS LINE //////////////
   /////////////////////////////////////////////////////
   $now_day  = date('l');
   $now_time = date('G');
   $output   = array(
       $default_on_air,
       $default_image_on_air
   );
   for ($i = 0; $i         if ($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time']             $output = array(
               $shows[$i]['show_name'],
               $shows[$i]['image']
           );
       }
   }
   return $output;
}
?>
ON AIR NOW:

<?php echo onAirNow()[1]; ?>


Studiio - All-In-One Radio Communication Platform
SMS | Phone Calls | Social Media | Content

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...