Results 1 to 9 of 9
  1. #1

    Title
    Junior Member
    Join Date
    May 2013
    Location
    Northern Ireland
    Posts
    8
    Rep Power
    0

    Lightbulb Now Playing PHP Help!!

    Hello, everyone i found this PHP script the other day on this forum! i am having some problem trying to get it working! i have done everything needed for it to work, when i add my infomation to the script and upload to my server its not showing anything playing?

    index.php

    <html><head><script type="text/javascript" src="./jquery.js"></script><script type="text/javascript">function updateNowPlaying(){ $.ajax({ url: "./now-playing.php", cache: false, success: function(html){ $("#nowPlaying").html(html); } });}updateNowPlaying();setInterval( "updateNowPlaying()", 10000 );</script></head><body bgcolor="#171717"><center><font size="3" color="ff0000"><b><div id="nowPlaying"></div></b></font></center></body></html>
    now-playing.php

    <?php/*Now Playing PHP script for SHOUTcastThis script is (C) MixStream.net 2008Feel free to modify this free script in any other way to suit your needs.Version: v1.1*/ /* ----------- Server configuration ---------- */$ip = "host.host.net";$port = "9999";/* ----- No need to edit below this line ----- *//* ------------------------------------------- */$fp = @fsockopen($ip,$port,$errno,$errstr,1);if (!$fp) { echo "OFF AIR - Tune In At 6pm"; // Diaplays when sever is offline } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $info = str_replace('</body></html>', "", $info); $split = explode(',', $info); if (empty($split[6]) ) { echo "The current song is not available"; // Diaplays when sever is online but no song title } else { $title = str_replace('\'', '`', $split[6]); $title = str_replace(',', ' ', $title); echo "$title"; // Diaplays song } }?>
    are if anyone has a better script that they wouldn't mind sharing with me

    Thank's in advance

  2. #2
    PapaBearPW's Avatar
    Title
    Avid Broadcaster
    Join Date
    Jun 2012
    Posts
    273
    Rep Power
    14
    Are you running a shoutcast v1 server?

  3. #3

    Title
    Junior Member
    Join Date
    May 2013
    Location
    Northern Ireland
    Posts
    8
    Rep Power
    0
    thanks for your reply, yes its V1 shoutcast

  4. #4
    shoutcaststreaming's Avatar
    Title
    Premium Member
    Join Date
    Sep 2008
    Location
    Los Angeles, California
    Posts
    784
    Rep Power
    28
    Next time, put in with the
    Code:
     ..
    , as this is terrible to read, or format it ...

    Did you change the IP / port number to your set-up?

    If so, what it the error you are getting?
    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

  5. #5

    Title
    Junior Member
    Join Date
    May 2013
    Location
    Northern Ireland
    Posts
    8
    Rep Power
    0
    hello, yeah will do, and yes have changed the info the songs on air wont display

  6. #6
    PapaBearPW's Avatar
    Title
    Avid Broadcaster
    Join Date
    Jun 2012
    Posts
    273
    Rep Power
    14
    It seems to work just fine on my test server.....once I cleaned up the layout:

    index page:

    HTML Code:
    <html>
    <head>
    <script type="text/javascript" src="jquery.js">
    </script>
    <script type="text/javascript">
    function updateNowPlaying(){ $.ajax({ url: "./now-playing.php", cache: false, success: function(html){ $("#nowPlaying").html(html); } });}updateNowPlaying();setInterval( "updateNowPlaying()", 10000 );
    </script>
    </head>
    <body bgcolor="#171717">
    <center>
    <font size="3" color="ff0000">
    <b>
    <div id="nowPlaying"></div>
    </b>
    </font>
    </center>
    </body>
    </html>

    now-playing.php:
    PHP Code:
    <?php
    /*Now Playing PHP script for SHOUTcastThis script is (C) MixStream.net 2008
    Feel free to modify this free script in any other way to suit your needs.
    Version: v1.1*/
    /* ----------- Server configuration ---------- */
    $ip "changeme.com";
    $port "8000";
    /* ----- No need to edit below this line ----- */
    /* ------------------------------------------- */
    $fp = @fsockopen($ip,$port,$errno,$errstr,1);
    if (!
    $fp)
    {
       echo 
    "OFF AIR - Tune In At 6pm";
       
    // Diaplays when sever is offline
    }
    else
    {
       
    fputs($fp"GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
       while (!
    feof($fp))
       {
          
    $info fgets($fp);
       }
       
    $info str_replace('</body></html>'""$info);
       
    $split explode(','$info);
       if (empty(
    $split[6]) )
       {
          echo 
    "The current song is not available";
          
    // Diaplays when sever is online but no song title
       
    }
       else
       {
          
    $title str_replace('\'''`'$split[6]);
          
    $title str_replace(','' '$title);
          echo 
    "$title";
          
    // Diaplays song
       
    }
    }
    ?>
    add a copy of jquery to the base path and done...works fine...

  7. #7

    Title
    Junior Broadcaster
    Join Date
    Jul 2018
    Posts
    1
    Rep Power
    0
    Have you found any server error?

    If you want best audio sharing scripts then this may help you!


    It helped me a lot...Check now best audio sharing script

    Post edited by GK
    reason :
    - Don't post 3rd party links into your first post(s)
    - Please introduce yourself at this link : https://forums.broadcastingworld.com...oduce-Yourself
    - Do not reply to posts of 5+ years old
    Last edited by GKIye; 07-04-2018 at 08:35 AM. Reason: Post edited by GK

  8. #8
    shoutcaststreaming's Avatar
    Title
    Premium Member
    Join Date
    Sep 2008
    Location
    Los Angeles, California
    Posts
    784
    Rep Power
    28
    @tarina - you are answering a post that is over 5 years old. I highly doubt that the poster hasn't found a solution by now.

    Or do you just want to get publicity for your site ?

    BTW - Welcome to the forums.
    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

  9. #9
    RDJUser's Avatar
    Title
    Avid Broadcaster
    Join Date
    Aug 2012
    Location
    Harpurhey, Manchester UK
    Posts
    144
    Rep Power
    13
    @tarina - you are answering a post that is over 5 years old. I highly doubt that the poster hasn't found a solution by now.

    Or do you just want to get publicity for your site ?

    BTW - Welcome to the forums.
    Looks like a spammer to me... first post for something that isn't technically broadcasting related.


    Proud USER of RadioDJ since 2010

    Online: Twitter - Blog - RadioDJ

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
  •