Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44

Thread: on air script

  1. #1

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    78
    Rep Power
    6

    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,901
    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
    78
    Rep Power
    6
    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
    78
    Rep Power
    6
    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,114
    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,114
    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.

  7. #7

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    78
    Rep Power
    6
    so if i want friday saturday and sunday were am i meant to put the images for that

    and i don't get this script could you help out please
    Last edited by djaubs89; 08-30-2017 at 08:00 PM.

  8. #8
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,114
    Rep Power
    10
    Quote Originally Posted by djaubs89 View Post
    so if i want friday saturday and sunday were am i meant to put the images for that

    and i don't get this script could you help out please
    You add the shows to the array and change the variables required. For example if you had three shows, two on Friday, one on Saturday and one on Sunday, it would look like this:

    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 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 = ''; // Default image
    
        // Shows array, edit this information for each show
        $shows = [
            [
                'show_name' => "Friday Show 1", // Show name
                'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
                'start_time' => 9, // Start Time (24 hour format)
                'end_time' => 11,  // End Time (24 hour format)
                'image' => 'http://lorempixel.com/400/200'
            ],
            [
                'show_name' => "Friday Show 2", // Show name
                'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
                'start_time' => 11, // Start Time (24 hour format)
                'end_time' => 14,  // End Time (24 hour format)
                'image' => 'http://lorempixel.com/400/200'        
            ],
            [
                'show_name' => "Saturday Show", // Show name
                'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
                'start_time' => 15, // Start Time (24 hour format)
                'end_time' => 18,  // End Time (24 hour format)
                'image' => 'http://lorempixel.com/400/200'
            ],
            [
                'show_name' => "Sunday Show", // Show name
                'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
                'start_time' => 14, // Start Time (24 hour format)
                'end_time' => 16  // End Time (24 hour format),
                'image' => 'http://lorempixel.com/400/200'
            ]
        ];
    
        /////////////////////////////////////////////////////
        ////////// 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 < count($shows); $i++) {
            if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) {
                $output = array($shows[$i]['show_name'], $shows[$i]['image']);
            }
        }
    
        return $output;
    
    } 
    ?>
    Then when you want to display the show name, simply paste this:

    Code:
    <?php echo onAirNow()[0]; ?>
    If you want to display the image, simply paste this:

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

    This code hasn't been tested, so let me know if this doesn't work.
    Last edited by James; 08-31-2017 at 11:28 AM.

  9. #9

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    78
    Rep Power
    6
    ok so i have this

    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.europe.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 = ''; // Default image
    
    
    
    
    
    
    
    
        // Shows array, edit this information for each show
        $shows = [
            [
                'show_name' => "Friday Show ", // 80s
                '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/images/strawbs.jpg'
            ],
            [
                        ],
    
    
    
    
            [
                'show_name' => "Saturday Show", // 80s
                '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/images/strawbs.jpg'        ],
            [
                'show_name' => "Sunday Show", // 80s
                '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/images/strawbs.jpg'        ]
        ];
    
    
    
    
    
    
    
    
        /////////////////////////////////////////////////////
        ////////// 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 < count($shows); $i++) {
            if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) {
                $output = array($shows[$i]['show_name'], $shows[$i]['image']);
            }
        }
    
    
    
    
    
    
    
    
        return $output;
    
    
    
    
    
    
    
    
    } 
    ?>
    but were do i put monday tuesday wednesday thursday
    Last edited by James; 08-31-2017 at 11:29 AM.

  10. #10

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Posts
    78
    Rep Power
    6
    not working.jpg ok this script is not working

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
  •