Page 1 of 4

Forum sig

PostPosted: Tue May 26, 2009 4:24 pm
by donpearson
Im working on a forum sig to show what your playing and stuff like that, but its php so you will need to install that as well.

PostPosted: Thu Jul 09, 2009 3:32 pm
by donpearson
I have a dam good question, im a php man and would love to get php talking to subsonic.
Im still picking up java as i go but some help would be nice to get me on my way.

(wow this was my 100th post lol)

PostPosted: Thu Jul 09, 2009 6:11 pm
by sindre_mehus
I'm hoping to add a REST interface to Subsonic to better support third-party integration.

A first, minimal version of this *might* come in 3.8.

PostPosted: Thu Jul 09, 2009 6:39 pm
by donpearson
Now that would be nice to have in subsonic as i have made some nice apps that will go with it.

PostPosted: Fri Apr 09, 2010 5:54 pm
by deejay2302
Give it a How To for this Feature? I will create my own Stat-Signatur. We have Version 3.9 . Works the Feature?

PostPosted: Mon Feb 21, 2011 9:20 am
by donpearson
For anyone that is intrested here is a little look at the signature im working on this min:

This is the live signature not just an image...
Image

All comments and ideas welcome, but please bare in mined im still working on this and have a lot im adding.

PostPosted: Thu Apr 28, 2011 12:54 pm
by bytethdgroove
yes very intersted, any eta on a release?
been trying to get the other one posted earlier working, but nothing but problems with that script....
can't wait to test yours
peace
byte

PostPosted: Fri Apr 29, 2011 3:43 pm
by bytethdgroove
got the code from lucron working to create a forum signature, tried to hack it up, did manage to add genre, album, year and such to it, but im at a roadblock trying to add album art...wondering if you can help
thanks
byte

PostPosted: Thu May 26, 2011 10:57 am
by bytethdgroove
so Don, ever finish your forum sig, care to publish it? if not possibly wanna help me solve album art and Ill be glad to share my code..
thanks
byte

PostPosted: Fri May 27, 2011 10:00 am
by SparkyRih
Could I take a look at the code?

PostPosted: Fri May 27, 2011 10:32 am
by bytethdgroove
sweet ill send u a pm with the code I have, when I get home from work.
thanks man...

oh and btw....the code is all over the place, as im not much of a programmer, I do understand the fundementals, however I dont code much and it shows in my code ;)

once it's finished I plan on posting the full code, if anyone wants what I currently have (everything works except album art) just pm me

peace
byte

PostPosted: Fri May 27, 2011 10:48 am
by SparkyRih
Thank you ;)
'
I'll do my best to get the cover art right, I really like this idea :)

Edit: It turned out that it's not that hard to make one (never worked with XML in PHP before, so I had to learn that first)...

I hope to get a nice result tomorrow (playing with text alignments)... After that I'll take a look at the cover art...

Edit 2:
Image

Edit 3: And now I got the coverart working to :D

PostPosted: Sun May 29, 2011 4:28 am
by BrianDelShasta
bytethdgroove, would you mind sharing you code with me as well? Have you figured out how to only display now playing information for a specific account?
Thanks

PostPosted: Sun May 29, 2011 9:15 am
by SparkyRih
BrianDelShasta wrote:bytethdgroove, would you mind sharing you code with me as well? Have you figured out how to only display now playing information for a specific account?
Thanks


My script does that, I only have to solve one bug... I can release my code after that if bytethdgroove is ok with that?

Edit: Bug solved :)

http://marc.schattorie.nl/homepage/en/W ... -signature

PostPosted: Fri Jun 03, 2011 12:07 am
by bytethdgroove
ofcoarse I dont mind, i didnt start this idea, was only trying to get mine to work...(which as i as i posted earlier is an extension to lucrons original sig..added some more options and styling) and was hoping to get album art added but never got it working
here is the code its a lil sloppy as I was testing things last, if I can add album art that would be great :)

Code: Select all
<?php


//Subsonic Account Information
$user = "xxxxxxxx";
$pass = "xxxxxxxx";

//Path to your Subsonic
$server = "http://xxx.subsonic.org";

//Path to your signature image
$signaturepath = "images/signature1.jpg";

$img = @imagecreatefromjpeg($signaturepath);

//Font settings
$size = 5;
$size2 = 5;
$x = 5; //X Position
$y2 = 0; //Y Position
$y3 = 13;
$y = 86; //Y Position
$x1 = 5; //X Position
$y1 = 100; //Y Position
$color = imagecolorallocate($img,255,255,255);
$yel = imagecolorallocate($img,255,255,0);
$text = "Byte's Subsonic Server";
$text2 = date('D, F d, Y h:i:sa');
$text3 = date('h:i:sa');
$font = 'C:\WINDOWS\Fonts\tf2build.ttf';
$font1 = 'C:\WINDOWS\Fonts\tf2professor.ttf';
$font2 = 'C:\WINDOWS\Fonts\TF2.ttf';
$white = imagecolorallocate($img, 255, 255, 255);
$grey = imagecolorallocate($img, 128, 128, 128);
$black = imagecolorallocate($img, 0, 0, 0);
$red = imagecolorallocate($img, 255, 0, 0);

//Retrieve the XML output from REST
$xmlstr = simplexml_load_file("$server/rest/getNowPlaying.view?u=$user&p=$pass&v=1.3.0&c=forumsig");

//Retrieve Now Playing Information
$artist = $xmlstr->nowPlaying->entry[artist];
$title = $xmlstr->nowPlaying->entry[title];
$album = $xmlstr->nowPlaying->entry[album];
$genre = $xmlstr->nowPlaying->entry[genre];
$year = $xmlstr->nowPlaying->entry[year];
$bitrate = $xmlstr->nowPlaying->entry[bitRate];
$minutesago = $xmlstr->nowPlaying->entry[minutesAgo];
$playername = $xmlstr->nowPlaying->entry[playerName];

//Change header to jpeg, so browsers know that this is an image
header('Content-Type: image/jpeg');

if ($artist && $title) //Check if a song is playing or not, if not, don't write anything!
   {
   imagettftext($img, 18, 0, 170, 73, $white, $font, $text);
   imagettftext($img, 18, 0, 169, 72, $red, $font, $text);
   //imagestring($img, $size2,$x,$y2, "Byte's Subsonic Server",$color1);
   imagettftext($img, 13, 0, 4, 95, $grey, $font2, "$artist - $album - $title");
   imagettftext($img, 13, 0, 3, 94, $white, $font2, "$artist - $album - $title");
   //imagestring($img, $size,$x,$y, "$artist-$album-$title",$color);
   imagettftext($img, 27, 0, 4, 118, $grey, $font1, "$genre - $year ($minutesago min. ago) on $playername");
   imagettftext($img, 27, 0, 3, 117, $white, $font1, "$genre - $year ($minutesago min. ago) on $playername");
   //imagestring($img, $size,$x1,$y1, "$genre - $year ($minutesago min. ago) on $playername",$color);
   //imagestring($img, $size, $x, $y3, date('D, F-d-Y h:i:sa'), $color);
   imagettftext($img, 15, 0, 4, 19, $grey, $font, $text2);
   imagettftext($img, 15, 0, 3, 18, $white, $font, $text2);
   //imagettftext($img, 15, 0, 4, 45, $grey, $font, $text3);
   //imagettftext($img, 15, 0, 3, 44, $yel, $font, $text3);
   }
else
   {
   imagettftext($img, 18, 0, 170, 73, $white, $font, $text);
   imagettftext($img, 18, 0, 169, 72, $red, $font, $text);
   imagettftext($img, 15, 0, 4, 19, $grey, $font, $text2);
   imagettftext($img, 15, 0, 3, 18, $white, $font, $text2);
   imagettftext($img, 20, 0, 4, 118, $grey, $font2, "I'm Currently Not Listening To Anything");
   imagettftext($img, 20, 0, 3, 117, $white, $font2, "I'm Currently Not Listening To Anything");

   //imagestring($img, $size, $x, $y1, "I'm Currently Not Listening To Anything", $color);
   //imagestring($img, $size, $x, $y, date('D, F-d-Y h:i:sa'), $color);
   //imagestring($img, $size, $x, $y2, "Idle for $minutesago minutes", $color1);
   //imagettftext($img, 27, 0, 4, 118, $grey, $font1,  date('D, F-d-Y h:i:sa');
   //imagettftext($img, 27, 0, 3, 117, $white, $font1,  date('D, F-d-Y h:i:sa');
   }

imagejpeg($img, 'C:\Inetpub\wwwroot\sig.jpg', 100);
imagejpeg($img);
imagedestroy($img);

?>


peace
byte