PDA

View Full Version : Profile Enhancements - Add Your LinkedIn Account To Your postbit/postbit_legacy


metalguy639
21 Jun 2009, 04:24
THIS TEMPLATE EDIT BROUGHT TO YOU BY:

https://www.vbulletin.org/forum/
www.skinsnstyles.com (http://www.skinsnstyles.com)

CLICK INSTALLED TO GET SUPPORT FOR THIS ADD-ON. IF YOU DO NOT CLICK INSTALLED I CANNOT HELP YOU.

This mod is based on the Twitter Profile Link (http://www.vbulletin.org/forum/showthread.php?t=212221&highlight=twitter) mod. With the exception that this is for a different social networking type of web page following.

If you have members who have LinkedIn accounts and you want to be able to add their LinkedIn accounts to their postbit or the postbit_legacy, you can use this little mod to do so. It's been tested in 3.8.1 so far, but I'm pretty sure that it would work with most recent copies of vbulletin 3.6X and up.

YOU MUST CLICK INSTALL TO GET ANY SUPPORT FROM ME, THOSE WHO DO NOT CLICK INSTALL WILL BE IGNORED WHEN ASKING FOR HELP.

Step 1:

To set up your profile field for this mod you must first make/create a new profile field.

1. Login to your admincp as admin
2. Scroll down in your left side menu until you find "User Profile Fields"
3. Click on "Add New User Profile Field"
4. For Profile Field Type choose "Single-Line Text Box"
5. Put the following into your new profile field.

Title: LinkedIn Account
Description: Place your LinkedIn Profile URL = Only post the last part of the URL with the name or words you choose to use for your custom URL. If you have not set your custom URL, then do so first in your Profile on LinkedIn.
Max length of allowed user input: 20
Field Length 25
Field Required - no
Field Editable by User - yes
Private Field - no


6. Click "Save"

Keep in mind the field ID number.

Step 2:

Now you will need to edit your postbit or your postbit_legacy whichever one you are currently using on your forum.

1. Scroll to "Styles & Templates" click on "Style Manager"
2. Find the skin that you want to make the changes to on the right and click the drop down box next to it choosing "Edit Templates"
3. In The "Controls" box to the right click the button to the left of the words "All Template Groups" to expand the templates.
4. Scroll down and find the postbit or postbit_legacy template and double click on it to open it. (Again this is which ever one you use on your site)
5. Now FIND:

$post[skypeicon]

6. AFTER ADD:

<if condition="$post['field15']">
<a href="http://www.linkedin.com/in/$post[field15]" target="_blank">
<img alt="LinkedIn" border="0" src="http://www.yoursite.com/images/linkedin.gif" border="0"/>
</if>

You must change The field ID number to match yours, they are in red. You must also change the image link to match where you uploaded your image.

7. Click "save"

Now go to your UserCP and edit your profile. Click on the "Edit Profile" link and scroll down until you find this in your profile add your Custom URL ending in the box and click save.

Hack Limitations:

1. You MUST use only your Custom URL word(s) that you added to your profile. If you do not this hack will not work.

To set up your custom URL in LinkedIn:

1. Login to your LinkedIn account.
2. Look to the far right at the top you should see a link called "Edit Public Profile Settings" click it.
3. Now at the top you will have a box called "Your Public Profile URL" click the edit link and put what you want your custom URL to be in the blank space.
4. Click the "Set Address" button.

Use the LinkedIn button that I modified here: https://www.vbulletin.org/forum/external/2011/05/3.gif

Just right click and choose "Save as"

Screenshot can be seen below...

Yenimuhendis
21 Jun 2009, 11:13
nice work thnx.

İnstalled

metalguy639
21 Jun 2009, 11:27
nice work thnx.

İnstalled

Your welcome.

MacHack
21 Jun 2009, 13:45
Works great, thanks!

metalguy639
22 Jun 2009, 00:22
Works great, thanks!

No prob

cmmguy
18 Jul 2009, 04:44
Works great, thanks. I also tried to add it to the Contact Info tab in the Public User Profile but it seems the variable does not have context in that page. Oh well... still works fine in the postbit.

metalguy639
18 Jul 2009, 06:41
Works great, thanks. I also tried to add it to the Contact Info tab in the Public User Profile but it seems the variable does not have context in that page. Oh well... still works fine in the postbit.

Not sure. I tried several things myself and they did not work. If I find a way for it to be put there I'll post back.

EagleNick
18 Jul 2009, 14:57
Works great, thanks. I also tried to add it to the Contact Info tab in the Public User Profile but it seems the variable does not have context in that page. Oh well... still works fine in the postbit.Because the post variable is only available in posts. Instead of using $post['field15'], you need to use $userinfo['field15']. ;)

cmmguy
18 Jul 2009, 16:28
Because the post variable is only available in posts. Instead of using $post['field15'], you need to use $userinfo['field15']. ;)

Oh boy... I feel dumb when the answer is so simple.

Thank you for the help.

cmmguy
18 Jul 2009, 16:30
Not sure. I tried several things myself and they did not work. If I find a way for it to be put there I'll post back.

Thanks to EagleNick it is figured out, but I have another question.

Why cant you use the entire path of the LinkedIn Account instead of requiring the user to create a custom linkin public name? Is there a technical reason for not allowing the full path?

metalguy639
18 Jul 2009, 18:26
Thanks to EagleNick it is figured out, but I have another question.

Why cant you use the entire path of the LinkedIn Account instead of requiring the user to create a custom linkin public name? Is there a technical reason for not allowing the full path?

The reason I set it up that way was because it was the only way that the linkedin account would allow a direct link to a person's account. They have it set up where you HAVE to set the account up in that way or else it does not work. :(

metalguy639
18 Jul 2009, 18:26
Because the post variable is only available in posts. Instead of using $post['field15'], you need to use $userinfo['field15']. ;)

Thanks Nick :D

cmmguy
18 Jul 2009, 20:56
The reason I set it up that way was because it was the only way that the linkedin account would allow a direct link to a person's account. They have it set up where you HAVE to set the account up in that way or else it does not work. :(

After a day, I found that the instructions(mine, not yours) confused my users. So I changed your code a little to allow a complete URL in the profile and then added better directions.



<a href="$post[field16]" target="_blank">
<img alt="LinkedIn" border="0" src="/forum/images/misc/linkedin.gif" border="0"/>



This seems to work fine and doesnt require the user to setup the custom profile name.

metalguy639
19 Jul 2009, 05:35
no prob, if it works for you. :)

cbiweb
20 Jul 2012, 23:05
Some members have used the LinkedIn profile to insert spammy links to other sites. Is there a way to ensure that members can add links to only a LinkedIn profile in that field?

metalguy639
23 Jul 2012, 19:18
Some members have used the LinkedIn profile to insert spammy links to other sites. Is there a way to ensure that members can add links to only a LinkedIn profile in that field?

No I'm afraid not. There maybe a way but its beyond my scope of coding. If its possible it would have to be a php fix or a plugin.

cbiweb
23 Jul 2012, 20:34
Okay then, thanks for the reply. :)

metalguy639
24 Jul 2012, 01:59
No prob.