Clan Adverts

The Latest Game Talk

www.clan-themes.co.uk :: View topic - Shoutcast block issues

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

Shoutcast block issues

3 Replies / 805 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » Blocks

View previous topic :: View next topic


sueco
Reputation: 11.5
Local time: 10:07 PM
Location: Kristianstad
sweden.gif

Status: Offline
0.04 posts per day
Medals: 0

Joined: Nov 24, 2007
Last Visit: 30 Sep 2008
Posts: 15
Points: 496 

Post Shoutcast block issues Posted: Thu Jan 31, 2008 4:31 pm   

I installed the shoutcast block and after I activate it, it fucked up my site. All other menu, forums etc dissapeared exept the left sides block. Do any else have any problems with the shoutcast block? Any ideas what to do to solve it?
 

 
View user's profileSend private messageVisit poster's website Reply with quote

DoC
Reputation: 168.1
votes: 4
Local time: 10:07 PM
Location: Wiltshire, UK
uk.gif

Status: Offline
0.56 posts per day
Medals: 1 (View more...)
Dedication (Amount: 1)
Very Important Person
Very Important Person
Joined: Feb 07, 2007
Last Visit: 29 Nov 2008
Posts: 373
Points: 400 

Post Shoutcast block issues Posted: Thu Jan 31, 2008 4:55 pm   

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

I take it you put it into the center?

It is a bit of a pain to get right but when it is it's leet can you post your settings and ill tell you where you have gone wrong.

Basically try and get it looking like this (this is how I got it to work):

Code:
 $servers = array(
                  'servers' => array(
                                      's8.viastreaming.net',
                                      ''
                                     ),
                  'ports' => array(
                                    7240,
                                  ),
                  'passwords' => array(
                                        '**********',
                                        ''
                                      ),
                  'hbw' => 'http://s8.viastreaming.net/7240/listen.asx', <---- Windows Media Player; note the /
                  'lbw' => 'http://s8.viastreaming.net:7240/listen.pls', <----- WinAMP Media Player; note the :
                  'lasttracks' => 5
                  );
  $stationname = 'YOUR STATION NAME (Make sure its correct)'; // What is your station called?
  $refreshtime = 60 * 3; // How often to refresh (seconds)
  $content = "$stationname is not broadcasting"; // Default content.
 
  require_once('includes/scxml.php');
  require_once('config.php');
  global $prefix, $dbi;
 
 
 
  /* Function to fetch the info */
  function getInfo($servers)
  {
    $server = new SCXML;
    $listeners = 0;
    $nowplaying = 'Nothing';
    $peak = 0;
    $max = 0;
 
    while( $host = each($servers['servers']) )
    {
      $port = each($servers['ports']);
      $password = each($servers['passwords']);
      $server->set_host($host[1]);
       $server->set_port($port[1]);
       $server->set_password($password[1]);
       
       
      if ($server->retrieveXML())
      {
        $nowplaying = urldecode($server->fetchMatchingTag("SONGTITLE"));
        $listeners += $server->fetchMatchingTag("CURRENTLISTENERS");
        $peak += $server->fetchMatchingTag("PEAKLISTENERS");
        $max += $server->fetchMatchingTag("MAXLISTENERS");
        $lasttracks = $server->fetchMatchingArray("TITLE");
      }
    }
    $content .= "<b>Now Playing:</b><br><i>$nowplaying</i><br><b>Listeners:</b> ";
    $content .= "<i>$listeners/$max</i><br><b>Peak:</b> <i>$peak</i><br><br>";
    $content .= '<center>';
    if( ($servers['hbw']=='') && ($servers['lbw']=='') )
   {
      $content.="<a href=http://$host[1]:$port[1]/listen.pls>Tune In</a>";
    }
    if( $servers['hbw'] <> '' )
   {
      $content.="<a href=".$servers['hbw'].">Play With: Windows Media Player</a><br>";
    }
    if( $servers['lbw'] <> '' )
    {
      $content.="<a href=".$servers['lbw'].">Play With: WinAMP Media Player</a><br>";
    }
    $content.='</center>';
    if( $servers['lasttracks'] > 0 ) {
      $max = $servers['lasttracks'];
      if( count($lasttracks) < $max ) $max = count($lasttracks);
      $content .= "<br><b>Last $max tracks:</b><br>";
      for( $i=0; $i < $max; $i++ ) {
        $content .= ($i + 1).". $lasttracks[$i]<br>";
      }
    }
    return $content;
  }
 
  /* Function to cache the string $content */
  function cacheInfo($content,$title)
  {
    global $dbi, $prefix;
    $now = time();
    $sql = "UPDATE ".$prefix."_blocks SET content='".$content."', time=".$now
           ." WHERE title='".$title."'";
    sql_query($sql,$dbi);
  }

  /* Get Cached Content: */
  $sql = "SELECT content,time FROM ".$prefix."_blocks WHERE title='".$title."'";
  $result = sql_query($sql,$dbi);
  $roottime = time() - $refreshtime;
  if($result)
  {
    $row = sql_fetch_array($result, $dbi);
    /* Check time! */
    if( $row[1] < $roottime )
    {
      $content = getInfo($servers);
      cacheInfo($content,$title);
    }
    else
    {
      $content = $row[0];
    }
  }
  /* Otherwise, we have to fetch, and cache the details */
  else
  {
    $content = getInfo($servers);
    cacheInfo($content,$title);
  }
?>


Hope this helps

DoC
 

Play EVE Online? Go To: www.go-pdi.com & Join The Best Corp In The Universe!  
View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger Reply with quote

sueco
Reputation: 11.5
Local time: 10:07 PM
Location: Kristianstad
sweden.gif

Status: Offline
0.04 posts per day
Medals: 0

Joined: Nov 24, 2007
Last Visit: 30 Sep 2008
Posts: 15
Points: 496 

View user's profileSend private messageVisit poster's website Reply with quote




DoC
Reputation: 168.1
votes: 4
Local time: 10:07 PM
Location: Wiltshire, UK
uk.gif

Status: Offline
0.56 posts per day
Medals: 1 (View more...)
Dedication (Amount: 1)
Very Important Person
Very Important Person
Joined: Feb 07, 2007
Last Visit: 29 Nov 2008
Posts: 373
Points: 400 

View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger Reply with quote
Post new topic   Reply to topic  
   www.clan-themes.co.uk Forum Index » Blocks


 
3 Replies / 805 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum