vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Profile Enhancements - Last.FM Widget In Profile (https://vborg.vbsupport.ru/showthread.php?t=175293)

Lizard King 04-05-2008 10:00 PM

Last.FM Widget In Profile
 
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
HTML Code:

        $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

HTML Code:

        $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

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:-

Code:

$blocks[lastfm]
with

Code:

$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:-
Code:

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

Quote:

Originally Posted by rooban12 (Post 1484556)
any screenshots?


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


All times are GMT. The time now is 03:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01009 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete