Page 4 of 5

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 8:17 pm
by gurutech
Downloaded the code, and replaced the first line with the 3 lines you now have to get the user name, and that will work fine.

Started messing with the code a little, to replace lines as follows:

Replaced:
Code: Select all
$image = imagecreatefrompng("back2.png");

with the line
Code: Select all
$image = imagecreatefrompng(.$user.".png");

But I'm not sure if I have the syntax correct. Also tried it without the . before and after the $user value. I'm just getting a white screen now.

I did replace the line in .htaccess file also, so now it reads to rewrite (.*).png to signature.php

Any hints as to what I'm doing wrong?

Thanks!

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 9:00 pm
by SparkyRih
Replacing $user = ""; with the lines $geturi, $getfile and $user = ... is correct.... don't mess with those values...

But your imagecreate string is wrong:

Code: Select all
$uimg = $user.".png";
$image = imagecreatefrompng($uimg);


That would be the method that I prefer...

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 9:54 pm
by gurutech
Makes sense! And I'm guessing I can use any font I want, as long as the .ttf file exists in the signatures folder?

Once I have that, I only need to be able to view the cover art. Where can I find out where that is being positioned, $x and $y? I can't seem to locate that bit in the script. I'm guessing it's just being generated outside of my 500x100 dimensions, so it's not showing up!

(nevermind, found the coordinates for the cover art, and adjusted it...)

Thanks!

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 10:11 pm
by SparkyRih
Code: Select all
imagecopy($image, $image2, xposition, yposition, 0, 0, width, height);


The two 0 have are source positions, just leave the mat 0...

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 10:27 pm
by gurutech
Hmmm... mind if I PM you my code? Seems to not be showing that I'm not listening to anything. Even after I stop playing, and even logging out, it still shows that I'm listening to the last song I listened to...

The only things I have changed are the $uimg bit, and the coordinates for the text and cover art....


Hell, nevermind - again! For some reason it worked this time around, after pulling up another image name, then going back to this one....

Could the "not playing anything" image be generated after the song "would have ended", instead of when it did end due to me pausing the playlist or logging out?

Re: Advanced nowplaying forum signature

PostPosted: Tue May 08, 2012 10:42 pm
by SparkyRih
The signatures goes to "nothing" after "the length of the song is expired"... if you look in the code you'll find a $maths variable for that...

If the image doesn't update properly, check your caches...

Edit: Dude check it out! XD
Image

Re: Advanced nowplaying forum signature

PostPosted: Wed May 09, 2012 2:43 am
by gurutech
Looks like you have a bug in your code... lol

Re: Advanced nowplaying forum signature

PostPosted: Wed May 09, 2012 9:26 am
by SparkyRih
gurutech wrote:Looks like you have a bug in your code... lol


Haha, I should've made the picture with the code in the background XD

But is everything working out now?

Re: Advanced nowplaying forum signature

PostPosted: Wed May 09, 2012 12:23 pm
by gurutech
Yep, everything's working great! Now if only I can figure out how to allow each user to customize the font, color, and position of the text... lol

Re: Advanced nowplaying forum signature

PostPosted: Mon May 14, 2012 5:00 pm
by SparkyRih
Now also available as plugin for the subsonic registration engine.
Image

(See first page for download and real time demo)

Re: Advanced nowplaying forum signature

PostPosted: Fri May 25, 2012 11:16 am
by dazbobaby
It's nice work Sparky, if a little complicated.
Sorry I didn't get back to you sooner, I've been playing DayZ Arma 2 mod

Re: Advanced nowplaying forum signature

PostPosted: Fri May 25, 2012 12:46 pm
by SparkyRih
dazbobaby wrote:It's nice work Sparky, if a little complicated.
Sorry I didn't get back to you sooner, I've been playing DayZ Arma 2 mod


I guess the ultimate feature would be to make this plugin available on my server, to create your own signature in this way, and if you're finished, you can just download a zip which contains the files for your personal signature...

But that's something for later, I have to focus on some other projects currently...

Re: Advanced nowplaying forum signature

PostPosted: Sat Dec 15, 2012 11:42 pm
by gurutech
Not sure if there's a new thread for this, so I'm using the existing one...

Seem to be having some problems updating my sig file. It still shows the "Not listening to anything" image, even though I am listening to music (even now as I type this.) It looks like it's not detecting that anything is playing.

I'm currently running MadSonic 4.8 beta 2. As far as I can remember, it was working with 4.8 beta 1 and previous versions (4.7).

Does anyone know if there was enough code change that this wouldn't work any longer?

Edit: Seems to be a user account issue. I tested my "guest" account, and it worked as it should. Ended up deleting my main (non-admin) account, and recreating it, and it works now. I should have backed up the playlists I created with that account first though... lol

Re: Advanced nowplaying forum signature

PostPosted: Sun Jan 13, 2013 1:59 pm
by dazbobaby
I'd noticed that little problem a while ago, for some reason it doesn't get the info from the correct user. A deletion of users and re-creation works fine.
I would have posted but I didn't get an email notification.

Re: Advanced nowplaying forum signature

PostPosted: Mon Jan 14, 2013 12:25 am
by gurutech
dazbobaby wrote:I'd noticed that little problem a while ago, for some reason it doesn't get the info from the correct user. A deletion of users and re-creation works fine.
I would have posted but I didn't get an email notification.


Yeah, I figured that out after posting... And it's through deleting/recreating the user in Subsonic, not in the MySQL database...