Thread: Profile Enhancements - Last.FM Widget In Profile
View Single Post
  #4  
Old 04-06-2008, 11:42 AM
MrToasty MrToasty is offline
 
Join Date: May 2004
Location: Adelaide AU
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 -->
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01831 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete