Old 14th September 2004, 09:54   #321
omie
Registered User
 
Join Date: Sep 2004
Posts: 15
Send a message via AIM to omie Send a message via Yahoo to omie
nm
omie is offline   Reply With Quote
Old 14th November 2004, 19:24   #322
mixx941
Senior Member
 
Join Date: Jul 2002
Location: irc.mixxnet.net
Posts: 126
Hi guys. Just a quick question. I'm not a PHP expert, so I'm wondering how I could add a dash between the artist and song. The station I'm using this for doesn't play "songs", it plays mix sets so it wouldn't make much sense to have "Artist:" and "Song:".

Here is an example of what it looks like now, just need to add a dash in between the artist and 'song name'.



Thanks

-Mark

EDIT: Or even better to have it just take whatever the SHOUTcast server is outputting as the title, because some of our broadcasts don't have a dash in them, some of them just say "DJ Mark Live" and that's it.

EDIT2: Look at the title now. It's supposed to say "(Live!) DJ Entertijn - Hardstyle Mix" but it's overlapping wierd. If I can get it to just output whatever the shoutcast server is sending on one line that would be great.


Internet Radio: Party107 (Trance/Electronic) | Rock 101.9 The Edge (Rock)

Last edited by mixx941; 14th November 2004 at 20:09.
mixx941 is offline   Reply With Quote
Old 14th November 2004, 23:56   #323
mixx941
Senior Member
 
Join Date: Jul 2002
Location: irc.mixxnet.net
Posts: 126
Also I notice now that the bottom of the image is getting cut off. That black border around it was all the way around it before, but now you can see it's not at the bottom.

I haven't changed anything since then.


Internet Radio: Party107 (Trance/Electronic) | Rock 101.9 The Edge (Rock)
mixx941 is offline   Reply With Quote
Old 15th November 2004, 16:56   #324
fox100
Junior Member
 
Join Date: Nov 2004
Posts: 3
I'm getting a 404 on the links
fox100 is offline   Reply With Quote
Old 20th November 2004, 16:52   #325
GIjoe2
Junior Member
 
Join Date: Oct 2004
Posts: 26
Can someone post the unedtited script here, im getting a 404 error while viewing the page
GIjoe2 is offline   Reply With Quote
Old 8th December 2004, 01:06   #326
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
sorry for bringing up a "supposed to be" dead topic, but im having some slight issues with your code Ruffdawg. but before i forget: GIjoe, check a few pages back. ruffdawg posted the working code in response to someone else posting their code which was "messed up".

now, heres the trouble: my site runs phpnuke. ive been trying to put some kind of now playing message in the header, but for some stupid reason, it wont allow any php code. it somehow omits all the php code put up there. so my last resort has been to use this sig code, but modified somewhat. ive managed to reduce it to a single line, and ive changed the background image to a gif so i can use transparencies (all that shows on the site is the now playing words, nothing else). in addition, instead of having the "Now Playing:" part of the bg image, i want it outputted as part of the actual song title. ive managed to do this. but when the station is running, it says "Now Playing: Array" instead of "Now Playing: Artist - Title". any ideas? heres the link to the image: http://www.pokeradio.com/images/np.php (may be hard to see on a white background. aamof, it IS hard to see on white. lol). and here is my code:

PHP Code:
<?php
// This Script was created by Ruff Dawg, in conjunction, and many thanks to,
// DJ Rampage's script. Your Welcome in advance

// This image you can call immediately from an html file in the image tag
// (i.e. <image src="black.php"> )    easy huh?

    
Header("Content-type: image/gif");
    
$im imagecreatefromgif("sigpic.gif"); //change sigpic.png to your picture file

// Fill in your own server information here:     
    
$host "reddog.wavestreamer.com"//without [url]http://[/url]
    
$port "8450";
    
$listenlink 'http://reddog.wavestreamer.com:8450/listen.pls';  //make link to stream
     
    
$fp fsockopen("$host"$port, &$errno, &$errstr30); //open connection
    
if(!$fp) {
        
$success=2;  //se-t if no connection
    
}
    if(
$success!=2){ //if connection
        
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
        
while(!feof($fp)) {
            
$page .= fgets($fp1000);
        }
        
fclose($fp); //close connection
        
$page ereg_replace(".*<body>"""$page); //extract data
        
$page ereg_replace("</body>.*"","$page); //extract data
        
$numbers explode(",",$page); //extract data
        
$currentlisteners=$numbers[0]; //set variable
        
$connected=$numbers[1]; //set variable

        
if($connected==1//if DSP is connected
            
$wordconnected="yes"//set variable
        
else //if no DSP connection
            
$wordconnected="no"//set variable
        
$peaklisteners=$numbers[2]; //set variable
        
$maxlisteners=$numbers[3]; //set variable
        
$reportedlisteners=$numbers[4]; //set variable
    
}

     
     
// text colors also in RGB
    
$text_color1 ImageColorAllocate($im,255,255,255);
    
$text_color2 ImageColorAllocate($im,0,0,255);
     
    if(
$success!=&& $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
        
$song=explode(" - ",$numbers[6]);
         
// strings can of course be replaced with your own idea's
        
$string1"Now Playing: " $song=explode(" - ",$numbers[6]);
        
    }
    else {
        
$string1"PokeRadio is Temporarily Offline";
        
    }
     
// positioning below
//(image,font (from 1 to 5),starting x position, y position,line of text,color)

    
$px = (imagesx($im)-5*strlen($string1))/2;
    
ImageString($im,3,10,10,$string1,$text_color1);
    
Imagegif($im);

?>
also, is there any way that the text can be centered in the image instead of starting from a set start point?
Vchat20 is offline   Reply With Quote
Old 8th December 2004, 07:02   #327
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
PHP Code:
$string1"Now Playing: " $song=explode(" - ",$numbers[6]); 
You're getting the type of $song [Array] instead of one of its values, that's because you're concatenating an array [explode() returns an array] but you don't specify an index. Besides, if you want the string in one line, you don't need explode() anyway. Modify that part with this:
PHP Code:
// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
        //$song=explode(" - ",$numbers[6]);
        
$song $numbers[6];
         
// strings can of course be replaced with your own idea's
        //$string1= "Now Playing: " . $song=explode(" - ",$numbers[6]);
        
$string1"Now Playing: " $song;
    }
    else {
        
$string1"PokeRadio is Temporarily Offline";
        
    } 
To center the text, add something like:
PHP Code:
// positioning below
//(image,font (from 1 to 5),starting x position, y position,line of text,color)

    
$px = (imagesx($im)-5*strlen($string1))/2;
    
$font 3;
    
$centerx imagesx($im)/2-(imagefontwidth($font)*strlen($string1))/2;
    
$centery imagesy($im)/2-imagefontheight($font)/2;
    
ImageString($im,$font,$centerx,$centery,$string1,$text_color1);
    
Imagegif($im); 
Hope it helps.

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Old 8th December 2004, 11:26   #328
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
thx. it all works perfectly now.
Vchat20 is offline   Reply With Quote
Old 1st January 2005, 00:47   #329
dannidj
Senior Member
 
dannidj's Avatar
 
Join Date: Jul 2004
Posts: 389
Hey gaus this work but its always says it Offline :S See it at http://www.alvaran.ws/uh/uh.php This is the Code i have.
Can you help me?
PHP Code:
<?php
// Ruff Dawg's 'Now Playing Sig w/ Background v. 1.5 May 7, 2004
// Special thanks to the originator, DJ Rampage

// This image you can call immediately from an html file in the image tag
// (i.e. <img src="black.php">)    easy huh?

    
Header("Content-type: image/png");

/////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////*Configurables*//////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

/////////////////////*Background Picture File*////////////////////////

/* Replace "sicpic.png" with your own
picture file (must be a .png) */

    
$im imagecreatefrompng("dj.png");

/////////////////////////////*Host Information*/////////////////////////////

    
$host "81.15.105.7"// No 'http://' in the host
    
$port "8000";

//////////////////////////////////*Text Colors*////////////////////////////////

// text colors are in RGB

    
$text_color1 ImageColorAllocate($im,0,153,255);
    
$text_color2 ImageColorAllocate($im,0,153,255);

////////////////////////////////////*Text Size*/////////////////////////////////

    
$text_size "3";

//////////////////////////////*Text Alignment*/////////////////////////////

//X alignment

    
$x1 "78";
    
$x2 "78";
    
$x3 "78";

//Y alignment

    
$y1 "24";
    
$y2 "44";
    
$y3 "63";

///////////////////////////*Offline Message*///////////////////////////////

    
$offline1 "Útvarp Heimur";
    
$offline2 "Er niðri sem stendur";
    
$offline3 "Vinsamlegast reynið seinna";


//////////////////////////////////////////////////////////////////////////////////////////////////
/////*DON'T TOUCH THE CODE BELOW UNLESS//////////
///YOU KNOW EXACTALLY WHAT YOU ARE DOING*//
///////////////////////////////////////////////////////////////////////////////////////////////

    
$fp fsockopen("$host"$port, &$errno, &$errstr30);
    if(!
$fp) {
        
$success=2;
    }
    if(
$success!=2){ //if connection
        
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
        while(!
feof($fp)) {
            
$page .= fgets($fp1000);
        }
        
fclose($fp);
        
$page ereg_replace(".*<body>"""$page); //extract data
        
$page ereg_replace("</body>.*"","$page); //extract data
        
$numbers explode(",",$page);
        
$currentlisteners=$numbers[0];
        
$connected=$numbers[1];
        if(
$connected==1)
            
$wordconnected="yes";
        else
            
$wordconnected="no";
        
$peaklisteners=$numbers[2];
        
$maxlisteners=$numbers[3];
        
$reportedlisteners=$numbers[4];
    }

    if(
$success!=&& $connected==1){

    
$song=explode(" - ",$numbers[6]);

        
$string1$song[0];
        
$string2$song[1];
        
$string3"$currentlisteners/$maxlisteners";
    }

    else {
        
$string1$offline1;
        
$string2$offline2;
        
$string3$offline3;
    }

    
$px = (imagesx($im)-5*strlen($string1))/2;
    
ImageString($im,$text_size,$x1,$y1,$string1,$text_color1);
    
$px = (imagesx($im)-5*strlen($string2))/2;
    
ImageString($im,$text_size,$x2,$y2,$string2,$text_color1);
    
$px = (imagesx($im)-5*strlen($string3))/2;
    
ImageString($im,$text_size,$x3,$y3,$string3,$text_color2);

    
ImagePng($im);
    
imagedestroy($im);
?>

Daníel B. J. Guðrúnarson
Owner – Webmaster
Krúttin ehf
TAX Number – 131780
dannidj is offline   Reply With Quote
Old 1st January 2005, 02:31   #330
avisonjohn
Junior Member
 
Join Date: Dec 2004
Location: Basildon, UK
Posts: 27
Look on the forum for my post, i could do it for you for £1 via nochex
avisonjohn is offline   Reply With Quote
Old 2nd January 2005, 01:42   #331
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
@dannidj: Probably, probs with the host where you're running the script. They could have disabled the fsockopen() function or they could be blocking outgoing connections to certain ports. Ask them about it or run the script on another host.

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Old 2nd January 2005, 06:33   #332
snuupaluupa
Junior Member
 
snuupaluupa's Avatar
 
Join Date: Aug 2004
Location: United States Of Whateva
Posts: 16
Send a message via AIM to snuupaluupa Send a message via Yahoo to snuupaluupa
The error was:
HTTP 404 - Page Not Found

Sorry, this page is not available
snuupaluupa is offline   Reply With Quote
Old 2nd January 2005, 06:36   #333
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
what?

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Old 30th January 2005, 05:26   #334
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
sorry for bringing up the topic yet again, but does anyone know how i can make it so it seperates the artist from the song title using the last hyphen it finds? because many of the songs i have use a hyphen in the artist field and its confusing the now playing script.
Vchat20 is offline   Reply With Quote
Old 30th January 2005, 12:56   #335
chrissiffer
Junior Member
 
Join Date: Dec 2004
Posts: 15
can someone paste me a working code script. mine seems to get an error
chrissiffer is offline   Reply With Quote
Old 30th January 2005, 21:09   #336
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
Quote:
does anyone know how i can make it so it seperates the artist from the song title using the last hyphen it finds?
Well, considering the complete script posted on this page, this will do the trick:
PHP Code:
if($success!=&& $connected==1){
    
$song explode(" - "$numbers[6]);
    
$string1 substr($numbers[6], 0strrpos($numbers[6], "-"));
    
$string2 $song[count($song)-1]; 
    
$string3"$currentlisteners/$maxlisteners";
} else {
    
$string1$offline1;
    
$string2$offline2;
    
$string3$offline3;

Quote:
can someone paste me a working code script. mine seems to get an error
The code posted in this page works just fine, what error are you getting?

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox

Last edited by 101; 30th January 2005 at 22:33.
101 is offline   Reply With Quote
Old 31st January 2005, 02:20   #337
ranchan1_2
Junior Member
 
Join Date: Apr 2004
Posts: 16
Hi, I have a small problem with this. It's not recognizing my DNAS is open. Any help?
ranchan1_2 is offline   Reply With Quote
Old 5th April 2005, 01:27   #338
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Hey guys, Just to let you know, you can always find the latest version of the script at http://www.ruffdawgradio.com/sig.phps

This is the best way of obtaining the code, since it is not edited, unless more cool features are added.

I am very open minded about the open-source community, so if you feel there are some features that should be added, please feel free to email me at admin@ruffdawgradio.com

Thanks


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 5th April 2005, 16:19   #339
dannidj
Senior Member
 
dannidj's Avatar
 
Join Date: Jul 2004
Posts: 389
ok but i want to know how shut i chanche the collor from blue to som another?

Daníel B. J. Guðrúnarson
Owner – Webmaster
Krúttin ehf
TAX Number – 131780
dannidj is offline   Reply With Quote
Old 5th April 2005, 16:19   #340
dannidj
Senior Member
 
dannidj's Avatar
 
Join Date: Jul 2004
Posts: 389
ok but i want to know how shut i chanche the collor from blue to som another?

Daníel B. J. Guðrúnarson
Owner – Webmaster
Krúttin ehf
TAX Number – 131780
dannidj is offline   Reply With Quote
Old 5th April 2005, 16:19   #341
dannidj
Senior Member
 
dannidj's Avatar
 
Join Date: Jul 2004
Posts: 389
ok but i want to know how shut i chanche the collor from blue to som another?

Daníel B. J. Guðrúnarson
Owner – Webmaster
Krúttin ehf
TAX Number – 131780
dannidj is offline   Reply With Quote
Old 5th April 2005, 16:37   #342
NJK
The Frisian Spamfighter
 
NJK's Avatar
 
Join Date: Sep 2003
Location: a real Frisian hometown
Posts: 14,939
// text colors are in RGB

$text_color1 = ImageColorAllocate($im,0,153,255);
$text_color2 = ImageColorAllocate($im,0,153,255);

there you change that.

oh and while i'm here, try to type normal english please it makes your question a lot easier and your sign is a bit too big (see rules about the size)

Each Thursday a new show on Celtica Radio with Darkwave music.
**************************************************************************

WINAMPSHOUTCAST
NJK is offline   Reply With Quote
Old 10th April 2005, 15:47   #343
Josh2004
Junior Member
 
Join Date: Apr 2004
Posts: 14
Sorry could you please try giving me a link which works to download this script I just want a plain background if possible so the background is see through like so it matches a forum layout. I Guess I need a few files to upload for this I tried the link but got nothing from it

Thanks.
Josh2004 is offline   Reply With Quote
Old 10th April 2005, 16:34   #344
NJK
The Frisian Spamfighter
 
NJK's Avatar
 
Join Date: Sep 2003
Location: a real Frisian hometown
Posts: 14,939
http://forums.winamp.com/showthread....6#post1536486, copy the php script from there.
ajust the color settings and you have it.

Each Thursday a new show on Celtica Radio with Darkwave music.
**************************************************************************

WINAMPSHOUTCAST
NJK is offline   Reply With Quote
Old 10th April 2005, 20:10   #345
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
if you check my website, the now playing at the top uses this same script. what i did to make the background see through was create a long gif file to fir that part of the site. made it all black. then took it into irfanview and saved it and made the black transparent.
Vchat20 is offline   Reply With Quote
Old 14th April 2005, 03:28   #346
MrAnthonyWong
Junior Member
 
Join Date: Sep 2004
Posts: 16
Ruffdawg is ther a way to cahnge the font, or are you working on that? and what font is being used now on it? I want to try to match it up.
MrAnthonyWong is offline   Reply With Quote
Old 14th April 2005, 17:52   #347
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
the font depends on the web server. it uses system fonts.
Vchat20 is offline   Reply With Quote
Old 14th April 2005, 19:44   #348
Wavestreaming
Major Dude
 
Wavestreaming's Avatar
 
Join Date: Apr 2004
Location: United Kingdom
Posts: 1,563
Send a message via AIM to Wavestreaming Send a message via Yahoo to Wavestreaming
You can upload a font to the server and get the script to generate the image based on the font.

Google it, I can't remember off the top of my head - but i've done it before.
Wavestreaming is offline   Reply With Quote
Old 19th April 2005, 23:14   #349
mrspandex
Junior Member
 
Join Date: Apr 2005
Posts: 4
All worked fine for me :P

Thx alot.
mrspandex is offline   Reply With Quote
Old 20th April 2005, 15:01   #350
Josh2004
Junior Member
 
Join Date: Apr 2004
Posts: 14
I have

<?php
// This Script was created by Ruff Dawg, in conjunction, and many thanks to,
// DJ Rampage's script. Your Welcome in advance

// This image you can call immediately from an html file in the image tag
// (i.e. <image src="black.php"> ) easy huh?

Header("Content-type: image/gif");
$im = imagecreatefromgif("sigpic.gif"); //change sigpic.png to your picture file

// Fill in your own server information here:
$host = "reddog.wavestreamer.com"; //without <a href="http://" target="_blank">http://</a>
$port = "8450";
$listenlink = 'http://reddog.wavestreamer.com:8450/listen.pls'; //make link to stream

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection
if(!$fp) {
$success=2; //se-t if no connection
}
if($success!=2){ //if connection
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp); //close connection
$page = ereg_replace(".*<body>", "", $page); //extract data
$page = ereg_replace("</body>.*", ",", $page); //extract data
$numbers = explode(",",$page); //extract data
$currentlisteners=$numbers[0]; //set variable
$connected=$numbers[1]; //set variable

if($connected==1) //if DSP is connected
$wordconnected="yes"; //set variable
else //if no DSP connection
$wordconnected="no"; //set variable
$peaklisteners=$numbers[2]; //set variable
$maxlisteners=$numbers[3]; //set variable
$reportedlisteners=$numbers[4]; //set variable
}



// text colors also in RGB
$text_color1 = ImageColorAllocate($im,255,255,255);
$text_color2 = ImageColorAllocate($im,0,0,255);

if($success!=2 && $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
$song=explode(" - ",$numbers[6]);

// strings can of course be replaced with your own idea's
$string1= "Now Playing: " . $song=explode(" - ",$numbers[6]);

}
else {
$string1= "PokeRadio is Temporarily Offline";

}

// positioning below
//(image,font (from 1 to 5),starting x position, y position,line of text,color)

$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,3,10,10,$string1,$text_color1);
Imagegif($im);

?>

saved as whatever.php for example but what do I do to get the image?
Josh2004 is offline   Reply With Quote
Old 20th April 2005, 17:54   #351
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
for those who are curious, here is the code i have going for the now playing bar on my site which uses this same script:

PHP Code:
<?php
// This Script was created by Ruff Dawg, in conjunction, and many thanks to,
// DJ Rampage's script. Your Welcome in advance

// This image you can call immediately from an html file in the image tag
// (i.e. <image src="black.php"> )    easy huh?

    
Header("Content-type: image/gif");
    
$im imagecreatefromgif("sigpic.gif"); //change sigpic.png to your picture file

// Fill in your own server information here:     
    
$host "65.220.67.14"//without [url]http://[/url]
    
$port "9417";
    
$listenlink 'http://65.220.67.14:9417/listen.pls';  //make link to stream
     
    
$fp fsockopen("$host"$port, &$errno, &$errstr30); //open connection
    
if(!$fp) {
        
$success=2;  //se-t if no connection
    
}
    if(
$success!=2){ //if connection
        
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
        
while(!feof($fp)) {
            
$page .= fgets($fp1000);
        }
        
fclose($fp); //close connection
        
$page ereg_replace(".*<body>"""$page); //extract data
        
$page ereg_replace("</body>.*"","$page); //extract data
        
$numbers explode(",",$page); //extract data
        
$currentlisteners=$numbers[0]; //set variable
        
$connected=$numbers[1]; //set variable

        
if($connected==1//if DSP is connected
            
$wordconnected="yes"//set variable
        
else //if no DSP connection
            
$wordconnected="no"//set variable
        
$peaklisteners=$numbers[2]; //set variable
        
$maxlisteners=$numbers[3]; //set variable
        
$reportedlisteners=$numbers[4]; //set variable
    
}

     
     
// text colors also in RGB
    
$text_color1 ImageColorAllocate($im,255,255,255);
    
$text_color2 ImageColorAllocate($im,0,0,255);
     
    if(
$success!=&& $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
        
$song $numbers[6];
 
// strings can of course be replaced with your own idea's
        
$string1"Now Playing: " $numbers[6];
        
    }
    else {
        
$string1"PokeRadio is Temporarily Offline";
        
    }
     
// positioning below
//(image,font (from 1 to 5),starting x position, y position,line of text,color)

    
$px = (imagesx($im)-5*strlen($string1))/2;
    
$font 3;
    
$centerx imagesx($im)/2-(imagefontwidth($font)*strlen($string1))/2;
    
$centery imagesy($im)/2-imagefontheight($font)/2;
    
ImageString($im,$font,$centerx,$centery,$string1,$text_color1);
    
Imagegif($im);

?>
the script is very simple. all the data is shown on one line, and its centered in the image.

the associated image is also attached. one note though, to keep the transparency, make sure that whatever program you use to edit the gif (if you need it edited) can set the transparency. then just make sure the black becomes transparent.
Attached Images
File Type: gif sigpic.gif (986 Bytes, 240 views)
Vchat20 is offline   Reply With Quote
Old 22nd April 2005, 11:28   #352
Josh2004
Junior Member
 
Join Date: Apr 2004
Posts: 14
ok... I am being incredibly stupid here I know Bit if I go to my pahe of php scripting I presume I save it as something.php and then go there and get an image? or am I being stupid? I thought before when I tried this that you had two scripts and one generated an image and the other one didn't... I just see script when I go to the place where I have the script and yes the server can run .php scripts! So Where or what the hell do I do now to get this thing to work!!
Josh2004 is offline   Reply With Quote
Old 24th April 2005, 03:52   #353
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Okay I just wanna quickly point something out. The script that Vchat20 has been edited so you can use the .gif file in conjunction with the script. The one I offer on my site if for .png extentions. Both extententions offer transparency.

Josh2004, its not 2 scripts, its one script, and a picture file in the same folder. The script calls the picture file. sigpic.png is the default.

Would anyone find it easier if i zipped the script and a default background file? doing so, i'll clean up/add to the code and re-releasing the script.


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 24th April 2005, 04:07   #354
Vchat20
Major Dude
 
Vchat20's Avatar
 
Join Date: Aug 2002
Posts: 1,273
dont matter to me. im quite satisifed with it. heck, if it wasnt for your script, id be shit up a creek right now trying to figure how to show the now playing song in my sig/site.

btw, IE doesnt show true transparency with png's. for example, if i was to use a png as the background for my sites np script, the top behind the song title would be grey.
Vchat20 is offline   Reply With Quote
Old 23rd June 2005, 21:35   #355
OTR4ME
Junior Member
 
Join Date: Jan 2004
Location: Near Atlanta
Posts: 17
Hi, I have the sig code working fine on my site; but I play Old Time Radio shows from the 1930's, 40's and 50's with a little old music mixed in. My problem with the script is that many of my shows have comma's, dollar signs, pound signs, etc. in either the author or title fields; so they don't display correctly.

For instance I just played:
Tarzan, Lord Of The Jungle - 511108 (44) Adventure On The Road To Timbuktu

and the sig script only displayed "Tarzan".

I'm already using this to get past any dashes:

$song=$numbers[6];

Any help for a non-php guy!????

Thanks!!!
Bob
here's a link to my sig...
http://www.bobmerritt.com/OTR/bobsig.php
OTR4ME is offline   Reply With Quote
Old 27th June 2005, 22:08   #356
OTR4ME
Junior Member
 
Join Date: Jan 2004
Location: Near Atlanta
Posts: 17
OK... I went out and bought 2 PHP books and I figured it out for myself!!! Here's my code mods to allow commas in the artist/title..

PHP Code:
// mods for OTR
$title " ";
for (
$num 6$num <= count ($numbers); $num++) {
    
$title $title "$numbers[$num],";
    };
$titlelen strlen($title) - 3;
$song trim(substr($title0$titlelen));
// end OTR mods 
The sig block is too large to display here (its for email)
http://www.bobmerritt.com/OTR/bobsig.php

and I'm NO programmer, so please don't ask me to explain. I'm just good at figuring some scripting out.

Thanks,
Bob
OTR4ME is offline   Reply With Quote
Old 17th July 2005, 07:22   #357
priestx
Junior Member
 
Join Date: Jan 2005
Posts: 6
[edit]figured it out, nevermind.

Last edited by priestx; 17th July 2005 at 07:41.
priestx is offline   Reply With Quote
Old 16th September 2006, 01:49   #358
radiofuckers
Junior Member
 
Join Date: Sep 2006
Location: Upstate NY
Posts: 8
my php signature script

I am having a bit of an issue. I am using the php script posted here by DJRampage a while back. I got the script working (half way) it just doesn't show what song is playing ect...
Here is my php file:
http://www.jcnoveltyshop.com/images/signa.php

I have edited the script temporarily to always show that it is online, because right now the script is going right to saying that it is "offline"

Here is my script:
Can anybody help me and point out any problems?

<?php

Header("Content-type: image/png");

$host = "radiofuckers.serverroom.us";
$port = "7218";
$listenlink = 'http://radiofuckers.serverroom.us:7218/listen.pls';

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30);
if(!$fp) {
$success=2;
}
if($success!=2){
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];

if($connected==1)
$wordconnected="yes";
else
$wordconnected="no";
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[30];
$reportedlisteners=$numbers[4];
}
$im = ImageCreate(200,60);

$background_color = ImageColorAllocate($im,255,255,255);

$text_color1 = ImageColorAllocate($im,0,0,0);
$text_color2 = ImageColorAllocate($im,119,43,26);

if($success!=2 && $connected==1){

$song=explode(" - ",$numbers[6]);

$string1= "Now playing on RadioFuckers";
$string2= $song[0];
$string3= $song[1];
$string4= "[$currentlisteners/$maxlisteners users]";
}
else {
$string1= "RadioFuckers is currently";
$string2= "ONLINE";
$string3= "www.radiofuckers.com";
$string4= ":::";
}
$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,1,$px,5,$string1,$text_color1);
$px = (imagesx($im)-5*strlen($string2))/2;
ImageString($im,1,$px,20,$string2,$text_color2);
$px = (imagesx($im)-5*strlen($string3))/2;
ImageString($im,1,$px,30,$string3,$text_color2);
$px = (imagesx($im)-5*strlen($string4))/2;
ImageString($im,1,$px,45,$string4,$text_color1);
ImagePng($im);

ImageDestroy($im);
?>
radiofuckers is offline   Reply With Quote
Old 16th September 2006, 03:47   #359
hackerdork
Forum King
 
hackerdork's Avatar
 
Join Date: Feb 2006
Location: Earth Circa sometime.
Posts: 3,297
RF,. it works it shows you are ONLINE

so its your pc not the script causing the display problem

~ According to the ship's log we're down to our last 3000 vomit bags.It'll never be enough.
search the forums! don't PM me on how-to, or ask me to setup you system. you do it so you learn.
hackerdork is offline   Reply With Quote
Old 16th September 2006, 13:09   #360
radiofuckers
Junior Member
 
Join Date: Sep 2006
Location: Upstate NY
Posts: 8
Quote:
Originally posted by hackerdork
RF,. it works it shows you are ONLINE

so its your pc not the script causing the display problem
Yes, I know that it is "showing" to be online, because I edited this part of the script:
}
else {
$string1= "RadioFuckers is currently";
$string2= "ONLINE";
$string3= "www.radiofuckers.com";
$string4= ":::";
It should be this:
}
else {
$string1= "RadioFuckers is currently";
$string2= "OFFLINE";
$string3= "Check Back Later";
$string4= ":::";

The reason I edited it, is because that is all that I was getting, and I felt that people seeing that we were "offline" would turn them away. I should be getting a "status relay" kinda thing. Showing the current song playing, listeners ect...

I hope this helps clear it up a bit, I hope that somebody can help me with this issue, I am stumped.
radiofuckers is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump