Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 47
  1. #11
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,182
    Rep Power
    10
    You have put data in a comment rather than the actual script.

    Here is the script running perfectly fine:
    https://www.tehplayground.com/PLFCyp96cBBFRtBL

    I recommend reading a bit more about PHP if you wish to explore scripts like this, otherwise post your show schedule info and I can assist in creating the script. Usually this is a service that I charge for but im happy to guide you on the right track.

    I have also wrapped the code in [ CODE ] tags. Please use these so that the code is displayed correctly.
    Last edited by James; 08-31-2017 at 11:31 AM.

  2. #12

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7
    ok mine is working great ;) now how do i change to text colour

  3. #13
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,182
    Rep Power
    10
    Quote Originally Posted by djaubs89 View Post
    ok mine is working great ;) now how do i change to text colour
    Have a read up on HTML in order to style your text.
    https://www.w3schools.com/html/html_styles.asp

  4. #14

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7
    i don't see anywere in the script to change the colour of the text though

  5. #15

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7
    i want this part of the script $default_on_air = 'No DJ is on air'; // Default text

    in red

  6. #16

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7
    don't worry i have sorted it, but one small problem. does that script work with the rest of the week?
    and will it show my image /images/strawbs.png from 18 to 20 friday saturday and sunday

  7. #17
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,182
    Rep Power
    10
    Quote Originally Posted by djaubs89 View Post
    don't worry i have sorted it, but one small problem. does that script work with the rest of the week?
    and will it show my image /images/strawbs.png from 18 to 20 friday saturday and sunday
    Yes it works with any day as shown in the script comments (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday).
    You will have to set up a new array item for each of those days for those time periods.

  8. #18

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7

    Wink on air

    like this
    PHP 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 = 'No DJ is on air'; // Default text    $default_image_on_air = 'http://urban-radio.co.uk/images/jukebox.gif'; // Default image
        // Shows array, edit this information for each show    $shows = [        [            'show_name' => "Monday", // 80s            'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 01, // Start Time (24 hour format)            'end_time' => 20,  // End Time (24 hour format)            'image' => 'http://urban-radio.co.uk/images/jukebox.gif'                        'show_name' => "Tuesday", // 80s            'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 01, // Start Time (24 hour format)            'end_time' => 20,  // End Time (24 hour format)            'image' => 'http://urban-radio.co.uk/images/jukebox.gif'                        'show_name' => "Wednesday", // 80s            'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 01, // Start Time (24 hour format)            'end_time' => 20,  // End Time (24 hour format)            'image' => 'http://urban-radio.co.uk/images/jukebox.gif'                        'show_name' => "Thursday", // 80s            'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)            'start_time' => 01, // Start Time (24 hour format)            'end_time' => 20,  // End Time (24 hour format)            'image' => 'http://urban-radio.co.uk/images/jukebox.gif'                        'show_name' => "Friday Show 1", // 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' => "Friday Show 2", // 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;
    ?>DJ Now On Air: <br /><img src="<?php echo onAirNow()[1]; ?>"><br /><h3><?php echo onAirNow()[0]; ?></h3>

  9. #19
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,182
    Rep Power
    10
    Could you format it a bit better sorry? Im unable to read the code.

  10. #20

    Title
    Junior Broadcaster
    Join Date
    Oct 2012
    Location
    UK
    Posts
    86
    Rep Power
    7
    is this ok


    <?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 = 'No DJ is on air'; // Default text
    $default_image_on_air = 'http://urban-radio.co.uk/images/jukebox.gif'; // Default image


    // Shows array, edit this information for each show
    $shows = [
    [
    'show_name' => "Monday", // 80s
    'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    'start_time' => 01, // Start Time (24 hour format)
    'end_time' => 20, // End Time (24 hour format)
    'image' => 'http://urban-radio.co.uk/images/jukebox.gif'

    'show_name' => "Tuesday", // 80s
    'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    'start_time' => 01, // Start Time (24 hour format)
    'end_time' => 20, // End Time (24 hour format)
    'image' => 'http://urban-radio.co.uk/images/jukebox.gif'

    'show_name' => "Wednesday", // 80s
    'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    'start_time' => 01, // Start Time (24 hour format)
    'end_time' => 20, // End Time (24 hour format)
    'image' => 'http://urban-radio.co.uk/images/jukebox.gif'

    'show_name' => "Thursday", // 80s
    'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
    'start_time' => 01, // Start Time (24 hour format)
    'end_time' => 20, // End Time (24 hour format)
    'image' => 'http://urban-radio.co.uk/images/jukebox.gif'

    'show_name' => "Friday Show 1", // 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' => "Friday Show 2", // 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;


    }
    ?>
    DJ Now On Air: <br />
    <img src="<?php echo onAirNow()[1]; ?>"><br />
    <h3><?php echo onAirNow()[0]; ?></h3>

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
  •