Adding LinkedIn and Facebook badges to user profile

PLEASE NOTE! These snippets are user submitted. It is impossible to check them all, so please use at your own risk! For users who have setup drupal using an alternate database to the default (MYSQL), please note that the snippets may contain some database queries specific to MYSQL.

Description

This php snippet displays custom User Profile URL fields. If the user has not specified any link, it displays nothing.

Dependencies: profile.module

LinkedIn badge

Add the script from the above URL to the user-profile.tpl.php file:

<?php if($account->profile_linkedin):?>
<a href="<?php print $account->profile_linkedin ?>"><img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.gif" width="160" height="33" border="0" alt="View <?php print $user->name ?>'s profile on LinkedIn"></a>
<?php endif ?>

Possible user profile page after adding the script to profile template:
myaccount page with linkedin profile badge

Facebook badge

Add the script from the above URL to user-profile.tpl.php

<?php if($account->profile_facebook):?>
<a href="<?php print $account->profile_facebook ?>" title="<?php print $user->name ?>'s Facebook profile" target=_TOP><img src="http://badge.facebook.com/badge/1465145637.42.1738780586.png" border=0 alt="<?php print $user->name ?>'s Facebook profile"></a>
<?php endif ?>

 
 

Drupal is a registered trademark of Dries Buytaert.