Results 1 to 1 of 1
  1. #1

    Title
    Barely A Broadcaster
    Join Date
    Jun 2016
    Location
    Hastings East Sussex
    Posts
    84
    Rep Power
    0

    Question on air

    hi i got this script from james
    on here somewhere

    PHP Code:
    <?php// 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 = 'off-air'; // off-air    $default_image_on_air = 'http://hottunez-radio.com/images/nodj.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' => 0, // Start Time (24 hour format)            'end_time' => 19,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/AutoDj.png'        ],        [        'show_name' => "Monday", // Show name            'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 19, // Start Time (24 hour format)            'end_time' => 21,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/AutoDj.png'        ],        [    'show_name' => "Monday", // Show name            'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 21, // Start Time (24 hour format)            'end_time' => 0,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/AutoDj.png'        ],        [            'show_name' => "Tuesday", // Show name            'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 22, // Start Time (24 hour format)            'end_time' => 01,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/dj here.jpg'        ],        [            'show_name' => "Wednesday", // Show name            'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 0, // Start Time (24 hour format)            'end_time' => 20,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/AutoDj.png'        ],        [            'show_name' => "Thursday Jukebox", // Show name            'day' => "Thursday", // 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://hottunez-radio.com/images/AutoDj.png'        ],        [              'show_name' => "Thursday Jukebox", // Show name            'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 22, // Start Time (24 hour format)            'end_time' => 0,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/djstrawbs.jpg'        ],        [            'show_name' => "Friday Jukebox", // jukebox|requests            'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 0, // Start Time (24 hour format)            'end_time' => 10,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/AutoDj.png'        ],        [            'show_name' => "Friday Jason", // jason's show            'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 19, // Start Time (24 hour format)            'end_time' => 22,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/dj here.jpg'        ],        [            'show_name' => "Friday Kenny", // Kenny's show            'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 21, // Start Time (24 hour format)            'end_time' => 0,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/djkenny.jpg'                    ],        [   'show_name' => "Friday Jukebox", // Jukebox|Requests            'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 22, // Start Time (24 hour format)            'end_time' => 08,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/djkenny.jpg'                    ],        [             'show_name' => "Saturday Kenny", // Kenny's Show            'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 22, // Start Time (24 hour format)            'end_time' => 23,  // End Time (24 hour format)            'image' => 'http://hottunez-radio.com/images/djkenny.jpg'        ],        [            'show_name' => "Sunday Jukebox", // Jukebox|Requests            '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://hottunez-radio.com/images/AutoDj.png'        ]    ];      'show_name' => "Sunday Jukebox", // Jukebox|Requests            '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://hottunez-radio.com/images/AutoDj.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 < 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;}
    ?>ON AIR NOW:<br /><img src="<?php echo onAirNow()[1]; ?>"><br /><h3><?php echo onAirNow()[0]; ?></h3>

    and i'v gone to test it and i'm getting a page on my server saying this page isn't working?

    now i'm just wondering if anyone could look it over please?
    Last edited by ultra89; 11-22-2019 at 01:57 AM. Reason: rewrite

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
  •