MyBB Community Forums

Full Version: Scrobbler Last.fm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Helo, guys.
I'm making a plugin that displays the three latest music the user has logged into your account on last.fm subscription.

a good part of plugim I could do, I wonder if people could help me finish it, is the sequinte, he managed to "work" but if the second user on the same page with him plugim bug.

Well I'll post the files that I used in the Annex.

has some additional changes to make are the following.

In INC/FUNCTIONS_POST
search:
$parser_options['me_username'] = $post['username'];
			}
			break;
	}
add before:
//* LASTFM PLUGIN	
	$id = $post['uid'];
	
	$query=$db->query("SELECT * FROM ".TABLE_PREFIX."users WHERE uid = '$id'");
	while($result=$db->fetch_array($query))
{
   $lastfmuser = $result['lastfm'];
}
	if(empty($lastfmuser)){
	$post['lastfm'] = "";
	} elseif (!empty($lastfmuser)){	
	$post['lastfm'] = "
	<script type='text/javascript'> 
		$(document).ready(function(){
    $('div#lastfm').lastFM({
        username: '$lastfmuser', 
        apikey: 'a26c91aeb4d9fc1ac12e97f2ff802c0a',
        number: 3,
        artSize: 'large',
        noart: 'last.fm/images/noartwork.gif',
        onComplete: function(){
        }
    });
});
</script> 
<p>Ăšltimos scrobbles de <a href='http://www.lastfm.com.br/user/$lastfmuser'>$lastfmuser</a></p>
<p>   
<div class='last'>
<div id='lastfm'>
<dl>
<dt class='lfm_art'>
<a href='#'><img src='last.fm/images/sobre_capa.png' alt='CD' class='lfm_overlay' /></a>
</dt>
<img src='last.fm/images/seta.png' class='seta' />
<div class='info'> 
<div class='lfm_song'></div>
<div class='lfm_artist'></div>
<div class='lfm_album'></div>
<a class='lfm_link' href='#'></a>
</div>
</dl>
</div>
</div></p>
<div style='clear:both;'	
	";
	};
	
//* FIM LASTFM PLUGIN

and now go to theme im postibit_clasic
search:
{$post['signature']}

add before:
{$post['lastfm']}

and now go to header

add the start:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> 
<link href="last.fm/style/engage.lastfm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="last.fm/js/engage.lastfm.js"></script>

good plugin, yet creates an area on the control panel to add the user has to last.fm by DB im manualmelte Add active user.

sprry for my bad english i'm from Brazil. :p
anyone?