Results 1 to 6 of 6

Thread: on air script

  1. #1

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    5

    on air script

    hello rite no one has helped me out with a script for on air

    i know papabear has helped but that script is not working.

    were looking for a script that 106themix had on there site when they was running
    i know some people use mysql for running there script but i would rather not.

    please if anyone can help me with a script like 106themix had that would be "great"

    many thanks

  2. #2
    GKIye's Avatar
    Title
    Moderator
    Join Date
    Nov 2008
    Location
    @ home
    Posts
    2,898
    Rep Power
    66
    At this forum of BW You can find the attached script.
    It "works", I use it also.
    It shows "Artist - Song" at every rotation ... so also if an ID etc is played

    Please check the attached zip file
    The folder and text file with the code for your website are included

    Enjoy !
    Attached Files Attached Files
    If You Like My Work Which I Have Done For You

    Visit and listen @ BW !



  3. #3

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    5
    im looking for an on air script which shows when the djs are on air

    but a script what 106themix had

  4. #4

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    5
    i have this code

    PHP Code:
    <?php //set timezone putenv ('TZ=london/western europe'); mktime(0,0,0,1,1,1970); $day = date("N"); $time = date("Hi"); if ($day == 7)  { switch($time)     {         case ($time >= '0600' && $time <= '0959'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;         case ($time >= '1000' && $time <= '1200'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;         default:             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;     } } elseif($day == 6)  {     echo"<img src='images/jukebox.gif' alt='Devil is On-Air Now' class='onair'/>"; } else  {         switch($time)     {         case ($time >= '0600' && $time <= '0959'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;         case ($time >= '1000' && $time <= '1459'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;         case ($time >= '1500' && $time <= '1859'):             echo"<img src='images/jukebox.gif' alt='devil' class='onair'/>";             break;              case ($time >= '1900' && $time <= '2359'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;                 case ($time >= '2400' && $time <= '0559'):             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";         default:             echo"<img src='images/jukebox.gif' alt='devil is On-Air Now' class='onair'/>";             break;             }     } ?>

    but what time zone do i put it in as im in united kingdom

  5. #5
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,090
    Rep Power
    10
    Here's a list of supported timezones: http://php.net/manual/en/timezones.php

    "Europe/London" is what you are looking to use for the timezone.

  6. #6
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,090
    Rep Power
    10
    You could try something like this (whipped this up quickly):

    Code:
    <?php 
    function onAirNow() {
    	// James' Show On Air Script
    	// http://broadcastingworld.com/
    
    
    	// Set the timezone
    	// See full list of timezones here: http://php.net/manual/en/timezones.php
    	date_default_timezone_set('America/Los_Angeles');
    
    
    	// Set default text | When a show is not on air, this text will display
    	$default_on_air = '';
    
    
    	// Shows array, edit this information for each show
    	$shows = [
    		[
    			'show_name' => "Sample Show", // Show name
    			'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    			'start_time' => 9, // Start Time (24 hour format)
    			'end_time' => 11  // End Time (24 hour format)
    		],
    		[
    			'show_name' => "The Best Show In The World", // Show name
    			'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    			'start_time' => 12, // Start Time (24 hour format)
    			'end_time' => 13  // End Time (24 hour format)
    		],
    		[
    			'show_name' => "Test Show", // Show name
    			'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    			'start_time' => 14, // Start Time (24 hour format)
    			'end_time' => 16  // End Time (24 hour format)
    		]
    	];
    
    
    	/////////////////////////////////////////////////////
    	////////// DO NOT EDIT BELOW THIS LINE //////////////
    	/////////////////////////////////////////////////////
    
    
    	$now_day = date('l');
    	$now_time = date('G');
    
    
    	$output = $default_on_air;
    
    
    	for($i = 0; $i < count($shows); $i++) {
    		if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) {
    			$output = $shows[$i]['show_name'];
    		}
    	}
    
    
    	return $output;
    
    
    }
    ?>
    Simply copy and paste this code on your website and then include this code wherever you want the DJ/Show on air to appear:
    Code:
    <?php echo onAirNow(); ?>
    Remember to edit the info in the script above the line with your show/dj details, timezone and default text.

    Let me know if you have any issues.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •