Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Current DJ Script.

    Not sure if this is in the right place but I'll go ahead anyway. I am building an internet radio and I need a little help with the code for current DJ.

    The current DJ will be displayed on the player page, it'll have a picture of the DJ and their name, with the show name too. I have made my codes but it's still not wanting to work see codes below.

    This is the code on the player, This is where the info is displayed.
    Code:
    <div id="djimage"><img src="/player/images/dj<?php echo "$djimg";?> border="0"></div>
    
    <div id="curdj"><?php echo "$djname - $show";?>
    </div>
    I also have an include at the top of the page.
    Code:
    <?php include'get_dj.php';?>
    And this is the get_dj.php file it is pulling up.
    Code:
    <?php
    
    putenv("TZ=Europe/London");
    $h = date('G');
    $d = date('w');
    
    putenv("TZ=Europe/London");
    
    // Sunday
    if ($d == 0 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 0 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 0 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 0 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 0 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    
    
    // Monday
    if ($d == 1 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 1 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 1 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 1 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 1 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    
    
    // Tuesday
    if ($d == 2 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 2 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 2 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 2 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 2 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    
    
    // Webnesday
    if ($d == 3 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 3 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 3 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Deruloe'; // Show description
    }
    elseif ($d == 3 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 3 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    
    
    // Thursday
    if ($d == 4 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 4 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 4 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Deruloe'; // Show description
    }
    elseif ($d == 4 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 4 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 4 && $h >= 13 && $h < 18) { // Show Runs From 1pm til 6pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 4 && $h >= 18 && $h < 23) { // Show Runs From 6pm til 11pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    
    
    // Friday
    if ($d == 5 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 5 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'Jason Derulo'; // Show description
    }
    elseif ($d == 5 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 5 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 5 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    
    
    // Saturday
    if ($d == 6 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 6 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 6 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 6 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    elseif ($d == 6 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
    $djimg = 'images/dj/jay.jpg'; //Image for DJ (72px x 69px)
    $djname = 'Jason Derulo'; //DJ Name
    $show = 'UK Drive Time'; // Show description
    }
    ?>
    Sure hope someone can give me a hand. Many thanks.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Do you have a schedule or program that changes often?

    This radio station, http://www.asskradio.com/ uses a PHP script that reads their schedule (on air, on air next) via a spreadsheet in Google Docs. Anyone with a Google Account that has permission can edit their schedule. So they pick a couple of people at their station to access the Google Doc and edit any changes from anywhere in the world. The changes automatically show up on the website because the PHP script uses that database.

    Also, they have a 'schedule' link that displays the schedule ... also taken from that Google Doc spreadsheet. And finally, because we all live in different timezones, you can pick your timezone on the main page, and the schedule times show-up using your timezone, instead of theirs.

    If you want to use a similar system of "on air now, on air next", PM me. It also can pick out the DJ page or DJ image from whatever show is "on air". I could help you get it setup and running for a token fee (for my time). PM me if interested.

    Meanwhile, to answer your original post ... what exactly "is not working".



    .
    Last edited by mlseim; 11-18-2013 at 07:42 PM.

  • #3
    New to the CF scene
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well that website is exactly what I am after. How hard is this to make?

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You need a Google Account ... any email address can be used as a Google Account if you don't already have one.

    A Google Docs Spreadsheet is created (I have a template spreadsheet). A PHP script is used to access that spreadsheet and display info on your website. I also have that.

    You can PM me and give me your email address (the one you use for Google Account). Just the email address, not any passwords. I will give you more info at that time. I'll be home later this afternoon.


  •  

    Posting Permissions

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