PDA

View Full Version : Profile Enhancements - Last.FM Widget In Profile


Lizard King
06 Apr 2008, 10:25
This will allow your members to display their latest listened songs within Last.Fm

Installation Instructions :
Create a new userfield
Single Line Textbox
Name : Last.Fm Widget
Description : Enter your Last.Fm username

Save the field and copy the field number. Example : if the new added field number is field30 then note 30 .

Import the product file. Edit memberinfo_block_lastfm template and replace all instances of $userinfo[fieldXX] with your profile field number such as $userinfo[field30]

Save your template and open MEMBERINFO template. Look for
$template_hook[profile_right_first]
$blocks[stats_mini]
$template_hook[profile_right_mini]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]
add $blocks[lastfm] according to your choice
The final look shall look like

$template_hook[profile_right_first]
$blocks[stats_mini]
$template_hook[profile_right_mini]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[lastfm]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]

Demo (http://www.ayyas.com/uyeler/lizard-king/)

FleaBag
06 Apr 2008, 11:26
Thanks Mert, I'll give it a whirl!

Jasem
06 Apr 2008, 11:51
Thank you very much :)

MrToasty
06 Apr 2008, 12:42
To have this be called without having to edit templates manually, I replaced in your xml install file the following:-

$blocks[lastfm]

with

$template_hook[profile_right_album]

...and also, the code you provided wasn't in English, so for those of us who have only English users, you'll want to use the following in the template "memberinfo_block_lastfm" remembering to replace all 8 instances of $userinfo[fieldXX] with the field number you generated when creating a new custom field:-

<!-- Last.FM -->
<if condition="$userinfo[fieldXX]">
<div id="youtube" class="tborder content_block">
<h4 class="thead block_title">
<a href="#top" class="collapse_gadget" onclick="return toggle_collapse('lastfm')"><img id="collapseimg_lastfm" src="images/buttons/collapse_generic.gif" alt="" border="0" /></a>
<a name="albums"></a>
<span class="block_name">Last.FM</span>
</h4>
<div class="block_content" id="collapseobj_lastfm" style="">
<div class="alt2 block_row block_footer"><style type="text/css">table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 tr.lfmHead a:hover {background:url(http://cdn.last.fm/widgets/images/en/header/chart/recenttracks_regular_black.png) no-repeat 0 0 !important;}table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 tr.lfmEmbed object {float:center;}table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 tr.lfmFoot td.lfmConfig a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px 0 !important;;}table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 tr.lfmFoot td.lfmView a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px 0 !important;}table.lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051 tr.lfmFoot td.lfmPopup a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px 0 !important;}</style>
<table class="lfmWidgetchart_590a5768c2b9458dbbab9df2457e9051" cellpadding="0" cellspacing="0" border="0" style="width:184px;" align="center"><tr class="lfmHead"><td><a title="$userinfo[fieldXX]: Recently Listened Tracks" href="http://www.last.fm/user/$userinfo[fieldXX]/" target="_blank" style="display:block;overflow:hidden;height:20px;width:184px;background:url(http://cdn.last.fm/widgets/images/en/header/chart/recenttracks_regular_black.png) no-repeat 0 -20px;text-decoration:none;border:0;"></a></td></tr><tr class="lfmEmbed"><td><object type="application/x-shockwave-flash" data="http://cdn.last.fm/widgets/chart/friends_6.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="184" height="199" > <param name="movie" value="http://cdn.last.fm/widgets/chart/friends_6.swf" /> <param name="flashvars" value="type=recenttracks&amp;user=$userinfo[fieldXX]&amp;theme=black&amp;lang=en&amp;widget_id=chart_590a5768c2b9458dbbab9df2457e9051" /> <param name="bgcolor" value="000000" /> <param name="quality" value="high" /> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> </object></td></tr><tr class="lfmFoot"><td style="background:url(http://cdn.last.fm/widgets/images/footer_bg/black.png) repeat-x 0 0;text-align:right;"><table cellspacing="0" cellpadding="0" border="0" style="width:184px;"><tr><td class="lfmConfig"><a href="http://www.last.fm/widgets/?colour=black&amp;chartType=recenttracks&amp;user=$userinfo[fieldXX]&amp;chartFriends=1&amp;from=code&amp;widget=chart" title="Get your own widget" target="_blank" style="display:block;overflow:hidden;width:85px;height:20px;float:right;background:url( http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px -20px;text-decoration:none;border:0;"></a></td><td class="lfmView" style="width:74px;"><a href="http://www.last.fm/user/$userinfo[fieldXX]/" title="View $userinfo[fieldXX]'s profile" target="_blank" style="display:block;overflow:hidden;width:74px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px -20px;text-decoration:none;border:0;"></a></td><td class="lfmPopup"style="width:25px;"><a href="http://www.last.fm/widgets/popup/?colour=black&amp;chartType=recenttracks&amp;user=$userinfo[fieldXX]&amp;chartFriends=1&amp;from=code&amp;widget=chart&amp;resize=1" title="Load this chart in a pop up" target="_blank" style="display:block;overflow:hidden;width:25px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px -20px;text-decoration:none;border:0;" onclick="window.open(this.href + '&amp;resize=0','lfm_popup','height=299,width=234,resizable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>

</div>

</div>
</div>
</if>
<!-- / Last.FM -->

SwollenCranium
06 Apr 2008, 14:04
Your demo link is dead.

rooban12
06 Apr 2008, 19:02
any screenshots?

slo_chewie
30 May 2008, 16:28
Installed. Thanks. I followed MrToasty changes which is nice since I didn't want to worry about template changes.

Roxie
30 May 2008, 23:31
This works wonderfully!

EvilJohn
02 Jun 2008, 22:06
Thank you for this Lizard King. Thank you MrToasty, without your changes for English. I would not have to be able to use this.

gfc
03 Jun 2008, 06:51
any screenshots?


You can see it in my forum:
http://www.parkrocker.net/member.php?u=8601

Nosferatu
25 Jun 2008, 15:21
another edit... wish I could set a default tab and place it in about me?

(check tabs)
http://www.gothicwinter.com/forums/member.php?u=1

I used the english version, created the quilt from last.fm, and replaced the xx with my group.

<!-- / Last.FM -->

<style type="text/css">table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmHead a:hover {background:url(http://cdn.last.fm/widgets/images/en/header/quilt/artist_horizontal_black.png) no-repeat 0 0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmEmbed object {float:left;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmConfig a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px 0 !important;;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmView a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px 0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmPopup a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px 0 !important;}</style>
<table class="lfmWidgetquilt_0a3da65fe760e358172c68950156a498" cellpadding="0" cellspacing="0" border="0" style="width:460px;"><tr class="lfmHead"><td><a title="Top artists" href="http://www.last.fm/user/$userinfo[fieldXX]/charts/" target="_blank" style="display:block;overflow:hidden;height:20px;width:460px;background:url(http://cdn.last.fm/widgets/images/en/header/quilt/artist_horizontal_black.png) no-repeat 0 -20px;text-decoration:none;border:0;"></a></td></tr><tr class="lfmEmbed"><td><object type="application/x-shockwave-flash" data="http://cdn.last.fm/widgets/quilt/13.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="460" height="225" > <param name="movie" value="http://cdn.last.fm/widgets/quilt/13.swf" /> <param name="flashvars" value="type=user&amp;variable=$userinfo[fieldXX]&amp;file=topartists&amp;bgColor=black&amp;theme=black&amp;lang=en&amp;widget_id=quilt_0a3da65fe760e 358172c68950156a498" /> <param name="bgcolor" value="000000" /> <param name="quality" value="high" /> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> </object></td></tr><tr class="lfmFoot"><td style="background:url(http://cdn.last.fm/widgets/images/footer_bg/black.png) repeat-x 0 0;text-align:right;"><table cellspacing="0" cellpadding="0" border="0" style="width:460px;"><tr><td class="lfmConfig"><a href="http://www.last.fm/widgets/?url=user%2F$userinfo[fieldXX]%2Fpersonal&amp;colour=black&amp;quiltType=artist&amp;orient=horizontal&amp;height=large&amp;from=co de&amp;widget=quilt" title="Get your own widget" target="_blank" style="display:block;overflow:hidden;width:85px;height:20px;float:right;background:url( http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px -20px;text-decoration:none;border:0;"></a></td><td class="lfmView" style="width:74px;"><a href="http://www.last.fm/user/$userinfo[fieldXX]/" title="View $userinfo[fieldXX]'s profile" target="_blank" style="display:block;overflow:hidden;width:74px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px -20px;text-decoration:none;border:0;"></a></td><td class="lfmPopup"style="width:25px;"><a href="http://www.last.fm/widgets/popup/?url=user%2F$userinfo[fieldXX]%2Fpersonal&amp;colour=black&amp;quiltType=artist&amp;orient=horizontal&amp;height=large&amp;from=co de&amp;widget=quilt&amp;resize=1" title="Load this quilt in a pop up" target="_blank" style="display:block;overflow:hidden;width:25px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px -20px;text-decoration:none;border:0;" onclick="window.open(this.href + '&amp;resize=0','lfm_popup','height=325,width=510,resizable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>

pete_brady
28 Jun 2008, 22:58
another edit... wish I could set a default tab and place it in about me?

(check tabs)
http://www.gothicwinter.com/forums/member.php?u=1

I used the english version, created the quilt from last.fm, and replaced the xx with my group.

<!-- / Last.FM -->

<style type="text/css">table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmHead a:hover {background:url(http://cdn.last.fm/widgets/images/en/header/quilt/artist_horizontal_black.png) no-repeat 0 0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmEmbed object {float:left;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmConfig a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px 0 !important;;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmView a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px 0 !important;}table.lfmWidgetquilt_0a3da65fe760e358172c68950156a498 tr.lfmFoot td.lfmPopup a:hover {background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px 0 !important;}</style>
<table class="lfmWidgetquilt_0a3da65fe760e358172c68950156a498" cellpadding="0" cellspacing="0" border="0" style="width:460px;"><tr class="lfmHead"><td><a title="Top artists" href="http://www.last.fm/user/$userinfo[fieldXX]/charts/" target="_blank" style="display:block;overflow:hidden;height:20px;width:460px;background:url(http://cdn.last.fm/widgets/images/en/header/quilt/artist_horizontal_black.png) no-repeat 0 -20px;text-decoration:none;border:0;"></a></td></tr><tr class="lfmEmbed"><td><object type="application/x-shockwave-flash" data="http://cdn.last.fm/widgets/quilt/13.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="460" height="225" > <param name="movie" value="http://cdn.last.fm/widgets/quilt/13.swf" /> <param name="flashvars" value="type=user&amp;variable=$userinfo[fieldXX]&amp;file=topartists&amp;bgColor=black&amp;theme=black&amp;lang=en&amp;widget_id=quilt_0a3da65fe760e 358172c68950156a498" /> <param name="bgcolor" value="000000" /> <param name="quality" value="high" /> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> </object></td></tr><tr class="lfmFoot"><td style="background:url(http://cdn.last.fm/widgets/images/footer_bg/black.png) repeat-x 0 0;text-align:right;"><table cellspacing="0" cellpadding="0" border="0" style="width:460px;"><tr><td class="lfmConfig"><a href="http://www.last.fm/widgets/?url=user%2F$userinfo[fieldXX]%2Fpersonal&amp;colour=black&amp;quiltType=artist&amp;orient=horizontal&amp;height=large&amp;from=co de&amp;widget=quilt" title="Get your own widget" target="_blank" style="display:block;overflow:hidden;width:85px;height:20px;float:right;background:url( http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat 0px -20px;text-decoration:none;border:0;"></a></td><td class="lfmView" style="width:74px;"><a href="http://www.last.fm/user/$userinfo[fieldXX]/" title="View $userinfo[fieldXX]'s profile" target="_blank" style="display:block;overflow:hidden;width:74px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -85px -20px;text-decoration:none;border:0;"></a></td><td class="lfmPopup"style="width:25px;"><a href="http://www.last.fm/widgets/popup/?url=user%2F$userinfo[fieldXX]%2Fpersonal&amp;colour=black&amp;quiltType=artist&amp;orient=horizontal&amp;height=large&amp;from=co de&amp;widget=quilt&amp;resize=1" title="Load this quilt in a pop up" target="_blank" style="display:block;overflow:hidden;width:25px;height:20px;background:url(http://cdn.last.fm/widgets/images/en/footer/black.png) no-repeat -159px -20px;text-decoration:none;border:0;" onclick="window.open(this.href + '&amp;resize=0','lfm_popup','height=325,width=510,resizable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>


ermmm how do you make this appear as a tab?

Nosferatu
28 Jun 2008, 23:36
ermmm how do you make this appear as a tab?

instead of


<div id="sidebar_container">
<!-- sidebar -->
$template_hook[profile_right_first]
$blocks[stats_mini]
$template_hook[profile_right_mini]
$blocks[friends_mini]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]
<!-- / sidebar -->
</div>

Further up is:

<div id="profile_tabs">
$template_hook[profile_left_first]
$blocks[visitor_messaging]
$blocks[aboutme]
$blocks[lastfm]
$blocks[stats]
$blocks[friends]
$blocks[infractions]
$blocks[contactinfo]
$template_hook[profile_left_last]
</div>

pete_brady
29 Jun 2008, 00:48
cool thanks

SoFresh
04 Aug 2008, 01:59
how can i get the module in english?

compact123
10 Aug 2008, 19:59
Awesome!

DJ Hutch
17 Aug 2008, 00:49
This was really useful, thanks.

Darksky
03 Sep 2008, 16:41
In case you have Custom Group, user belongin ONLY to this groups will not show the LastFM tabs. I searched a bit and i found this in the "Last.Fm Widget in Profile" plugin of this profile:

if (is_member_of($vbulletin->userinfo,1 , 2 , 3 , 4 , 5 , 6, 7))
{ eval('$blocks[lastfm] = "' . fetch_template('memberinfo_block_lastfm') . '";');}


I fixed the issue, adding the Custom Group Userid to the id list, that i wish can view the LastFM Block/Tab.

I'm not a coder and a vbulletin template guru, if there's another and better solution i will gladly use it.

Juggla
05 Sep 2008, 17:44
Any chance this could be placed in postbit_legacy so it shows underneath the user's post count? Seems possible, right?

zombietom
13 Jan 2010, 17:06
Installed! working very good. I added mine as a Tab..works good.

I have attached the English version of the XML file.
Just Import it and replace the field id .

Also check out my Lastfm link in postbit legacy mod ,It works great with this mod.
http://www.vbulletin.org/forum/showthread.php?t=232965

Brandon Sheley
13 Jan 2010, 17:37
nice mod merty, didn't Mike (http://www.vbulletin.org/forum/member.php?u=283564) make this (http://www.vbulletin.org/forum/showthread.php?t=224506) as well?

FTG LIQUID CL
19 Dec 2012, 11:51
i want this for vb4.1.12