Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    James's Avatar
    Title
    Administrator
    Join Date
    Jan 2008
    Location
    Melbourne, Australia
    Posts
    12,182
    Rep Power
    10

    [USEFUL] DJ On Air Script

    Heres a script i had developed for a local radio station. I thought i might as well share it with Broadcasting World too!

    It requires you simply to enter your DJ Schedule Data (Img, Title & Sub) and for you to change your timezone. Here is a list of timezones supported for this web app!

    nowon.php
    Code:
    <?php
    
    putenv("TZ=Australia/Melbourne");
    $h = date('G');
    $d = date('w');
    
    putenv("TZ=Australia/Melbourne");
    
    
    // Sunday
    if ($d == 0 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 0 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 0 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 0 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 0 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Monday
    if ($d == 1 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 1 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 1 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 1 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 1 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Tuesday
    if ($d == 2 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 2 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 2 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 2 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 2 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Webnesday
    if ($d == 3 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 3 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 3 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 3 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 3 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Thursday
    if ($d == 4 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 4 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 4 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 4 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 4 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Friday
    if ($d == 5 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 5 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 5 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 5 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 5 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    
    // Saturday
    if ($d == 6 && $h >= 0 && $h < 6) { // Show Runs From Midnight til 6am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    } 
    elseif ($d == 6 && $h >= 6 && $h < 10) { // Show Runs From 6am til 10am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 6 && $h >= 10 && $h < 11) { // Show Runs From 10am til 11am
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 6 && $h >= 11 && $h < 12) { // Show Runs From 11am til Midday
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    elseif ($d == 6 && $h >= 12 && $h < 13) { // Show Runs From Midday til 1pm
         $img = 'image.jpg'; //Image Source
         $title = 'Tunes'; //Show Title
         $sub = 'All Night'; // Short Description
    }
    
    echo'<div style="text-align: center;"><img src="' . $img . '"></div><br>
    <div style="padding-left: 5px; padding-bottom: 5px; font-size: 12px;"><b>' . $title . '</b><br><i>' . $sub . '</i></div>';
    
    ?>
    Let me know how you go

  2. #2

    Title
    Junior Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0
    Wow, this looks amazing.
    Thank you for it! :D
    +repped

    -ANTiX

  3. #3
    digitalhunter's Avatar
    Title
    Junior Member
    Join Date
    Dec 2010
    Location
    Workington, Cumbria, UK
    Posts
    26
    Rep Power
    11
    Thanks for that James! It works great as a module on Vbulletin. Certainly gonna have a play with it.
    +Rep

  4. #4
    Gem]n['s Avatar
    Title
    Junior Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0
    James ... great script ...

    i have all the DJs time slots entered ok ... and send out to 3 TXT files for flash to pick up ... it all works brilliantly until 10pm at night and for some unknown reason as soon as it hits the 9pm or 10pm slot, at night (UK time), i get nothin shown ... I don't know why ...

    i have a PHP file called dj.php that has your script in and when it is processed it dumps the DJ info (DJ name) (DJ show) (DJ staus - Live, Recorded or Stream) to the 3 seperate TXT files ... flash then grabs the info from the TXT files and displays that on the website and in the chatroom ...

    the flash SWF is only a few kb in size and works fine ... it's just the script that seems to cause a fault ...

    i'm also new to PHP and lovin it ... especially as I'm more of a Flash designer ...

    EDIT:
    Ok here is exaclty what the script does ...

    Works throughout the day perfectly then come 10pm at night (UK time) it displays nothing ... variables seem blank and display info displays nothing at all ... until when 12am in the morning come (2hrs later) then the display info goes back to displaying the correct info again ... then its fine throught the day again until 10pm again ...

    So for the 2hrs (10pm -12am) it displays nothing ... I am stumped ...

    cheers,
    Gem

  5. #5
    garybaldy72uk's Avatar
    Title
    Senior Member
    Join Date
    Oct 2010
    Location
    Manchester
    Posts
    671
    Rep Power
    30
    Try this Topic a much simpler script is Posted on there all you have to do is change/add times in 24 hr format and the picture links!

    http://forums.broadcastingworld.net/...is-be-Possible

    Hope that Helps

  6. #6

    Title
    Junior Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    10
    anything without PHP?

  7. #7
    MarcAlle's Avatar
    Title
    Streaming Specialist
    Join Date
    May 2008
    Posts
    949
    Rep Power
    19
    Quote Originally Posted by ATHR View Post
    anything without PHP?
    PHP is really the way to go. Almost anyone can learn it, or at least "poke" their way around it to get it to do what you want it to. What are you looking for? ASP? ColdFusion?
    Stream101 | Affordable Media Solutions
    Shared/Reseller cPanel« Web Hosting | WordPress Hosting | Premium Stream Hosting
    TOLL-FREE: (877) 240-7767 | 30 Day NO QUESTIONS Money-Back Guarantee
    100% Cogent Free Network | CloudLinux OS | Tier 1 Bandwidth | Grand Rapids, MI

  8. #8

    Title
    Junior Member
    Join Date
    Oct 2010
    Posts
    18
    Rep Power
    10
    my website doesn't support PHP so I'm stuck with HTML and Javascript

  9. #9
    MarcAlle's Avatar
    Title
    Streaming Specialist
    Join Date
    May 2008
    Posts
    949
    Rep Power
    19
    Quote Originally Posted by ATHR View Post
    my website doesn't support PHP so I'm stuck with HTML and Javascript
    You're not going to find anything like what you want that is not in PHP or a similar language. HTML is purely visible and Javascript will bog your site down if something is written in that. Maybe you could have a Java applet developed. My suggestion is to find a host that has cPanel as it is, in my opinion, the best control panel for beginners. If you have a cPanel host, you'll be able to support PHP!
    Stream101 | Affordable Media Solutions
    Shared/Reseller cPanel« Web Hosting | WordPress Hosting | Premium Stream Hosting
    TOLL-FREE: (877) 240-7767 | 30 Day NO QUESTIONS Money-Back Guarantee
    100% Cogent Free Network | CloudLinux OS | Tier 1 Bandwidth | Grand Rapids, MI

  10. #10
    shoutcaststreaming's Avatar
    Title
    Premium Member
    Join Date
    Sep 2008
    Location
    Los Angeles, California
    Posts
    784
    Rep Power
    29
    Quote Originally Posted by MarcAlle View Post
    If you have a cPanel host, you'll be able to support PHP!
    Any server can support PHP. No need for cPanel. Find another host to get your server from.
    SCS - Dedicated Bandwidth Servers
    Shoutcast / Icecast / Windows Media
    Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ
    Broadcasting World's Stream Host of the Month

Similar Threads

  1. Station Artwork
    By ThumbDog in forum General Internet Radio Discussions
    Replies: 4
    Last Post: 04-24-2011, 04:58 PM
  2. Protools vs Audition
    By Jinglemaster in forum Audio Production
    Replies: 9
    Last Post: 07-28-2010, 01:18 AM
  3. Amazing facts
    By Baabaa Productions in forum General Internet Radio Discussions
    Replies: 5
    Last Post: 04-22-2009, 05:53 AM
  4. Introducing bodalgo - The new voice over market place
    By bodalgo in forum Audio Production
    Replies: 3
    Last Post: 03-22-2009, 03:11 AM
  5. Hi you all
    By CA101 in forum Introduce Yourself
    Replies: 1
    Last Post: 11-28-2008, 08:42 AM

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
  •