PDA

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


Lizard King
04-05-2008, 10:00 PM
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
04-06-2008, 10:26 AM
Thanks Mert, I'll give it a whirl!

Jasem
04-06-2008, 10:51 AM
Thank you very much :)

MrToasty
04-06-2008, 11:42 AM
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_590a5768c2b9458dbbab9df2457e9 051 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetchart_590a5768c2b9458db bab9df2457e9051 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_590a5768c2b9458db bab9df2457e9051 tr.lfmEmbed object {float:center;}table.lfmWidgetchart_590a5768c2b945 8dbbab9df2457e9051 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_590a5768c2b9458d bbab9df2457e9051 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_590a5768c2b9458db bab9df2457e9051 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:18 4px;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_590a5768c2b94 58dbbab9df2457e9051" /> <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=$userinf o[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:20 px;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:20 px;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=$userinf o[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:20 px;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,resi zable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>

</div>

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

SwollenCranium
04-06-2008, 01:04 PM
Your demo link is dead.

rooban12
04-06-2008, 06:02 PM
any screenshots?

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

Roxie
05-30-2008, 10:31 PM
This works wonderfully!

EvilJohn
06-02-2008, 09:06 PM
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
06-03-2008, 05:51 AM
any screenshots?


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

Nosferatu
06-25-2008, 02:21 PM
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_0a3da65fe760e358172c68950156a 498 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetquilt_0a3da65fe760e3581 72c68950156a498 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_0a3da65fe760e3581 72c68950156a498 tr.lfmEmbed object {float:left;}table.lfmWidgetquilt_0a3da65fe760e358 172c68950156a498 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_0a3da65fe760e358 172c68950156a498 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_0a3da65fe760e3581 72c68950156a498 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:46 0px;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_0a3da65fe760e358172c68950156a4 98" /> <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=h orizontal&amp;height=large&amp;from=code&amp;widget=quilt" title="Get your own widget" target="_blank" style="display:block;overflow:hidden;width:85px;height:20 px;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:20 px;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=h orizontal&amp;height=large&amp;from=code&amp;widget=quilt&amp;resi ze=1" title="Load this quilt in a pop up" target="_blank" style="display:block;overflow:hidden;width:25px;height:20 px;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,resi zable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>

pete_brady
06-28-2008, 09:58 PM
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_0a3da65fe760e358172c68950156a 498 td {margin:0 !important;padding:0 !important;border:0 !important;}table.lfmWidgetquilt_0a3da65fe760e3581 72c68950156a498 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_0a3da65fe760e3581 72c68950156a498 tr.lfmEmbed object {float:left;}table.lfmWidgetquilt_0a3da65fe760e358 172c68950156a498 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_0a3da65fe760e358 172c68950156a498 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_0a3da65fe760e3581 72c68950156a498 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:46 0px;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_0a3da65fe760e358172c68950156a4 98" /> <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=h orizontal&amp;height=large&amp;from=code&amp;widget=quilt" title="Get your own widget" target="_blank" style="display:block;overflow:hidden;width:85px;height:20 px;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:20 px;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=h orizontal&amp;height=large&amp;from=code&amp;widget=quilt&amp;resi ze=1" title="Load this quilt in a pop up" target="_blank" style="display:block;overflow:hidden;width:25px;height:20 px;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,resi zable=yes,scrollbars=yes'); return false;"></a></td></tr></table></td></tr></table>


ermmm how do you make this appear as a tab?

Nosferatu
06-28-2008, 10:36 PM
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
06-28-2008, 11:48 PM
cool thanks

SoFresh
08-04-2008, 12:59 AM
how can i get the module in english?

compact123
08-10-2008, 06:59 PM
Awesome!

DJ Hutch
08-16-2008, 11:49 PM
This was really useful, thanks.

Darksky
09-03-2008, 03:41 PM
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
09-05-2008, 04:44 PM
Any chance this could be placed in postbit_legacy so it shows underneath the user's post count? Seems possible, right?

zombietom
01-13-2010, 04:06 PM
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.
https://vborg.vbsupport.ru/showthread.php?t=232965

Brandon Sheley
01-13-2010, 04:37 PM
nice mod merty, didn't Mike (https://vborg.vbsupport.ru/member.php?u=283564) make this (https://vborg.vbsupport.ru/showthread.php?t=224506) as well?

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