Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
UKBL ~ FaceBook profile link on Postbit Details »»
UKBL ~ FaceBook profile link on Postbit
Version: 1.00, by UKBusinessLive UKBusinessLive is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.8.1 Rating:
Released: 03-11-2009 Last Update: Never Installs: 111
Template Edits
Re-useable Code Translations  
No support by the author.

UKBL ~ FaceBook profile link on Postbit ~ Clickable !!


Member on Facebook? Show other members that you have a Facebook presance by adding a facebook Icon to your postbit"

This is a cool hack which will let your members add a facebook Icon to their Postbit template, They need to add their facebook Profile user ID in their user CPfor this to show, If they don't enter one, then the badge don't show



How to install.

Its really easy to do, as always, so if your sitting comfortably, lets begin

Now we need to create a User Custome field, so.....

AdminCP and add a custom field > User Profile fields > Add New User Profile Field

Title = Facebook user ID

Description = Enter the Number ID from your Facebook User Profile

Default Value = Leave empty

Max length of allowed user input = 12

Display Size = 10

Display Order = 10 or 15

Field Required = No as default

Field Editable by User = Yes in case member wants to delete, Later

Private Field = No

Field Searchable on Members List = No

Show on Members List = Yes

Regular Expression = leave empty

Save the field

Once you've saved you can see what the field number is, So lets say its Field11 for example, Remember this as will need it for your Postbit Edits :up:

Thats the first bit done, now Part Two

Go to the template you are using in Styles & Templates/Style Manager, and select Edit templates.

Go to "postbit templates" and select the template you are using, either postbit or postbit_legacy.

Find the following

Code:
<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
Directly above it add

Code:
<if condition="is_member_of($bbuserinfo, 6, 7, 9)">
<if condition="$post['field11']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[field11]&ref=profile">
<img alt="My Facebook" border="0" src="http://www.yourforum.com/images/misc/facebook.png" border="0"/>
</if></if>
replace the RED Field attribute for your own

now when members sign up their facebook badge and enter their profile user ID into the "Enter the Number ID from your Facebook User Profile" section in their UserCP, The Badge will automatically appear in their Postbit

Don't forget to change the usergroup condition with the number of the usergroups that you want to be able to view this

Code:
<if condition="is_member_of($bbuserinfo, 6, 7, 9)">
That means that guests and banned users will not be able to view members facebook profile urls

Members who do not add a user id will not be shown anything.

Next, Upload the facebook icon to your forums/images/misc folder and add the full url to the part in the code which shows the image.

if you are just seeing a red cross on your postbit, then its because your image url is not right

Oh Forgot to say, Badge is fully clickable so members can click directly to facebook


Hope you enjoyed this new hack, and thanks to DobieGillis? for the idea

Please Click Installed and I'll support you 100%

Thanks

Download Now

File Type: zip facebook.zip (110.5 KB, 435 views)

Screenshots

File Type: png facebook1.png (79.1 KB, 0 views)
File Type: png fackbook2.png (35.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 11-16-2010, 07:06 AM
sdfontanini sdfontanini is offline
 
Join Date: Oct 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also noticed the </a> was missing, wasted about 20 min figuring it out. :-) LOL

Here's the code for VB 4

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[field25]&ref=profile">
<img src="http://www.yoursite.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Reply With Quote
  #83  
Old 11-16-2010, 07:12 AM
sdfontanini sdfontanini is offline
 
Join Date: Oct 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here's another modification to the vb 4 version, where i have made the ID code appear on hover

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[field25]&ref=profile">
<img alt="{vb:raw post.field25}" border="0" src="http://www.coloradoevo.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Reply With Quote
  #84  
Old 11-16-2010, 08:03 AM
sdfontanini sdfontanini is offline
 
Join Date: Oct 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Last but not least I fixed all the issues with the coding. this was a real pain, here's the new vb 4 version. it directly links to your friends facebook accounts

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field25}">
<img alt="My Profile" border="1" src="http://www.yourforum.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Reply With Quote
  #85  
Old 11-16-2010, 09:23 AM
sdfontanini sdfontanini is offline
 
Join Date: Oct 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

finally one more, this one opens the links in a new page

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field25}" target="_blank">
<img alt="Facebook Profile" border="1" src="http://www.yoursite.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Reply With Quote
  #86  
Old 11-17-2010, 01:58 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sdfontanini View Post
I also noticed the </a> was missing, wasted about 20 min figuring it out. :-) LOL

Here's the code for VB 4

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[field25]&ref=profile">
<img src="http://www.yoursite.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Quote:
Originally Posted by sdfontanini View Post
here's another modification to the vb 4 version, where i have made the ID code appear on hover

<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[field25]&ref=profile">
<img alt="{vb:raw post.field25}" border="0" src="http://www.coloradoevo.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Quote:
Originally Posted by sdfontanini View Post
Last but not least I fixed all the issues with the coding. this was a real pain, here's the new vb 4 version. it directly links to your friends facebook accounts


<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field25}">
<img alt="My Profile" border="1" src="http://www.yourforum.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Quote:
Originally Posted by sdfontanini View Post
finally one more, this one opens the links in a new page


<vb:if condition="$post['field25']">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field25}" target="_blank">
<img alt="Facebook Profile" border="1" src="http://www.yoursite.com/forums/images/misc/fb.bmp"></a>
</vb:if>
Similar here:
https://vborg.vbsupport.ru/showthread.php?t=233432
... it was already done for 4.x
Reply With Quote
  #87  
Old 11-18-2010, 11:14 PM
MatiasCandy MatiasCandy is offline
 
Join Date: May 2008
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
AdminCP and add a custom field > User Profile fields > Add New User Profile Field
Which "Profile Field Type"

I have 3.8.6 is there special install for that?
Sorry new to adding Badges and such
Reply With Quote
  #88  
Old 09-22-2011, 07:41 PM
bestmilan's Avatar
bestmilan bestmilan is offline
 
Join Date: Oct 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blaize View Post
I worked around the new vanity url issue by creating two custom fields, one for numerical id and one for users with vanity urls.

This is the code I used for the postbit template edits. Change fields XX & YY to whatever your custom fields are.

Code:
<if condition="is_member_of($bbuserinfo, 2, 5, 6, 7)">
<if condition="$post['fieldXX']">
<a href="http://www.facebook.com/home.php/#/profile.php?id=$post[fieldXX]&ref=profile">
<img alt="My Facebook" border="0" src="http://yourforums.com/forums/images/misc/facebook.png" border="0"/>
</if></if>

<if condition="is_member_of($bbuserinfo, 2, 5, 6, 7)">
<if condition="$post['fieldYY']">
<a href="http://www.facebook.com/$post[fieldYY]?ref=profile">
<img alt="My Facebook" border="0" src="http://yourforums.com/forums/images/misc/facebook.png" border="0"/>
</if></if>
Use at your own risk.

The first is for the numerical id & the second is used if the facebook profile uses a vanity url.

This was very helpful, thank you blaize
Reply With Quote
  #89  
Old 09-23-2011, 05:11 AM
bestmilan's Avatar
bestmilan bestmilan is offline
 
Join Date: Oct 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BTW, I cut off "&ref=profile" from the code above to validate the code.

It seems to be working fine in the latest versions of all major browsers.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:29 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04824 seconds
  • Memory Usage 2,333KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (3)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete