Add a linkedin field to vbulletin user profile

A few days ago i added a new option to the user profiles in a vbulletin forum ( http://www.seo-romania.com/forum ). This option let the users have on their postbit a link to their http://linkedin.com profile.

See the link to the linkedin profile below the user info in the following image or go directly to the forums http://www.seo-romania.com/forum/showthread.php?t=304 .

It's simple to achieve this, just follow the next steps:

1. Go to admincp -> User Profile Fields -> Add New User Profile Field
Select a "Single-Line Text Box" from the dropdown menu, press continue and in the next page just enter something on the "Title" field.
Save. After you are done with this, write somewhere the field id (field6 in my case)

Mine looks something like this.

and on the user profile page looks like this (i've added a "how to use" for users):

2. Go to this link http://www.linkedin.com/profile?promoteProfile=&trk=mypro_badges (you must be logged in tho see the page), select a button you like and copy the code from the right side.

Go back to you vbulletin admin panel -> Styles & Templates -> Styles & Templates and select "Edit Templates" on the theme you like to have this feature on. From the style templates list, double click on "Postbit Templates".
On this part you must open "postbit" or "postbit_legacy" (depends on what your template use). Mine uses "postbit", so i opened "postbit".

Get the linkedin button code that you choose and paste it in the postbit somewhere where you want the button to appear.

I choosed this button View Mihai Chiriac's profile on LinkedIn so the code that i will paste inside postbit will be:

<a href="http://www.linkedin.com/in/necropsique" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Mihai Chiriac's profile on LinkedIn"></a>

After you paste the code, modify the alt of the image from the code (alt="View Mihai Chiriac's profile on LinkedIn") and make it something like alt="User profile on LinkedIn".

Next, on the link part from the code, remove the username from the link ("necropsique" from my code) and add the id of the field you've made on step 1 (my field id is field6). Now my code looks like this:

<a href="http://www.linkedin.com/in/$post[field6]" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="User profile on LinkedIn"></a>

*Note the $post[field6] in the url.

Now, we have to put a condition, so that the buton will not show for users that don't fill this field on their profile page. Add the code above inside this:

<if condition="$post['field6']">
</if>

so the final code will now look like this:

<if condition="$post['field6']">
<a href="http://www.linkedin.com/in/$post[field6]" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="User profile on LinkedIn"></a>
</if>

So the short story is that the user must go to his/her user profile and put inside the new linkedin field his/her id from his/her profile url (example: my linkedin profile link is http://www.linkedin.com/in/necropsique so i will add inside the box only necropsique.) See the image below:

The users that does not fill this field will not have a linked buton show on their postbit area.

That's it.

P.S.: You can add me to your connections if you want View Mihai Chiriac's profile on LinkedIn :)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.