PDA

View Full Version : Mini Mods - Link to your LastFM Profile in Postbit Legacy


zombietom
01-12-2010, 10:00 PM
I have a gaming website and with xbox 360 adding LastFm as a feature I figured it'd be nice to let my users link to their LastFM Profiles.
So I created this code.
This should work on any version of VB (maybe not 4.0)

Create a new profile Field (remember the field id number)
Directions:
1. In adminCP go to user profile fields
2. Click on add new profile field
3. add The following
Title - LastFM
Description -Add in your LastFM user name to create a link to your LastFM profile.
Default Value -leave blank
Max length of allowed user input - set to at least 15 or whatever you want
Field Length- Set to at least 15 or whatever you want
Profile Field Type -Single-Line Text Box
Field Required - yes or no ..up to you..i set mine to no
Field Editable by User - YES
Private Field - NO
Field Searchable on Members List - Yes or No ..up to you
Show on Members List -yes or no ..up to you
Regular Expression - Left mine blank
Which page displays this option - select "edit your details" from the menu
Finish - Click save and remember you fieldID number

Adding the following Code in your postbit legacy.

How to get to your postbit legacy:
Go to your forum's admin panel >Style & Templates>Style manager>pick Your style and click the expand button on the right>highlight postbit templets and click the expand/collapse button> select postbit legacy and click the edit button> ....

Look for this code:

look for(about in the middle):

<if condition="$post[icqicon] OR $post[aimicon] OR $post[msnicon] OR $post[yahooicon] OR $post[skypeicon]"><div class="postbit_icons">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]


Add this Code at the end after [skypeicon] and before </div>


<if condition="$post[fieldXX]"><a target="_blank" href="http://www.last.fm/user/$post[fieldXX]"><img src="http://www.yoursite/images/misc/LastFm2.png" alt="My LastFM Profile" border="0"></a>
</if>

click save. Done.

Be sure to change the XX in the above code to you Field Id number that you just created. Then go to your forum usercp panel and click on edit Details, add in your LastFM profile name, click save. Done.

You can add this code about anywhere you want the LastFm link to show up.



I have included 2 different images for the icon, feel free to adjust the size to whatever you need, just make sure the image link is linking to whever images your using .

Click Installed.

This code is Reusable as long as you give me credit for it.

Thanks
Zombietom

VNVIP
01-18-2010, 10:45 AM
Works on VB 4.0.x to

<vb:if condition="$post{?fieldXX?}"><a target="_blank" href="http://www.last.fm/user/{vb:raw post.fieldXX}"><img src="http://www.yoursite/images/misc/LastFm2.png" alt="My LastFM Profile" border="0"></a>
</vb:if>

zombietom
01-18-2010, 04:29 PM
Great ! Thanks for posting..Please click installed