Note: if you have this error message shown inside the plugin :
Deprecated: Function split() is deprecated in blabla/wp-content/plugins/lastfm-rps/lastfm.php on line 120Please change
$artist = split("_",$string);on line 120 to
$artist = explode("_",$string);
Description : Its a widget plugin which collects data from Audioscrobbler web services and gets your last listened tracks and their album images. It works in PHP4 platforms and uses my simplexml class to collect data from Audioscrobbler.
Installation : The directory structure should be like this :
--> wp-plugins/ |-- lastfm_RPS/ |-- noart.gif |-- simplexml.class.php |-- readme.txt |-- lastfm.css
Then just activate the plugin, go to Design-Widgets, add the widget where you want, write the username and widget title in the settings and save. That’s all.
Note : If your theme isn’t widget enabled, you can insert this plugin in your sidebar.php file or wherever you want like this :
<div>
<h3>My Last.fm</h3><?php lastfm_recent_sidebar([username],[songs to show],[timezone diff in seconds],[image position 'left' or 'right'],[The text at bottom of this widget],[enable cache 'true' or 'false'])?>
</div>
Download : You can get the latest release here : http://wordpress.org/extend/plugins/lastfm-rps/
Current Version : 1.1
Demo : You can see a working example in the sidebar
Whats New in Version 0.2?
- Added option to define how many songs are displayed on the page
- Seperated css file from code and added new “lastfm.css” file
- Added different stylesheets to recently played songs
- Changed the datetime display configuration like “x days y seconds and z minutes ago”
- Changed the div’s into tables which are more reliable for different themes.
- If the user hasn’t any wp_head() included in his/her theme’s header.php, this script checks and adds its css itself.
Whats the fixes in Version 0.3?
- Added a neccessary fix for the time difference between server time and local time.
- If there is a track played in the player which length is less than 4 minutes ,the script showed two recently listened songs, so this is fixed now.It only displays one.
Whats new in Version 0.4?
- Added support for not widget-ready themes.
- Added Screenshot
- Updated Readme.txt
Whats the fixes in Version 0.5?
- When no songs played for a long time or only played only one song, this script raised errors. This is fixed now.
- Optimized the SimpleXML Extension for speed issues.
What’s added in v0.6?
- Improved checking of album images.
- If the feed item contains no album name, then directly shows default image.
What’s New in v0.7?
- Added image positioning
- Added optional Bottom Text
- Removed the slashes before ‘ and “
- Converted tables to css so you have all the control in lastfm.css
- Added artist images support. Now it shows artist images when it can’t find the album image.
The changes in 0.8
- Added Various Artists album image support
- Added last.fm badge option
- Improved options page
- Added last.fm logos (you should use one)
The changes in 1.0.0
- Added cURL and fopen support
The minor changes in 1.0.2
- Added security to file reading function inside class.
The changes in 1.0.3
- Empty images show up as last.fm image placeholders now.
- Fixed the compatibility issue with wordpress 2.7 (Their compat.php broke one of my function and i renamed it.)
- Thanks to Tom for informing me that last.fm started to use 64×64 images instead of 50×50. Thats also changed.
The changes in 1.1
- Added caching support
- Changed Last.fm API v1.0 code to v2.0 code
- Fixed “Now Playing” code




















160 Responses to Last.fm RPS WordPress Plugin
Elizabeth
May 8th, 2008 at 19:20
Hi!
I really like this plugin! I installed it yesterday and it worked fine. Today, I looked at my page and where the plugin should be I got this message:
“Warning: Invalid argument supplied for foreach() in /home/patra344/public_html/winb/wp-content/plugins/lastfm-rps/lastfm.php on line 66″
I don’t know any php, so I don’t know what to fix or change or anything. I would really appreciate any help you could offer.
Thank you!!
Taha Paksu
May 8th, 2008 at 19:38
@Elizabeth: What’s your web page address? And if you can edit lastfm.php, please try to change :
if(!is_object($feed)) on line 61to
if((!is_object($feed))&(is_array($feed->track)))Elizabeth
May 8th, 2008 at 19:57
Hi!
I made the change as you suggested, but it did not help
Taha Paksu
May 8th, 2008 at 21:42
@Elizabeth: Ok. This happens when your feed is empty or includes only one song played. I’m going to fix it right now. When it’s finished, you can update your plugin from wordpress directory. Thanks.
Mike
May 9th, 2008 at 00:46
is there a way to have the feed refresh like every 3 minutes?
Taha Paksu
May 9th, 2008 at 11:01
@Mike: Do you mean caching? The plugin gets the updated feed everytime it loads
Topuz
May 10th, 2008 at 01:26
Hi, I really like this widget, it gives away the feeling of communication.
I have some questions & suggestions tough.
1) It would be nice if the widget would download artist images when there is no album cover availible. That would be very useful for some rare artists.
2) It would also be useful to add possiblity for users to add custom line of text on the bottom of the widget where they could place link to their last.fm page and a small disclamer in their own language.
3) Possibility to allign everything on the right side.
I hope this is not too much to ask
Great widget once again.
Jess
May 10th, 2008 at 01:46
This is a great plugin, very well done! I just have one complaint…a plugin title or song/artist title that has an apostrophe shows up like this:
Ex. What I’/m Listening To
Old 97′/s
This also causes the album art to not show up if the song title or artist title has the apostrophe, even if it shows up fine in my last.fm stream. I hope this can be fixed!
Thanks again for such fine work. Looks great on my site.
Taha Paksu
May 10th, 2008 at 02:12
@Topuz: I’ll add them to my todo list. Thanks for the suggestions
@Jess: The fix will be in next release. Thank you for showing me the point
Taha Paksu
May 11th, 2008 at 22:09
The latest release is available for downloading! Go get it
Emz
May 14th, 2008 at 00:31
Whenever I add the widget, after putting in my username as-is, the result on my blog is:
This username does not exist, or the feed service is down..
Another last.fm plugin is working fine (therefore reading the feed), and I’ve been trying this every day since last week. I don’t suppose you could even begin to know what I’m doing wrong?
Taha Paksu
May 14th, 2008 at 00:43
@Emz: Yes i don’t know why it could be acting like this
Maybe your server doesn’t support XML reading?
M
May 15th, 2008 at 22:53
I love this plugin but for some reason it is not formatting right at all in my sidebar! I’m still very new to WP so I’m clueless as to how it can be repaired. Any help would be great. Thanks!
Taha Paksu
May 15th, 2008 at 23:00
@M: for the badge there is a value like %57. try to change it as it seems fit in your sidebar.
Taha Paksu
May 21st, 2008 at 15:40
Well thank you for your feedback. But how can a web server don’t support file_get_contents
some hosts don’t support cURL and some dont support file_get_contents. I think i should add support of both systems. Thanks.
Kyotoweb
May 22nd, 2008 at 21:04
Hi
It’s user-friendly and it works nice.
I’ll follow this comments feed in case you know the answer
First, I would like to thank you for such a great plug-in
I just wanted to know if it’s possible to remove the “profile” part of your plugin ? ’cause I just want to show the last played song, and not necessarly informations about when I registered on Last.fm, how many tracks I played etc …
Kyotoweb
May 22nd, 2008 at 22:24
Well, I finally managed to by editing the plug-in himself
Putting all the settings to false was still showing my name & status ( User ) so I deleted it from the root 
Thanks again for your plugin !
Taha Paksu
May 22nd, 2008 at 23:54
that should be working.. but if it works like that you can do whatever you want
Kyotoweb
May 28th, 2008 at 17:45
The “This username does not exist, or the feed service is down.” happens on host running PHP5. Is that possible to get it work with it ?
Taha Paksu
May 28th, 2008 at 17:59
@Kyotoweb: I don’t know what causes this error. Maybe it’s the same error with hosts which don’t support file_get_contents. In next release I will add a different get function. Tomorrow maybe.
@jocuri: Thanks for using it.
beetFreeQ
May 29th, 2008 at 14:41
Hi there! I have exactly the same problem – “This username does not exist, or the feed service is down”. Would love to see a new version of the plugin that works on my blog like the other last.fm-plugins do – because your widget looks the best!
Taha Paksu
May 29th, 2008 at 14:44
@beetFreeQ: ok. I’m checking it now.
Taha Paksu
May 29th, 2008 at 16:24
please tell me if it displays the error again.
Kerem
May 29th, 2008 at 18:04
Selam,eklentiyi güncelledikten sonra bu hatayı veriyor…
Eklenti etkinleştirilemedi, çünkü önlenemeyen bir hataya sebep oldu.
Parse error: syntax error, unexpected T_RETURN in public_html/wp-content/plugins/lastfm-rps/simplexml.class.php on line 50
Taha Paksu
May 29th, 2008 at 18:58
@Kerem: 1.0.0 versiyonunu dene. Yeni yükledim.
– New version has been released. the v0.9 was buggy.
beetFreeQ
May 29th, 2008 at 19:05
Wow, that was a fast response! Well, unfortunately the problem is still there, after I updated to the new version (1.0.0)…
Here’s the phpinfo for my webspace at Greatnet.de – maybe it helps: http://web0.server87.greatnet.de/info.php
beetFreeQ
May 29th, 2008 at 19:11
It’s me again! Maybe you could compare your way of retrieving the data from last.fm with the code of “last.fm Records” at http://dirkie.nu/projects/lastfmrecords/ – that plugin works with exactly the same last.fm-name. Oh, and by the way: My last.fm name is beetfreeq – maybe it has something to do with the name itself!
Taha Paksu
May 29th, 2008 at 19:17
Well. The problem is solved I think. You can use the 1.0.1 version.
beetFreeQ
May 30th, 2008 at 10:18
Yep, it’s solved now
– works very nice. Now, that I can use the plugin, I already have some ideas for new features, if you don’t mind
These are my suggestions:
- option to disable the stylesheet at all. That way I could have the styles in my layout-css rather than having to change the plugin-css itself and losing my changes when updating the plugin.
- option to do the html-formatting myself using parameters.
- option to show the images in different sizes.
- option to choose whether to use an artist-image or the album-artwork.
- group songs by album – that way you could show only one image per album with all the played songs of it right/left of it. Maybe also with the option to show artist-image and album-artwork at the same time. I hope you understand what I’m trying to say
- Possibility to update the widget via Ajax. Would be nice, if the plugin loads without the xml-data at first and retrieves it, when the page is loaded completely. That way the site would load a bit faster.
I’d love to see those features in some future version of the plugin. But no need to hurry
– maybe in 2.0 or 3.0
Taha Paksu
May 30th, 2008 at 10:34
These are good suggestions. Maybe in 2.0 or 3.0 then
Kerem
May 30th, 2008 at 23:26
Teşekkürler,güncelledikten sonra oldu.
jocuri
May 30th, 2008 at 23:45
Keep up the good work! 10q
BangDon
June 3rd, 2008 at 09:09
Hi there! I have problem “This username does not exist, or the feed service is down”. in new version. but old version it’s OK!
Taha Paksu
June 3rd, 2008 at 21:16
@BangDon: I’ll look at that.
Sammy
June 4th, 2008 at 22:26
When I install the plugin, add it to my widget list and then enter my username I get this error in the widget box: “%BEG_OF_TITLE%Last.fm RPS%END_OF_TITLE%” and nothing displays on the homepage.
I have tried deactivating and reinstalling. Doesn’t work.
Sammy
June 4th, 2008 at 22:47
Oh – and not meaning to sound rude, thanks for the plugin and all the further support you are offering
Taha Paksu
June 5th, 2008 at 10:38
@Sammy: Please try to change your theme. If it works with other themes, then it’s a problem with it. Not the plugin itself.
Sammy
June 5th, 2008 at 13:01
Hi Taha. Nope it doesn’t work in other themes either. Basically what I’ve done is – downloaded the program, uploaded it, activated, put it in my widgets, edited the source and then in the widget box it’s come up with the above error.
In the actual web page all I get is the title of the section and then the PHP is broken from there. No footer is loaded etc.
I’ll persevere because it seems this error is only occuring with me – which is odd.
Taha Paksu
June 5th, 2008 at 13:18
@Sammy: You are using the same theme with me. so in your third.php try to add it by code if you can.
fog
June 7th, 2008 at 09:39
I really like this plugin! Thank you.
Taha Paksu
June 7th, 2008 at 09:51
@fog: Thank you for using it.
robertneumann
June 8th, 2008 at 06:23
Many thanks, nice Plugin.
Bob S
June 12th, 2008 at 05:38
Please permit me to ask a related question: I’m looking for a WordPress plugin that will run once a day and automatically create a blog entry listing the songs I’ve listened to in the last 24 hours. Do you know of such a plugin? Thanks!
Taha Paksu
June 12th, 2008 at 09:21
@robertneumann: Thanks.
@Bob S: No I don’t know any like that. Sorry.
Éric Senterre
June 21st, 2008 at 20:45
Hi!
I just installed this plugin a week ago and I really like this plugin, it works really nice and the output is just perfect!
But since yesterday, the plugin only tells me : “This user has not played any songs yet.” I don’t know why. FYI, you can check my last.fm profile.
Maybe there’s a corrupted file on my site ? Can you help me find why I have this message now ? Thanks alot!
Taha Paksu
June 21st, 2008 at 21:04
@Éric Senterre: Thats working? And that happens when you didn’t listen to any songs since 4 days.
gordie
July 3rd, 2008 at 15:30
hello, I’m trying the plugin (wordpress 2.6 beta 2) and get this error when activating it :
syntax error, unexpected ‘}’ in F:\web\BENOITGREANT2\blog\wp-content\plugins\lastfm-rps\lastfm.php on line 438
any solution ?
Taha Paksu
July 3rd, 2008 at 22:22
@gordie: which version gives this error?
gordie
July 5th, 2008 at 13:41
1.0.2, the last one.
harry
July 11th, 2008 at 19:57
hi,
i tried to install but i got this error
Fatal error: Call to undefined function: wp_register_sidebar_widget() – —————–
I am using K2 themes…and K2 sidebar widgets…please help me.
Taha Paksu
July 12th, 2008 at 15:06
@harry: hi, i don’t know what’s causing this but there might be something about wp_head() function. make sure that your theme has it in your header.php file.
gordie
July 15th, 2008 at 07:13
I confirm, your plugin is broken under WP 2.6 (just out !)
Taha Paksu
July 16th, 2008 at 18:07
@gordie: I didn’t try the code with wordpress 2.6 yet so maybe they changed the name of that function. I think that’s a fixable thing. Thanks for mentioning that. I’ll look at the code ASAP.
Joel
July 17th, 2008 at 19:24
Actually, my install worked fine with 2.6. I’m just now having problems, and blaming it on Last.fm’s updates. Might want to check out whatever they’re messing with over there.
Giofilo
July 20th, 2008 at 21:12
Great plugin!
There’s a little problem with XHTML validation: when I put the widget, the W3C system says that there are 10 errors.
It can be easily fixed adding the “alt” description to last.fm logo and closing the “img” tag with a “/” in the file lastfm.php on line 469. Like this:
…img src=’”.$plugindir.”/images/logo_lastfm_”.$options["color"].”.png’ alt=’last.fm’ />
I hope you will fix it in next release
Bye,
Giovanni
Taha Paksu
July 21st, 2008 at 17:58
@Joel: Yea Last.fm is a little busy now
I think the design was better before.
@Giofilo: Thank you. I’ll fix it in the next release when i have more time to release a new one
I’m working in a company now and this was a spare time hobby for me
gordie
July 25th, 2008 at 13:47
@Taha Paksu :
finally founded what was causing the problem on my blog :
Your first line in lastfm.php is
<?
and not
<?php !!!
Now it is working fine !
Thanks.
gordie
July 25th, 2008 at 14:00
PS : and I added THIS on the top of the lastfm.php file
if ($_REQUEST['page_id']!=347) {
return;
}
to show it only on page #347.
I don’t know why; but if (!is_page(’347′)) does not work.
Taha Paksu
July 25th, 2008 at 15:56
@gordie: that’s not my script’s fault
that’s about your server’s php setting. And thank you for this info
Blackhouse
July 27th, 2008 at 13:18
Heya,
Could you add an option (or make it default), to truncate very long titles? Really long titles (or artists) really mess up the layout
Thanks in advance!
Taha Paksu
July 27th, 2008 at 15:46
@Blackhouse: Sorry I have no time nowadays for updating this plugin. Maybe later..But you can try playing with css and search for how to use the “overflow” property of css. That may be useful for you.
Alejandro Urrutia Daglio
July 27th, 2008 at 22:59
Hi great plugin, all working fine untill last update (1.0.2) Now isn’t showing recent tracks for http://www.yovivoenvigo.com, used to work perfect with previous release.
I’ve checked to be correctly scrobbling to my last.fm account
Thanks!
Blackhouse
July 28th, 2008 at 11:05
@Taha Alright I understand, no problems, with a little tinkering I’ve managed to do it myself with a little truncate snippet. It probably isn’t too pretty, but it works
Kerem
August 6th, 2008 at 11:48
Abi eklentiyi bayadır kullanıyorum ama 2 gündür dinleme listesinde 2. satır 1. satırın üstüne kayıyor neden kaynaklanabilir acaba?Teşekkürler…
Taha Paksu
August 6th, 2008 at 15:59
@Kerem: 2. sıradaki Şarkı ismi uzun geliyodur. CSS ayarlarını bi kontrol et.
Kerem
August 6th, 2008 at 16:02
Teşekkür ederim cevapladığın için sorunu hallettim.
Alejandro Urrutia Daglio
August 7th, 2008 at 11:55
Taha Paksu , do you know what can be going on with my problem? Thanks
Taha Paksu
August 7th, 2008 at 15:52
@Alejandro Urrutia Daglio: I dont know what could be happening. If there are any error messages can you please mail to me or write it here? Maybe you should get the old version from wordpress.org if thats working?
Alejandro Urrutia Daglio
August 8th, 2008 at 11:45
@Taha Paksu: No errors at all, I will try to use a previous version, thanks mate!
Alejandro Urrutia Daglio
August 11th, 2008 at 16:35
Now’s working great! I just deactivate it and erase from plugins folder just to re upload and activate.
There would be great to have a css editor on options page.
Thanks for this wonderfull plugin!
I edit css on my style.css from my theme so you can see it working on my sidebar here: http://www.yovivoenvigo.com
Ben
August 15th, 2008 at 01:47
When you disable “Show Badge” option the first track is shown messup up in Internet Explorer. It works perfect in Firefox though.
parrulo
August 19th, 2008 at 14:05
Great plugin! Thank you very much!
Taha Paksu
August 19th, 2008 at 14:09
@parrulo: it looks great on your site
thank you for using it
Joel Goodman
August 22nd, 2008 at 23:01
Hey Taha,
The plugin’s come a long way! Thanks for sharing it and for all of your hard work. I’m in the middle of a redesign and I’m hardcoding my sidebars (non-widget enabled). Is there any way to specify in the tag not to show the badge? I really just want to show my recent track titles and the artwork image – no badge or anything.
thanks again!
Taha Paksu
August 23rd, 2008 at 00:44
@Joel Goodman: yea there is. but i didnt add that as a variable of the function. maybe i forgot. but you can open lastfm.php and there are the settings at line 18. it looks like :
[code]$settings = array( "showavatar" => true,
"showrealname" => true,
"showgender" => true,
"showage" => true,
"showcountry" => true,
"showregister" => true,
"showtrackcount" => true
);
[/code]
then you set all of that to false. then tell me if it works
Joel Goodman
August 23rd, 2008 at 22:06
Brilliant. That worked. It does, however still show the user status (subscriber, etc.) and the Last.fm username no matter what. Which is fine for me… I decided I’d like to show my scrobbled tracks anyway. Gotta do some styling on it though. Thanks!
Jeremy Swearingen
August 30th, 2008 at 19:02
Is there a way to make the album art larger? I changed the values in the CSS file to 80 pixels on each side but it resulted in blurry images because I was just scaling up the original 50×50 images. Then I looked in the lastfm.php file in hopes of finding where it set the size of the image but no luck. Any ideas? Thanks
Taha Paksu
September 1st, 2008 at 08:28
@Jeremy Swearingen: Jeremy there’s a way but you need to change the thumbnail source because this script is directly getting the original 50×50 images so there’s a 130×130 option too i think. you should edit the core and find the last.fm image links and transform it to that. For example you can open your last.fm page and find the difference between a 130×130 image and a 50×50 one. You can do it that way.
Marcin
October 21st, 2008 at 15:28
Hi there.
Great job… But on my site – http://www.winylowe.com I cannot display more then 1 records. When I do – the records are not alligned… they are like a cascade…
Any ideas?
Best regards
Christer Danmo
October 22nd, 2008 at 16:59
Great plugin
Atleast 3-4 times better than the other ones at http://wordpress.org/extend/plugins/.
The sad part of it is that I got one bug and one css “bug”, The first bug is that if the songname is to long and take two lines the information about when I played it are moved down over the other picture.
The other bug is in the tagg, which make it look bad.
Please have a look at my site to see the errors.
Thank you in advance and keep up the good work! This plugin is very good
Taha Paksu
October 22nd, 2008 at 17:12
@Marcin: I think that’s something about your theme’s css file. please be sure if there are any float:left or float:right in your sidebar css.
@Christer Danmo: Yes Christer I know that situation but I don’t know how to fix that
Maybe you can specify a minimum height for the lines in the lastfm.css file. Or maybe you can try to convert the inner label div’s into tables?
Christer Danmo
October 22nd, 2008 at 21:09
hmm.. I`ll have a look at it. Tables do expand auto
One more question, is it possible to make the plugin cache the images and not sync with last.fm every min? My blogg loads like 5-10 times slower than usual when I turn the plugin on :S
Taha Paksu
October 22nd, 2008 at 22:23
@Christer Danmo: Yea the caching system is what everybody wants but i haven’t got any time to work on it. Maybe later. But I dont know when. I started working 4 months ago,nowadays I’m so busy and I don’t know when it’ll end
hutzi
December 6th, 2008 at 02:24
my whole is layout is always jumping for a short time, when i put the the plugin on my sidebar to display. Any idea, why it happens?
Taha Paksu
December 6th, 2008 at 02:29
@hutzi: no i have no idea about that. can you give me your URL?
hutzi
December 6th, 2008 at 02:36
its http://lastmixtape.net/ it just happens in a short moment when i refresh the site!
Taha Paksu
December 6th, 2008 at 02:46
@hutzi: if that situation is about the vertical scrollbar please uninstall the plugin and look if the vertical scrollbar is visible. if it’s not, the re-positioning of the form is because your last.fm list causes the vertical scrollbar to get visible. if it’s not about vertical re-positioning, i couldn’t see any jumping with firefox. Please explain a little more.
Jason
December 23rd, 2008 at 01:28
Hey there,
Nice work – like it, however I get “This username does not exist, or the feed service is down” even though it is the correct username.
Any ideas where I look to fix this?
Thanks in advance.
Jas
Taha Paksu
December 23rd, 2008 at 01:42
@Jason: Well, mine is working well with my username, so its not about the script I think. Can you mail me your username @ tpaksu@hotmail.com? maybe i could take a look. btw, try
http://ws.audioscrobbler.com/2.0/user/your username]/recenttracks.rss
if that’s working, your script should work too. try to fit your username in there to make it work. maybe change the underlines to – ‘s or something.
Vibeke
January 15th, 2009 at 18:40
Hi
I just installed the plugin in WordPress 2.7 and it works very well. In the beginning I had the same problem as Christer Dammo, but I just changed the height in the lastfm.css file (line 2) to 185px and now it works fine and looks very nice. The lines don’t overlap anymore. It’s a great plugin, but maybe you could write in the FAQ on the WordPress site, that the users have to specify the height if the sidebar in their WordPress theme is very narrow?
Best regards
Taha Paksu
January 15th, 2009 at 21:42
@Vibeke: Thanks. I’m not developing this anymore because i have no time for it
you can write that in the discussion page. Thank you again. And sorry.
Hayalet
January 20th, 2009 at 23:07
Great plugin Thanks
Samantha
January 21st, 2009 at 21:49
Hello! I think this plugin is absolutely fantastic, but I have a slight problem….. When the css is set to the default 52px length everything is smashed together…. Here’s a screen shot: http://farm4.static.flickr.com/3478/3215247801_d4ea4a03ec_o.jpg
When I change the css to 100px this is what I get: http://farm4.static.flickr.com/3330/3216086056_7f9ddbb987_o.jpg
It’s like there’s a gap between the track, artist, and time, and a few extra lines. I looked through the css and I changed the length to a few different sizes, but I still get the gaps and lines. I honestly don’t know a lot about css, so I’m not sure how to fix it. Any help you can give me would be greatly appreciated!
Taha Paksu
January 25th, 2009 at 14:28
Samantha: I think you can use “margin-top:-10px” or which fits your design in
#lastfm_recent li span.lastfm_recent_date
#lastfm_recent li span.lastfm_recent_artist
lines.
Samantha
January 26th, 2009 at 02:43
I actually just removed the tags from the php file right after the artist name and song and it worked perfectly
Andrè Nakamura
March 17th, 2009 at 17:00
Hi Taha… when I use your plugin I see this text in the sidebar, right under the widget:
[code]Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /web/htdocs/www.beerdelirium.com/home/wp-includes/compat.php on line 105[/code]
Taha Paksu
March 18th, 2009 at 13:12
write something in the optional text field in the widget settings. i think maybe that causes the error.
Andrè Nakamura
March 18th, 2009 at 17:38
I tried, but the situation hasn’t changed and the message is still there.
Another thing I forgot: when I listen to tracks last.fm doesn’t recognize (because of the tag, I suppose) it appears a text field “Cover image for _____ ” instead of the little image. Is there anyway to replace this field with a default image?
Thanks a lot
Eloy
March 29th, 2009 at 16:00
Hello Taha
First of all… great Plugin, thanks. I have the same problems like Andrè Nakamura. First of all this ugly message (WordPress 2.7.1):
Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/www/web3/html/eloy/test/wp-includes/compat.php on line 105
And the second thing is the replacement with a standard image instead of the text (“Cover image for xxx”) on covers that are not avaliable. Any ideas?
Taha Paksu
March 29th, 2009 at 16:57
for the first problem (line 301 in lastfm.php) change
echo "<div id='lastfm_recent_comment'>" . stripslashes(htmlspecialchars_decode($text)) . "</div>";
to
echo "<div id='lastfm_recent_comment'>" . stripslashes(htmlspecialchars_decode($text."")) . "</div>";for the second one (line 288 in lastfm.php):
change
echo '<img src="'.$albumimage.'" alt="Cover artwork for '.stripslashes(lastfm_recent_capitalize($track->name)).'"/>';
to
if(image_exists($albumimage)){echo '<img src="'.$albumimage.'" alt="Cover artwork for '.stripslashes(lastfm_recent_capitalize($track->name)).'"/>';
}else{
echo '<img src="http://cdn.last.fm/flatness/catalogue/noimage/noartist_small.png" alt="Cover artwork for '.stripslashes(lastfm_recent_capitalize($track->name)).'"/>';
}
Eloy
March 30th, 2009 at 09:26
Great! Really Great!
Thanks for the plugin and your support
Greets from Switzerland
Eloy
Andrè Nakamura
April 2nd, 2009 at 02:01
Hi again.
The first issue is not resolved yet, although the correction I made to the code… for the second it’s ok now.
What happens? Maybe Eloy can help me, too?
Hubert
April 2nd, 2009 at 12:27
This is the Error i get:
__________________________________________________
Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL /htdocs/blog/wp-includes/compat.php on line 105
This I used in my Sidebar – Code:
__________________________________________________
My Last.fm
Taha Paksu
April 2nd, 2009 at 13:51
Try this.
starting at line 130 there’s a code block:
if(!function_exists('htmlspecialchars_decode')){function htmlspecialchars_decode($string,$style=ENT_COMPAT)
{
$translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS,$style));
if($style === ENT_QUOTES){ $translation['''] = '\''; }
return strtr($string,$translation);
}
}
replace it with this:
function htmlspecialchars_decode2($string,$style=ENT_COMPAT)
{
$translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS,$style));
if($style === ENT_QUOTES){ $translation['''] = '\''; }
return strtr($string,$translation);
}
then at line 301:
echo "<div id='lastfm_recent_comment'>" . stripslashes(htmlspecialchars_decode($text)) . "</div>";replace this with
echo "<div id='lastfm_recent_comment'>" . stripslashes(htmlspecialchars_decode2($text)) . "</div>";It should now work.
Hubert
April 2nd, 2009 at 17:39
It worked thank u very much
Andrè Nakamura
April 3rd, 2009 at 01:41
It worked!!! Thank you so much, you’ve been very very kind.
If you wanna take a trip on my blog (even if it’s in italian and you won’t understand nothing :P ) you’re welcome
Taha Paksu
April 3rd, 2009 at 09:28
Thanks to you all for using my plugin too
@Andrè: your site looks good. Nice design
Andrè Nakamura
April 3rd, 2009 at 21:26
Thank you… I’d rather like to spend some more time on it (because of the Internet Explorer issues), but I can’t…
PiterKokoniz
April 8th, 2009 at 04:37
Hello !!!!
I am Piter Kokoniz. oOnly want to tell, that I like your blog very much!
And want to ask you: is this blog your hobby?
Sorry for my bad english:)
Tnx!
Your Piter Kokoniz, from Latvia
Taha Paksu
April 9th, 2009 at 15:30
Thanks for informing me about that. I’ll prepare an update with the 64px images added.
Dan
April 10th, 2009 at 16:23
G’day. Great plugin. Just wondering which lines of code would I remove so that it doesn’t load or display the album art? Also, which lines of code would I remove to remove the last.fm logo?
Taha Paksu
April 10th, 2009 at 16:36
244 to 252 is for image loading
255 to 258 is for image showing
and line 478 is for the last.fm logo.
I didnt test them just looked and wrote here.
Dan
April 10th, 2009 at 16:52
Thanks for the quick reply. I tried to delete even just the first part, and now my site doesn’t load, just white, but when the code is there, it loads.
Dan
April 10th, 2009 at 16:55
But deleting lines 478 and 479 do remove the last.fm logo successfully.
Taha Paksu
April 10th, 2009 at 16:58
you should remove this lines
[code]if(trim($album->scalar)){
$albumimage = get_album_art(stripslashes($album->scalar),stripslashes($artist->scalar));
}else{
$replace = array(" ","&","/");
$with = array("%20","%26","%2F");
$artist = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes($artist))));
$album = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes($album))));
$albumimage = get_va_album_art($artist,$album);
}[/code]
and
[code]echo '<p class="lastfm_recent_image lastfm-recent-'.$position.'">';
echo '<a href="'.$feed->track->url.'" title="Cover artwork for '.stripslashes(lastfm_recent_capitalize($track->name)).'">';
echo '<img src="'.$albumimage.'" alt="Cover artwork for '.stripslashes(lastfm_recent_capitalize($feed->track->name)).'" />';
echo '</a></p>';[/code]
Taha Paksu
April 15th, 2009 at 10:25
New version has been released. Please backup your CSS file before updating.
Aditya
May 30th, 2009 at 19:36
Hi I am having a rather particular problem with my blog. I think I have already sent you a message about it before, but here goes anyway. The alt text displayed on the album art isn’t quite working correctly. Like I just listened to Guns N’ Roses – Chinese Democracy recently.. and it is showing the same album name for all the artists.
Can you please help? Thanks.
Taha Paksu
May 30th, 2009 at 21:36
@aditya : I checked your site, and I think you are using a different plugin?
Aditya
May 31st, 2009 at 17:38
Apologies Taha. I was messing around with another plugin at the same time.
Can you tell me how can I display the album art inline without the text, and how I can hide my profile information? Seems a bit complicated from the looks of it. All I want to show is album art, and the alt tags could display the information.. however at the moment it says “cover for..”. I have tried editing it, but to no avail.
clay
June 4th, 2009 at 12:23
Hello, I’m trying to get the plugin integrated into my about page. My theme does not support widgets, and I’ve got the plugin on the page in the place where I want it, but the spacing and horizontal rules seem off. Can you point me in the right direction of what I need to change/delete to have everything line up properly? I also would like to remove the whole badge and just display the coverart, song title, artist, and time played. The screenshot that came along with the install file is very close to what I would like it to look like, or like Andrè’s http://www.beerdelirium.com/
I appreciate any help you can give me, and thank you for the wonderful plugin.
Taha Paksu
June 4th, 2009 at 12:52
@clay: you need to play with the lastfm.css file to adjust the width,height etc.. and for the badge thing, open lastfm.php and near the end you should see;
[code]
$options = array(
'title' => 'Last.fm RPS',
'size' => 10,
'serversec' => 0,
'position' => 'left',
'text' => '',
'showbadge' =>true,
'badgeposition' => 'top',
'badgeoptions' => ''
);
[/code]
change these values to make it fit your needs.
felix
June 5th, 2009 at 17:44
I receive an error when is use your plugin. my last.fm profilename is felix-leiter . if i activate the plugin as a widget i receive this error: “This username does not exist, or the feed service is down.” when i use an nonexisting username i also receive this error. is there an problem with the minus in my profilname or do i have to active the “feed service”? an if i have to, can you tell me where i have to do this.
best regards
felix
Taha Paksu
June 5th, 2009 at 17:46
no i tried the feed service and your feed seems to be active as usual. here it is :
http://ws.audioscrobbler.com/1.0/user/felix-leiter/recenttracks.xml
i’m looking at the code right now. i’ll post here if i find something.
Taha Paksu
June 5th, 2009 at 18:00
OK. The problem is about your server. Your username doesn’t cause any problems. Check if your server supports the standart PHP XML extension.
Create a php file and write this inside it:
< ?php echo phpinfo();?>
then upload it to your host and run that.look for the XML table and check if its active in the configuration list.
felix
June 5th, 2009 at 21:18
hello,
these are my the phpmyinfo from my hoster, which is bplaced.net.
XML Support active
XML Namespace Support active
libxml2 Version 2.6.32
XML-reader &-writer active
DOM/XML enabled
libXML support active
libXML Version 2.6.32
libXML streams enabled
i guess “XML support active” is what matters but it doesn’t work somehow.
best regards
Taha Paksu
June 6th, 2009 at 11:23
ok. lets try this. open an empty php file on your server and try this code :
[code]<?
include_once "simplexml.class.php";
$sx = new simplexml;
$results = $sx->xml_load_file("http://ws.audioscrobbler.com/1.0/user/felix-leiter/recenttracks.xml");
echo "<pre>";
print_r($results);
?>[/code]
felix
June 6th, 2009 at 12:00
hello,
i get these result from your code:
“Parse error: syntax error, unexpected T_CLASS in /users/leiter/www/wordpress/test.php on line 2″
these are the phpinfo results:
SimpleXML
Simplexml support enabled
Revision $Revision: 1.151.2.22.2.45 $
Schema support enabled
after changing “simplexml.class.php” to “simplexml.php” in line 2 I get another pharse error.
“Parse error: syntax error, unexpected ‘:’ in /users/leiter/www/wordpress/test.php on line 4″
my php version is 5.2.8
Best Regards
DelilahMused
July 23rd, 2009 at 20:43
Hi! I’m trying to use this widget in my blog and I get the following error in the sidebar (after which clickable links to the music are there): Warning: gzinflate() [function.gzinflate]: data error in /home/passcreek/www/delilahmused/wp-includes/http.php on line 1787. What am I doing wrong? Thanks so much for your help.
Cindie
Taha Paksu
July 24th, 2009 at 14:26
@DelilahMused : I couldn’t see the error message when I clicked the links?
bigbrovar
September 22nd, 2009 at 07:55
Doesnt work in wordpress 2.8x
Taha Paksu
September 22nd, 2009 at 23:12
@bigbrovar : this site uses WP 2.8.4 and it works on it. what is the error?
bigbrovar
September 26th, 2009 at 01:25
“This username does not exist, or the feed service is down. ” that is what i get when i install it. am trying to run it on my localhost (ubuntu 9.04) what gives?
Taha Paksu
September 26th, 2009 at 15:18
does your username contain uppercase characters? What’s your username? I’ll try myself. On the other hand, you may not have the PHP’s XML extension installed on your localhost. That might be the problem too. Check it with phpinfo() function. Is there a “XML” component installed on the list?
bigbrovar
September 27th, 2009 at 03:14
my username on lastfm is bigbrova and phpinfo showed that XML is enabled and active. How there the widget work, will it for example work if am behind an http proxy? my localhost is behind an http_proxy so i had to add the proxy parameters to wordpress config which works fine for other internet aware widgets
bigbrovar
September 27th, 2009 at 03:26
Tried it again and i observed the following:
The page takes blog page takes an incredible amount of time to load even though its on localhost and when it loads i get this “This username does not exist, or the feed service is down.”
however if i disable the plugin. the page loads faster like it should.
Taha Paksu
September 27th, 2009 at 19:57
that’s because this plugin fetches a xml file from last.fm.. try it again when you upload your site on a host.
Bart
October 7th, 2009 at 22:42
So, i have a problem with the times sometimes when i listen to tracks, is see this -1d,23h and 58m ago for example offcourse.
What the problem? Can it be fixed? I really want it to work properly!
bigbrovar
October 21st, 2009 at 14:30
Hey mate I finally uploaded my blog onlone and it still doesnt work still says This username does not exist, or the feed service is down Just thought to let you know
pled
December 6th, 2009 at 14:18
Really great plugin ! very good looking, Thank you …
Ryan Cain
December 7th, 2009 at 09:22
Hello! I love your plugin, but have made one adjustment that you might like to add to the main version. In lastfm.php, I have adjusted my lastfm_datediff function to account for songs that are currently being listened to. These songs will have a $dateDiff of zero or less. My modified function looks like this:
function lastfm_datediff($date,$ret = 0,$serversec,$recentdisplayed){
$now = time();
$dateDiff = $now – $date + $serversec;
$fullDays = floor($dateDiff/(60*60*24));
$fullHours = floor(($dateDiff-($fullDays*60*60*24))/(60*60));
$fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60);
if($dateDiff =4) return “$fullMinutes minutes ago”;
if($recentdisplayed) return “$fullMinutes minutes ago”;
if($ret) return “recent”;
return “just listened”;
}
where I’ve added the line: if($dateDiff <= 0) return "listening now";
Ryan Cain
December 7th, 2009 at 09:26
Heh, I guess the code doesn’t show up too well in the comments. Anyway.. add
if($dateDiff <= 0) return "listening now";
right after the line:
$dateDiff = $now – $date + $serversec;
Taha Paksu
December 7th, 2009 at 12:04
Thank you. I’m gonna review all the comments since the last version and build a new version but i don’t know when i’ll have a chance to do that. But thanks.
Neal
December 20th, 2009 at 19:09
I can’t get the plugin to pull my song info. Do I have to scrobble from a local player or does it pull info from the online listening of last.fm. Want to make sure I cover my bases. Plugin looks great though.
Thanks in advance.
Taha Paksu
December 21st, 2009 at 00:45
what exists in your personal profile page as listened or listening is displayed in this plugin. the answer is both you are listening locally and submitted to last.fm and you listen on the last.fm radio should be displayed here. and if you didnt listen to a song for a while maybe it wont show any songs on your profile.
Lizzie
December 23rd, 2009 at 15:17
My songlist isn’t showing up correctly – it’s all jumbled up. Can anyone help?? I’m using WP 2.9.
http://countingtheyears.com
Thanks x
Csabi
January 10th, 2010 at 15:11
@Bart:
Hey!
I fixed this problem on my site:
Search this line:
$fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60);
Under this, add a a new line:
if($fullDays == -1) return “now playing”;
Its works fine.
Taha Paksu
March 3rd, 2010 at 20:25
sorry i don’t know how but it went to my spam folder that i just realised
thanks for that fix.
Jin
April 5th, 2010 at 03:40
Yea, having this problem as well, but the solution you stated isn’t working for me. :\ I get this error:
“Parse error: syntax error, unexpected T_STRING in /home/soratokujira/soratokujira.tk/wp-content/plugins/lastfm-rps/lastfm.php on line 191″
Any help? :/
Taha Paksu
May 21st, 2010 at 18:20
hi,
thats because the last.fm server’s time is different from your hosting server’s time. There’s a box in the plugin’s configuration labeled “server time difference” so you can set the difference there, for example the song you are listening is displaying like this :”-1d 23h 55m ago” this means your server’s time is about 5 minutes = 300 seconds different from last.fm server’s time. you should set the value 300 or maybe 330 there and try again.
Olly
March 1st, 2011 at 20:55
There is an issue with the formatting the new ‘Twenty Ten’ default theme in the new version of WordPress 3.1. Can you see if you can fix it. You can see the problem at my website:
http://www.saltedlolly.com
Otherwise this is really excellent. I love the CD album covers.
Taha Paksu
March 2nd, 2011 at 00:05
Sorry,I don’t think that I might have the chance to look tonight but I’ll get back to you soon. Cya.
Hody
March 13th, 2011 at 03:41
I cant use your plugin, it either shows your profile (nice taste by the way) or I get an error message saying:
Allow_url_fopen: 1
Warning: file_get_contents(http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=Hody72&api_key=pdv4w446gwfhkmjrphu433zj&limit=10) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /var/www/vhosts/hody.de/httpdocs/wp-content/plugins/lastfm-rps/simplexml.class.php on line 47
This username does not exist, or the feed service is down.
Username is Hody72 but the API key is another one – how can I fix this, please please help
Taha Paksu
March 13th, 2011 at 19:02
is your rpscache.tmp file writable in the plugin folder? if it’s not, you may have to turn the caching feature off or make the file writable.
Mel
June 30th, 2011 at 04:46
I’m not great with this whole scripting thing. But I know enough to that I was able to change the album overlays. I got them to show up the way I want them however I can’t seem to get the artist and playback info to display the right way. Can you help?
Here is a pic of what it looks like. Thanks.
http://cl.ly/0x190F2l2k3t2c1i2y3P
Simon
July 3rd, 2011 at 03:32
Beautiful plugin – thank you very much for creating this!
Taha Paksu
July 4th, 2011 at 20:58
sorry for the late answer. in lastfm.css file there are the individual styling definitions for :
#lastfm_recent li .lastfm_recent_date
#lastfm_recent li .lastfm_recent_artist
#lastfm_recent li .lastfm_recent_title
inside of each one you can put:
padding:20px; (or the value that fits to your design well)
Taha Paksu
July 4th, 2011 at 21:01
thank you for using it
Austin Maguire
July 11th, 2011 at 17:28
Hiya, Can this RPS player be used in a normal custom built php or html website?
Taha Paksu
July 13th, 2011 at 10:10
well i had built one but i need to find where it was
i’ll let you know.
Austin Maguire
July 14th, 2011 at 18:58
Hi Taha,
Is it possible to put the last fm music widget into a regular html/php website? I would like to put the “Last.fm Recently Played Songs v1.1 Plugin” from this wordpress site: http://www.ventolin.org onto my website. Is this possible?
Thanks,
Austin