Winamp 2 Web

Support, Snippets & Projects

Moderators: Moderator, Global Moderator

Post Reply
us3rX
Hero Member
Hero Member
Posts: 1194
Joined: Thu May 06, 2004 6:11 am

Winamp 2 Web

Post by us3rX »

I am sure there is an easier way to do this, but meh... For the most part this was quite easy /biggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' /> now to look at the code for the most part i think the image making is the hardest out of this script. *Note: to save hours of headbanging >_> make sure to chmod the winamp-sig2.gif to 777 o.0 [code] $im = ImageCreateFromGif("winamp-sig.gif");[/code] This is the base image you are editing, mine is: [img]http://us3rX.killanet.net/winamp/winamp-sig.gif[/img] [code] Imagettftext($im, 8, 0, 80, 66, $color, \'LUCON.TTF\', "$info"); Imagettftext($im, 8, 0, 86, 77, $color, \'LUCON.TTF\', "$length");[/code] Depending on what GD your server is running, the \"8\" can mean either \"pixel(GD1)\" or \"point(GD2)\" size The 0 means the angle, 0 is left to right, where 90 is bottom to top. the 80 is the x pos for the text the 66 is the y pos for the text $color refers to $color = ImageColorAllocate($im, 255, 255, 255); whatever you want the color of the text to be, change the 255, 255, 255 to whatever such as if you wanted it to be red you would have; $color = ImageColorAllocate($im, 255, 0, 0); LUCON.TTF is the font to \"type\" the text out on, also depends on what fonts the server has installed or you can upload the font, then link to it. Then the $info and $length refer to; $info = (strlen($artist . \" - \" . $title) > 47 ? substr_replace($artist . \" - \" . $title,\'...\',47,-1) : $artist . \" - \" . $title); & $length = $_GET[\'length\']; Looks a bit weird huh? well what this does is, if the Artist and Title info is over 47 chars, it will make it display like: Artist - Title... [code] Imagegif($im, \'./winamp-sig2.gif\'); ImageDestroy($im);[/code] What this does is: saves the image to the same folder as the script and saves it as winamp-sig2.gif The ImageDestroy is to free the image from the memory. Also, if you want to use a jpg/png/etc should just be a matter of changing the gif to whatever. My Final Image looks something like: [img]http://us3rX.killanet.net/winamp/winamp-sig2.gif[/img] Now for automatically getting the data to the server. Rift has made a little program using the Winamp SDK(I think) and Vb/C++ that grabs the info from winamp and sends it to whatever url you tell it too. Here is a screen shot of the program. [img]http://us3rX.killanet.net/winamp/winamp2web.png[/img] Thanks for Rift for this. if you prefer not using this program for sending the data, let me know, i have an irc version useing one dll and sockets /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' /> This was my first tutorial, hopefully you enjoyed it, also if you learned something, use this, need help or anything post here and let me know. I\'ll be more then glad to help out. Also the php file is commented for some of the other commands. if need be let me know and ill go more into detail on it for you /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' /> us3rX /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' /> Winamp can be found [url=\"http://winamp.com\"][u]here.[/u][/url] Rift program can be found [url=\"http://sage-web.com/Winamp2Web.zip\"][u]here.[/u][/url]*note i take no responsibilityif the program is pink and purple /blum.gif\' class=\'bbc_emoticon\' alt=\':P\' /> Php GD help can be found [url=\"http://php.net/manual/en/function.imagecreate.php\"][u]here.[/u][/url] Winamp2Web Script Below: [attachment=1235:attachment]
Last edited by us3rX on Sat Aug 06, 2005 8:47 am, edited 1 time in total.
[align=center]

Image

"Time is never wasted, when your wasted all the time" ~ Radio Dj/Unknown Source

"Death is the inevitable end to the suffering of the living." ~Unknown

"You were born an original. Don't die a copy" ~Murdoc Niccals

[/align]
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

Winamp 2 Web

Post by ner0 »

awesome tut jer, its definitely an interesting concept /good.gif\' class=\'bbc_emoticon\' alt=\'(Y)\' />

as for the chmod, maybe use something like this?
[code] Imagegif($im, \'./winamp-sig2.gif\');
chmod(\'./winamp-sig2.gif\',0777);
ImageDestroy($im);[/code]

keep em comin /biggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' />
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
us3rX
Hero Member
Hero Member
Posts: 1194
Joined: Thu May 06, 2004 6:11 am

Winamp 2 Web

Post by us3rX »

ahhh ty, paul /biggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' /> didnt know i could do that, but it will have to be before the Imagegif line or php will whine about not being able to open the file -.- ty tho /biggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' />

us3rX /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' />
[align=center]

Image

"Time is never wasted, when your wasted all the time" ~ Radio Dj/Unknown Source

"Death is the inevitable end to the suffering of the living." ~Unknown

"You were born an original. Don't die a copy" ~Murdoc Niccals

[/align]
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

Winamp 2 Web

Post by ner0 »

[spoiler]good point lol[/spoiler] /blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
us3rX
Hero Member
Hero Member
Posts: 1194
Joined: Thu May 06, 2004 6:11 am

Winamp 2 Web

Post by us3rX »

Update: Added a Word Filter(thanks to paul) /biggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' /> [attachment=1253:attachment] Enjoy, us3rX /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' />
[align=center]

Image

"Time is never wasted, when your wasted all the time" ~ Radio Dj/Unknown Source

"Death is the inevitable end to the suffering of the living." ~Unknown

"You were born an original. Don't die a copy" ~Murdoc Niccals

[/align]
Brock
Sr. Member
Sr. Member
Posts: 262
Joined: Thu Jun 17, 2004 12:37 am

Winamp 2 Web

Post by Brock »

nice job mate /bigwink.gif\' class=\'bbc_emoticon\' alt=\';)\' />
Post Reply

Return to “PHP &amp; MySQL”