[ABD] Last.fm API 0.9.2

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

[ABD] Last.fm API 0.9.2

Post by sheVcza » Sun Apr 19, 2009 1:30 pm

Image

MOD Name: Last.fm API
MOD Version: 0.9.2 beta
Author: sheVcza

MOD Description: This mod adds last.fm statistics to the user panel. MOD switches "on" and statistics are visible to user which has filled last.fm nick in his or her profile. Currently listened artist, song & album with a picture of the artist (taken from last.fm). It contains also ten recently played songs (with the time and date of listening), top 15 played artists in last 7 days and the TOP ten artists all over. The number of listenings are also shown. Next function of this mod is TASTE-O-METER. If you view the profile page of user, which have last.fm username (and you too), you see the musical compatibility (in percent) and some interprets, which you share.

Supported languages: English, Czech, Slovak
Supported styles: prosilver, subsilver2
Supported phpBB version: 3.0.6
Licence: GNU General Public License (GPL)

Screen:
Image

Installation Level: Easy
Installation Time: ~15 Minutes
Download: http://phpbb.metallum.cz/viewforum.php?f=3
Demo: http://phpbb.metallum.cz
Format:
Image

NOTE:
After the installation it is necessary to continue with another step. Data taken from last.fm MOD needs two keys (apiKey & secret). Both you can get here here: http://www.last.fm/api/account. Just follow the instructions and then put your keys to the file ".\lastfmapi\config.php".

Changelog:
0.9.1
  • [Fix] Critical bug, because of that mod didn't work correctly
0.9.2
  • Editing data in ACP
  • TASTE-O-METER
Roadmap:
  • ACP
  • UCP
  • Cache
  • Music-style statistics (tags)
  • Events
  • .. and many more
I'll be glad of any suggestions about this MOD. :)
Last edited by sheVcza on Tue Dec 28, 2010 5:16 pm, edited 7 times in total.
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] Last.fm API

Post by Erik Frèrejean » Sun Apr 19, 2009 1:54 pm

Interesting MOD, I've been thinking about writing something like this myself once I had time :).
I just had a quick look through the installation file and found the following problem:

Code: Select all

                    //Last.fm API
                    'lastfm'        => request_var('lastfm', $user->data['user_lastfm']),
                    //Last.fm API 
Should be:

Code: Select all

                    //Last.fm API
                    'lastfm'        => utf8_normalize_nfc(request_var('lastfm', $user->data['user_lastfm'], true)),
                    //Last.fm API 
Because the lastfm field expects a string you should request it with the multibyte var to yes and normalize it to prevent utf8 issues.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

Re: [BETA] Last.fm API

Post by sheVcza » Sun Apr 19, 2009 4:24 pm

Thanks for annoucement, Ifixed it! :)
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] Last.fm API

Post by Erik Frèrejean » Sun Apr 19, 2009 4:28 pm

An other quick advice is to have a good look through the coding guidelines for phpBB as your style is completely different which doesn't increase readability of your code. And as this is a requirement by the MOD team.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

Re: [BETA] Last.fm API

Post by sheVcza » Sun Apr 19, 2009 5:27 pm

Ok, thanks! :))
Btw. I've found one critic bug and because of that mod didn't work correctly. Now it's fixed (in version 0.9.1).
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

User avatar
dragnaar
Registered User
Posts: 43
Joined: Sun Jan 25, 2009 10:56 pm
Location: Crimea

Re: [BETA] Last.fm API

Post by dragnaar » Mon Apr 20, 2009 9:54 am

Great mod!
I waited a long time that something like.
But I found another bug.
When looking through any topic, every user has my last.fm nickname under the location. How to remove it from there?

MOD Version: 0.9.1 beta

User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

Re: [BETA] Last.fm API

Post by sheVcza » Mon Apr 20, 2009 10:48 am

Thanks for bug report! It's now fixed (in actual version - 0.9.1).
You can fix it by yourself, just follow this instructions: http://phpbb.metallum.cz/other/bugfix.xml
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

User avatar
dragnaar
Registered User
Posts: 43
Joined: Sun Jan 25, 2009 10:56 pm
Location: Crimea

Re: [BETA] Last.fm API

Post by dragnaar » Mon Apr 20, 2009 2:22 pm

Tanx man! Its working)
I have another problem...
Some users can not add last.fm statistics in their profiles
For example, username: Samael
lastfm username:tarnazar
When he send his form with his lastfm username, form return empty.
I have created an add-on for adding the data via the admin control panel, and it works, but the problem remains - some users still cannot insert the lastfm info via their profile settings.

Feel free to adjust my add-on for using in your mod, (if you like).

includes/acp/acp_users.php
find

Code: Select all

					'jabber'		=> utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)),
after add

Code: Select all

					//Last.fm API
					'lastfm'		=> utf8_normalize_nfc(request_var('lastfm', $user->data['user_lastfm'], true)),
					//Last.fm API
find

Code: Select all

'yim'			=> array('string', true, 5, 255),
add after

Code: Select all

					//Last.fm API
						'lastfm'		=> array('string', true, 5, 255),
						//Last.fm API
find

Code: Select all

'user_yim'		=> $data['yim'],
add after

Code: Select all

							//Last.fm API
							'user_lastfm'	=> $data['lastfm'],
							//Last.fm API
find

Code: Select all

'YIM'		=> $data['yim'],
add after

Code: Select all

					//Last.fm API
					'LASTFM'	=> $data['lastfm'],
					//Last.fm API
language/en/acp/styles.php
find

Code: Select all

?>
before

Code: Select all

// Last.fm API
$lang = array_merge($lang, array(
	'LASTFM'							=> 'Last.fm',
	'LASTFM_EXPLAIN'					=> 'Last.fm username',
));
adm/style/acp_users_profile.html
find

Code: Select all

		<dd><input type="text" id="website" name="website" value="{WEBSITE}" /></dd>
	</dl>
add after

Code: Select all

	<dl>
		<dt><label for="lastfm">{L_LASTFM}:</label></dt>
		<dd><input type="text" name="lastfm" id="lastfm" value="{LASTFM}" /></dd>
	</dl>
Last edited by dragnaar on Mon Apr 20, 2009 3:50 pm, edited 1 time in total.

User avatar
adzyboy
Registered User
Posts: 215
Joined: Fri Jun 20, 2003 8:50 pm
Location: Burnley, England
Contact:

Re: [BETA] Last.fm API

Post by adzyboy » Mon Apr 20, 2009 3:11 pm

Just installed this.. it works very well. Looks very neat aswell. Seem to recall a last.fm mod on here a while back that just didn't fit in whatsoever!

Anyway, slight problem I found, the edit for ucp_profile_profile_info.html, the edit: <label for="website"> should be <label for="lastfm">. Nothing big, but figured I'd point it out.

Thanks a bunch for making this anyway, done a top job on it :)

User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

Re: [BETA] Last.fm API

Post by sheVcza » Mon Apr 20, 2009 5:54 pm

@adzyboy: That's right, I will fix it in next version. Thanks! :)
@dragnaar: Thanks for ACP addon, I will add that to the next version. :) So, to your problem.. I don't think that is the problem of the MOD, but I dont know where could be the mistake.. If you use that last.fm username in your profile via ucp settings, does it work? Try to find out what is the difference between the profiles of users with this problem and without it, and maybe we'll find and fix it.
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

User avatar
dragnaar
Registered User
Posts: 43
Joined: Sun Jan 25, 2009 10:56 pm
Location: Crimea

Re: [BETA] Last.fm API

Post by dragnaar » Mon Apr 20, 2009 10:09 pm

I`m very sorry, this is not your mod bug. :roll:

User avatar
sheVcza
Registered User
Posts: 26
Joined: Tue Apr 15, 2008 3:05 pm
Location: Czech Republic
Contact:

Re: [BETA] Last.fm API

Post by sheVcza » Tue Apr 21, 2009 11:54 am

And have you already found where the problem is?
Skalat maðr rúnar rista
nema raða vel kunni
þat verðr morgum manni
es of myrkvan staaf villisk.

Verderf
Registered User
Posts: 16
Joined: Wed Jun 18, 2008 7:43 am

Re: [BETA] Last.fm API

Post by Verderf » Tue Apr 21, 2009 1:22 pm

Your mod looks really awesome, Im however having some problems running it.
please note that im using the hermes theme.

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3760: Cannot modify header information - headers already sent by (output started at /language/en/common.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3762: Cannot modify header information - headers already sent by (output started at /language/en/common.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /language/en/common.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /language/en/common.php:1)

User avatar
dragnaar
Registered User
Posts: 43
Joined: Sun Jan 25, 2009 10:56 pm
Location: Crimea

Re: [BETA] Last.fm API

Post by dragnaar » Tue Apr 21, 2009 1:38 pm

Yes, of course. The problem was in the Country Flag mod.
Users who do not choose their flag, they could not save the settings in UCP profile settings (www, birth day, ocupation, last.fm etc.) and form return empty, but if you select the flag, then it works.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] Last.fm API

Post by Erik Frèrejean » Tue Apr 21, 2009 1:39 pm

@Verderf,

What program do you use to edit the files?
Make sure that there is nothing before

Code: Select all

<?php
in "language/en/common.php". This includes spaces and white lines!
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

Locked

Return to “[3.0.x] Abandoned MODs”