+ Reply to Thread
Results 1 to 6 of 6

Thread: Script

  1. #1
    metra52 is offline x10Hosting Member metra52 is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    18

    Script

    Help me with this script. adress to this script http://onlydc.co.cc/status.php
    Code:
    <?php 
    //Configuration 
    $scdef  =       "NoN-StoP";  
                                                // ABOVE: Default station name to display when server or stream is down 
    $scip   =       "free.freeshoutcast.com";           // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port) 
    $scport =       "7950";                     // port of shoutcast server 
    $scpass =       "l14124";              // password to shoutcast server 
     
    $refreshrate =  "200";                       // Script/Page refresh time 
    $bgcolor =      "#ffffff"; // page background colour, hex value, default = white, #ffffff 
     
    //End configuration 
    //*********** PUT YOUR INFO HERE ***********// 
     
    $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30); 
     if(!$scfp) { 
      $scsuccs=1; 
    echo''.$scdef.' is<font color="red"> Offline</font>'; 
     } 
    if($scsuccs!=1){ 
     fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); 
     while(!feof($scfp)) { 
      $page .= fgets($scfp, 1000); 
     }
    
    
    ###################################################################################################################### 
    /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 
    //define  xml elements 
     $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS"); 
     $y=0; 
     while($loop[$y]!=''){ 
      $pageed = ereg_replace(".*<$loop[$y]>", "", $page); 
      $scphp = strtolower($loop[$y]); 
      $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); 
      if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) 
       $$scphp = urldecode($$scphp); 
     
    // uncomment the next line to see all variables 
    //echo'$'.$scphp.' = '.$$scphp.'<br>'; 
      $y++; 
     } 
    //end intro xml elements 
    ######################################################################################################################
    //max listeners
    
    include "max.php";
    if ($currentlisteners>$max)
            {
                $txtout='<?php'."\r\n";
                $txtout=$txtout. '$max=' .$currentlisteners. ";\r\n";
                $txtout=$txtout."\r\n".'?>';
                $fp = fopen ("max.php", "w"); 
                fwrite($fp,$txtout); 
                fclose($fp);
                $max=$currentlisteners;
            }
    
    
    ###################################################################################################################### 
    /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 
    //get song info and history 
     $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); 
     $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); 
     $songatime = explode("<SONG>", $pageed); 
     $r=1; 
     while($songatime[$r]!=""){ 
      $t=$r-1; 
      $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]); 
      $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]); 
      $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]); 
      $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]); 
      $song[$t] = urldecode($song[$t]); 
      $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page); 
      $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed); 
    $r++; 
     } 
    //end song info
    
    fclose($scfp); 
    } 
     
    //display stats 
    if($streamstatus == "1"){ 
    //you may edit the html below, make sure to keep variable intact
    $mas = explode("~", $servertitle);
    //echo $mas[2];
    $kart= explode("^",$servertitle);
    $t = $mas[1];
    
    if($kart[1] == 'Metra ~ 85015854')
    {
    echo'<img src="http://metra.gtproff.com/RJ_Metra.png" wigth="190" height="80" alt="">';
     }
    
    if($kart[1] == 'Nuggets ~ 5886724')
    {
    echo'<img src="http://metra.gtproff.com/RJ_nuggets.jpg" wigth="190" height="80" alt="">';
     }
    
    if($kart[1] == 'Lev ~ 3074854')
    {
    echo'<img src="http://metra.gtproff.com/RJ_Lev.jpg" wigth="190" height="80" alt="">';
     }
    
    if($kart[1] == 'Nabos ~ 3678944')
    {
    echo'<img src="http://metra.gtproff.com/rj_nabos.png" wigth="190" height="80" alt="">';
     }
    
    if($kart[1] == 'NoN Stop')
    {
    echo'<img src="http://metra.gtproff.com/non_stoprj.jpg" wigth="190" height="80" alt="">';
     }
    
    
    if($kart[1] == 'Konfetk@ ~ 588148781')
    {
    echo'<img src="http://metra.gtproff.com/RJ_k@nfetka.jpg" wigth="190" height="80" alt="">';
     }
    
    
    
    if($kart[1] == 'Ekstazi ~ 444079958')
    {
    echo'<img src="http://metra.gtproff.com/RJ_Ekstazi.jpg" wigth="190" height="80" alt="">';
     }
    
    //echo $icq[0]; 
    
    echo'
    
    
    '; 
     
    
    } 
    if($streamstatus == "0") 
    { 
    //you may edit the html below, make sure to keep variable intact 
    echo' <img src="http://metra.gtproff.com/offline.jpg" wigth="190" height="80" alt="">'; 
    } 
    ?>
    <html>
    <meta http-equiv="refresh" content="60">
    </html>
    this is my script check and fix it if you can
    script should work as this http://fry-diz.ru/metra/status.php

  2. #2
    metra52 is offline x10Hosting Member metra52 is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    18

    Re: Script

    help me please

  3. #3
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: Script

    *moved to programming help*
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  4. #4
    metra52 is offline x10Hosting Member metra52 is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    18

    Re: Script

    I think I need a function parsing data from remote server

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Script

    What, exactly, is the problem? Since we're not psychics, you should tell us the behavior you expect and the behavior you get, including any error messages. If you're having problems completing the code, tell us in detail what functionality you have and what you still need to achieve. Aways briefly describe the overall goal.

    Read and follow the guidelines in "How To Ask Questions The Smart Way".
    Last edited by misson; 03-20-2010 at 03:53 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  6. #6
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: Script

    I'm pretty sure the issue is that it's trying to open a remote connection on a port blocked by the firewall:
    $scport = "7950";

    and

    $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);

    If that's the case there's nothing you can do to fix this. X10 won't open ports for free accounts on demand, and it's tough to get one opened on paid too.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

+ Reply to Thread

Similar Threads

  1. My bux Script
    By batman1 in forum Review My Site
    Replies: 3
    Last Post: 10-22-2009, 03:33 AM
  2. 50 Credits for Bash Script/Php Script
    By javajenius in forum The Marketplace
    Replies: 0
    Last Post: 04-21-2008, 10:40 PM
  3. Need PHP help with this script
    By shanes in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 01-23-2008, 12:19 PM
  4. Need help with a script
    By Shotgun202 in forum Programming Help
    Replies: 7
    Last Post: 01-19-2008, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers