Quick Last.fm/audoscrobbler latest tracks pack.
This modification is in the archives.
Following on from my quick hack to the member profiles, I have tested this setup out for quite a few months and I am very happy with the results.
The most recent add-on to the pack, I have tested for a few days and is pretty simple in terms of what it does. Many special thanks to Skedoozy for his idea on the AIM icons add on, which is included here. What it is! This is basically a template mod to the posbit templates to add any latest songs/tracks a user has played beside their avatar/name. Install time? ~5 minutes max for each feature. ~15 max for the whole package. Add-on 1- Latest tracks in member profile. As per this hack: Quick Last.fm addon to member profile If you have already installed this, you can proceed to install the next feature. (Add-on 2) Create new user profile field in User Profile Fields> Add new user profile field. Edit the following: Title= Last.fm recent tracks Description= Your Last.fm username Default Value= (leave blank) Max length of allowed user input=100 Field Length=25 Profile Field Type= Single-Line Text Box Display Order=99 (this is to make sure the last.fm field is last on the list) Field Required= No Field Editable by User= Yes Private Field=No Field Searchable on Members List= No Show on Members List= No Regular Expression= (blank) Which page displays this option?= Edit Profile. Once this is done, make sure to remember the field number, in my case it was 'field10'. In your case change it to whatever field number that you have. In Styles & Templates> Style Manager. Go to your chosen style and find MEMBERINFO under 'Member Info Templates' After: Code:
</tr> </if> $customfields </table> Code:
<if condition="$post['field10']"><div><a href="http://www.last.fm/user/$post[field10]/?chartstyle=basicrt10"><img src="http://imagegen.last.fm/basicrt10/recenttracks/$post[field10].gif" border="0" alt="$post[field10]'s Profile Page" /></a></div></if> http://www.htireland.com/member.php?u=2 If you want a different style or want to have top albums, top tracks etc, all you need to do is go to your last.fm tools section and select charts. Copy the code for websites and just replace the username with $post[fieldX]. Please also note the "basicrt10" in the http address for both chartstyle and /recenttracks. You can change this to any of the following in the codes here: http://www.last.fm/tools/charts/ If you have any querys, post them here if you like or PM me. Add-on 2 - Tracks in Postbit Note: If you have your forum on postbit_legacy please scroll to Add- on 2.1 after you read how to add a profile field below. Having created the user input field in add-on 1, we can now use them to also show the details on the postbit. However you must first create the option for if the user wants to display their tracks beside their username/avatar. Create new user profile field in User Profile Fields> Add new user profile field. Single selection radio buttons. Edit the following: Title= Show Last.fm track with posts? Description= Click YES to show your last played track where you post. Items per line= (leave at zero) Options= YES on first line, NO on second line. Set default= select 'no' Display order= 98 Field Required= No Field Editable by User= Yes Private Field=No Field Searchable on Members List= No Show on Members List= No Allow user to input their own value for this option=no Max length of allowed user input=100 Field length= 25 Regular Expression= (blank) Which page displays this option?= Options:Other Once that's done go to Styles & Templates> Style Manager. Your style>>>Postbit templates>>>>>postbit Find Code:
<div id="postmenu_$post[postid]"> <if condition="$show['profile']"> <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a> $post[onlinestatus] <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script> <else /> $post[musername] </if> </div> <if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if> Code:
<if condition="$post[field10]"> <if condition="$bbuserinfo[field11] != 'NO'"><a href="http://www.last.fm/user/$post[field10]/?chartstyle=basicrt10"><img src="http://imagegen.last.fm/basicrt10/recenttracks/1/$post[field10].gif" border="0" /></a></if></if> Remember that [field11] will be whatever your profile field turns out to be. ie: 9, 10 etc. The same also applies to the existing [field10] for the last.fm users name. You can see a live example http://www.htireland.com/cablesatelliteterrestrial/t-sky-hd-preview-481.html. Please not that I am using my own design to show latest tracks under the name "sparkysimple", you can change "basicrt10" to it if you rather that look. Add-on 2.1 - Tracks in Postbit_legacy As the image is generally too big to use in postbit_legacy, I have choosen to have it added beneath the signatures, you can tinker around with this and post your results if you can do better. Please follow the step above to add a user field.... After the above is done.... In Styles & Templates> Style Manager. Your style>>>Postbit templates>>>>>postbit_legacy Find Code:
<if condition="$show['postedited']"> <!-- edit note --> <div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" /> <em> <phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>. <if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if> </em> </div> <!-- / edit note --> </if> Code:
<if condition="$post[field10]"> <if condition="$bbuserinfo[field11] != 'NO'">$post[field10]'s latest tracks -<a href="http://www.last.fm/user/$post[field10]/?chartstyle=sparkysimple"><img src="http://imagegen.last.fm/sparkysimple/recenttracks/1/$post[field10].gif" border="0" /></a></if></if> Add-on 3- Last.fm AIM icon linking to your profile Special thanks to Skedoozy for this idea. Again you will need to create another user option field in the same fashion as above but rename as appropiate. Find in postbit or postbit_legacy, whichever your forum is running on: Code:
$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon] Code:
<if condition="$bbuserinfo[field12] != 'NO'"><if condition="$post['fieldX']"><a href="http://www.last.fm/user/$post[fieldX]"><img src="/images/lastfm.gif" border="0" alt="$post[fieldX]'s Profile Page" /></a></if> The last.fm icon is available below to save to your images directory. (rightclick- save as) After all this is done, inform your users and watch tracks appear. I will offer of what I know and my knoweledge as support to help anyone with and problems they may encounter. Happy installing and remember to hit the install button. Download No files for download. Screenshots |
Similar Mods
[Release] Quick Reply Expantion Pack | vBulletin 2.x Template Modifications |