Skip to content →

Last.fm RPS WordPress Plugin

 

 

 

 

 

 

 

 

 

 

 

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 120

Please 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 middle sidebar at my homepage 😉

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

Published in Featured Wordpress

200 Comments

  1. […] ana sayfas

  2. […] ana sayfas

  3. […] ana sayfas

  4. […] Wp i

  5. Elizabeth Elizabeth

    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/p

  6. @Elizabeth: What’s your web page address? And if you can edit lastfm.php, please try to change :
    if(!is_object($feed)) on line 61
    to
    if((!is_object($feed))&(is_array($feed->track)))

  7. Elizabeth Elizabeth

    Hi!
    I made the change as you suggested, but it did not help 🙁

  8. @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.

  9. is there a way to have the feed refresh like every 3 minutes?

  10. @Mike: Do you mean caching? The plugin gets the updated feed everytime it loads

  11. 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 usefu

  12. 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

  13. @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 🙂

  14. The latest release is available for downloading! Go get it 🙂

  15. Emz Emz

    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 t

  16. @Emz: Yes i don’t know why it could be acting like this 🙂 Maybe your server doesn’t support XML reading?

  17. M M

    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!

  18. @M: for the badge there is a value like %57. try to change it as it seems fit in your sidebar.

  19. 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.

  20. Hi 🙂
    First, I would like to thank you for such a great plug-in 😉 It’s user-friendly and it works nice.
    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 neces

  21. 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 !

  22. that should be working.. but if it works like that you can do whatever you want 🙂

  23. 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 ?

  24. @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.

  25. 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!

  26. @beetFreeQ: ok. I’m checking it now.

  27. please tell me if it displays the error again.

  28. 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 o

  29. @Kerem: 1.0.0 versiyonunu dene. Yeni yükledim.

    — New version has been released. the v0.9 was buggy.

  30. 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

  31. 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

  32. Well. The problem is solved I think. You can use the 1.0.1 version.

  33. 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 l

  34. These are good suggestions. Maybe in 2.0 or 3.0 then 😀

  35. Teşekkürler,güncelledikten sonra oldu.

  36. Keep up the good work! 10q

  37. 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!

  38. 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.

  39. Oh – and not meaning to sound rude, thanks for the plugin and all the further support you are offering 🙂

  40. @Sammy: Please try to change your theme. If it works with other themes, then it’s a problem with it. Not the plugin itself.

  41. 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

  42. @Sammy: You are using the same theme with me. so in your third.php try to add it by code if you can.

  43. fog fog

    I really like this plugin! Thank you.

  44. Bob S Bob S

    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!

  45. @robertneumann: Thanks.

    @Bob S: No I don’t know any like that. Sorry.

  46. 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

  47. @Éric Senterre: Thats working? And that happens when you didn’t listen to any songs since 4 days.

  48. gordie gordie

    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 ?

  49. @gordie: which version gives this error?

  50. gordie gordie

    1.0.2, the last one.

  51. 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.

  52. @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.

  53. gordie gordie

    I confirm, your plugin is broken under WP 2.6 (just out !)

  54. @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.

  55. 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.

  56. 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 l

  57. @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 🙂

  58. gordie gordie

    @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.

  59. gordie gordie

    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.

  60. @gordie: that’s not my script’s fault 🙂 that’s about your server’s php setting. And thank you for this info 🙂

  61. Blackhouse Blackhouse

    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!

  62. @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.

  63. 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!

  64. Blackhouse Blackhouse

    @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 🙂

  65. 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…

  66. @Kerem: 2. sıradaki Şarkı ismi uzun geliyodur. CSS ayarlarını bi kontrol et.

  67. Teşekkür ederim cevapladığın için sorunu hallettim.

  68. @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?

  69. 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 ca

  70. Ben Ben

    When you disable “Show Badge” option the first track is shown messup up in Internet Explorer. It works perfect in Firefox though.

  71. Great plugin! Thank you very much! 🙂

  72. @parrulo: it looks great on your site 🙂 thank you for using it 😉

  73. 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 jus

  74. @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"

  75. 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!

  76. Jeremy Swearingen Jeremy Swearingen

    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

  77. @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 t

  78. 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

  79. 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

  80. @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

  81. 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

  82. @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 🙂

  83. hutzi hutzi

    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?

  84. @hutzi: no i have no idea about that. can you give me your URL?

  85. @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

  86. 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

  87. Vibeke Vibeke

    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 lin

  88. @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.

  89. Great plugin Thanks

    • 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.

  90. Samantha Samantha

    I actually just removed the tags from the php file right after the artist name and song and it worked perfectly 🙂

  91. 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[

    • write something in the optional text field in the widget settings. i think maybe that causes the error.

  92. 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 i

  93. 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/el

    • 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'>" . stripslash

  94. Great! Really Great!
    Thanks for the plugin and your support 🙂

    Greets from Switzerland
    Eloy

  95. 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?

  96. 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:
    _____________

    • 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

  97. It worked thank u very much

  98. 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 😛 ) you’re welcome

    • Thanks to you all for using my plugin too 🙂

      @Andrè: your site looks good. Nice design 🙂

  99. Thank you… I’d rather like to spend some more time on it (because of the Internet Explorer issues), but I can’t…

    🙂

  100. 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

  101. Dan Dan

    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?

  102. 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.

  103. Dan Dan

    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.

  104. Dan Dan

    But deleting lines 478 and 479 do remove the last.fm logo successfully.

  105. 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");

  106. New version has been released. Please backup your CSS file before updating.

  107. 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 – Chines

  108. @aditya : I checked your site, and I think you are using a different plugin?

  109. 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 sho

  110. 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

  111. @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,

  112. felix felix

    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

  113. 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

  114. felix felix

    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

    • 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")

  115. felix felix

    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

  116. 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

    • @DelilahMused : I couldn’t see the error message when I clicked the links?

  117. Doesnt work in wordpress 2.8x 🙁

    • @bigbrovar : this site uses WP 2.8.4 and it works on it. what is the error?

      • “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?

      • 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 “X

      • 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 co

      • 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 disa

      • that’s because this plugin fetches a xml file from last.fm.. try it again when you upload your site on a host.

      • 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

  118. 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!

  119. Really great plugin ! very good looking, Thank you …

  120. 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 $dateD

    • 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;

      • 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.

  121. 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.

    • 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

  122. @Bart:

    Hey!
    I fixed this problem on my site:

    Search this line:
    $fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*

    • sorry i don’t know how but it went to my spam folder that i just realised 🙂 thanks for that fix.

    • Jin Jin

      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

  123. 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 displayin

  124. 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

    • Sorry,I don’t think that I might have the chance to look tonight but I’ll get back to you soon. Cya.

    • 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.

  125. Beautiful plugin – thank you very much for creating this!

  126. Austin Maguire Austin Maguire

    Hiya, Can this RPS player be used in a normal custom built php or html website?

    • well i had built one but i need to find where it was 😀 i’ll let you know.

  127. Austin Maguire Austin Maguire

    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,

    Au

    • Hi Jeremy, The easy fix for your error is listening to 10 songs and make that one disappear.

      • Well, yeah. What causes it? Does it happen often?

      • I think the “+” between the artists causes it. I couldn’t find the correct type for names like that for now and I don’t think it’ll happen too much. But once I got the answer I’ll let you know.

      • Ok, I think I’ve found it. There’s a function named get_artist_art() at line 291 and it’s first line is something like this :

        $artist = str_replace("%2F","%252F",urlencode($artist));

        Add this after that line (don’t replace the line) :

      • What happens: it works. That’s what happens.

        You are awesome and your plugin is wonderful, even before this little bug. THANK YOU!!

      • Yea, I know! (I’m watching “friends” (again) so sorry :P) And, thanks for using it.

  128. Hey there!

    I seem to be getting the following error — may you help?

    Catchable fatal error: Object of class stdClass could not be converted to string in /home/exit3/public_html/exit3/wp-content/plugins/lastfm-rps/lastfm.php on line 190

    Thanks!

  129. try replacing

    $album = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes($album))));

    with

    $album = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes((string)$album))));

    on line 190.

  130. Hey, I’m getting an error when I try and install it 🙁
    All other plugins install fine but for some reason this won’t, i’ve had it installed before, but changed host and updated wordpress. Any ideas?

    Plugin could not be activated because it triggered a fa

  131. Re-download the package and re-install it. And tell me what happens.

  132. Tried deleting and reinstalling to no avail, still hit the same error. Updated WP to 3.4.1 and the error is still the same 🙁

  133. Sue Sue

    I like your plugin best out of many I tried, but it sometimes shows one more item than what I have set in “list size” If I set list size to four, sometimes it will show five items, and so on. Any fix for this?

    At first I had the plugin set to show my use

  134. Hi Sue, thanks for trying my plugin first. Second, I didn’t catch this bug before and I’m not developing this plugin further. That was written 4 years ago. The overlapping issue would be fixed with CSS I think. And caching is saving the response from last

    • Sue Sue

      I’m sorry to hear the plugin isn’t being developed further. But I’ll keep using it with my workarounds until I find something better. Thanks.

  135. Sorry, I don’t have much time to work with this plugin. Maybe later (don’t know when) I’ll rewrite it with new features. So if you want some extra features, feel free to post here. And thanks for using it.

  136. Hello! I know this is kind of off topic but I was wondering if you knew where I could get a captcha plugin for
    my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot!

    • You can check the wordpress plugin repository. In your admin screen, use Plugins -> Add New and then search “comment captcha” in there.

Leave a Reply