PDA

View Full Version : Need dj avatar script



Jamie.
20-11-2006, 07:58 PM
/\ /\

I think there was one on techtuts any1 got 1 plz post :D

Lilian
20-11-2006, 08:01 PM
Do you mean were you upload an avatar and then it to your default one automatically ?

Jamie.
20-11-2006, 08:03 PM
its grabs the name out of radio stats eg "J"
then gets the avatar from a file eg
/images/djs/J.png

Recursion
20-11-2006, 08:04 PM
No, When a DJ Comes online to DJ the avatar changes to an Image (specified using php). It rabs the DJ Name from the broadcasting name and then changes the avater on his/her site.

Ive seen this before but it was on techtuts.

Read above post aswell as he posted at same time as me :P

Jamie.
20-11-2006, 08:04 PM
No, When a DJ Comes online to DJ the avatar changes to an Image (specified using php). It rabs the DJ Name from the broadcasting name and then changes the avater on his/her site.

Ive seen this before but it was on techtuts.

Read above post aswell as he posted at same time as me :P

yep techtuts isnt open :|

Rockstar
20-11-2006, 09:10 PM
rite get to the point www.techtuts.com (http://www.techtuts.com) on their theirs one ?

Agnostic Bear
21-11-2006, 11:46 AM
/\ /\

I think there was one on techtuts any1 got 1 plz post :D

If you can get the DJ's to use their DJ name without any idiotic messages such as "OMG FREEZ FRNI IF U CHN IN PLS", E.G : Dan

Then
put this just above the echo:

if(file_exists(''.$servertitle.'.gif'))
{
$img = "$servertitle.gif";
}
else
{
$img = "default.gif";
}


Then in the echo, just add $img where you want the image to go =]
Peace.

Jamie.
22-11-2006, 05:37 PM
If you can get the DJ's to use their DJ name without any idiotic messages such as "OMG FREEZ FRNI IF U CHN IN PLS", E.G : Dan

Then
put this just above the echo:

if(file_exists(''.$servertitle.'.gif'))
{
$img = "$servertitle.gif";
}
else
{
$img = "default.gif";
}


Then in the echo, just add $img where you want the image to go =]
Peace.


Does anyone know where abouts i put this.
Many thanks,
Jamie.

Jackboy
22-11-2006, 05:40 PM
radio stats file?

Rofl

Jamie.
22-11-2006, 05:41 PM
radio stats file?

Rofl

stop being immature and getting ure post count up ;l
I meant where in the radio stats u noob

Jackboy
22-11-2006, 05:53 PM
stop being immature and getting ure post count up ;l
I meant where in the radio stats u noob

wth. How am i trying to get my post count up?

I didn't mean to offend you. I thought you might've been someone who didn't understand php.

You would put the code next to where all the radio info gets displayed..

Obviously not in the echo..

Jamie.
22-11-2006, 05:56 PM
wth. How am i trying to get my post count up?

I didn't mean to offend you. I thought you might've been someone who didn't understand php.

You would put the code next to where all the radio info gets displayed..

Obviously not in the echo..

K sorry if i offended you also :D i thought u was trying to be all big headed.
+rep for sorryness :)

Jackboy
22-11-2006, 05:58 PM
K sorry if i offended you also :D i thought u was trying to be all big headed.
+rep for sorryness :)

Lol +rep back :P

:P

Jamie.
22-11-2006, 06:01 PM
Lol +rep back :P

:P

so will this work


<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.
include('Config.php'); //you may edit this path to fit your server environment otherwise leave it alone
if(file_exists(''.$servertitle.'.gif'))
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/$servertitle.gif";
}
else
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/default.gif";
}
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
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
################################################## ################################################## ##################
################################################## ################################################## ##################
/////////////////////////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
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>
$img
</body>
</html>';
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

<body text="" bgcolor="">
$img
</body>

</html>';
?>

Jackboy
22-11-2006, 06:04 PM
nope because it hasn't connected to the database yet.


<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.
include('Config.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
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
################################################## ################################################## ##################
################################################## ################################################## ##################
/////////////////////////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(file_exists(''.$servertitle.'.gif'))
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/$servertitle.gif";
}
else
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/default.gif";
}
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>
$img
</body>
</html>';
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

<body text="" bgcolor="">
$img
</body>

</html>';
?>

Lol i suck at php radio stats. But try that

Jamie.
22-11-2006, 06:09 PM
nope because it hasn't connected to the database yet.


<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.
include('Config.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
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
################################################## ################################################## ##################
################################################## ################################################## ##################
/////////////////////////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(file_exists(''.$servertitle.'.gif'))
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/$servertitle.gif";
}
else
{
$img = "http://www.hab-tunes.com/Layout_images/Djavatars/default.gif";
}
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>
$img
</body>
</html>';
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV="REFRESH" CONTENT="30;URL=Djavatar.php">
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

<body text="" bgcolor="">
$img
</body>

</html>';
?>

Lol i suck at php radio stats. But try that

Ok Thanks

Jamie.
22-11-2006, 06:52 PM
Doesnt seem to work ;'(

Want to hide these adverts? Register an account for free!