vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - UKBL ~ FaceBook profile link in Postbit ~ Clickable !! (https://vborg.vbsupport.ru/showthread.php?t=233432)

TheLastSuperman 01-17-2010 10:00 PM

UKBL ~ FaceBook profile link in Postbit ~ Clickable !!
 
1 Attachment(s)
This is a super simple template edit that will allow your members to share their Facebook Profile with others ;).

You simply create a new user profile field and make one template edit and then your members do the rest and your all set!

Full Credit for this mod goes to UKBL, requested by taffy056 for use with vBulletin 4.0 Series here:

https://vborg.vbsupport.ru/showthread.php?p=1929367

And via PM to me :p

I did not realize UKBL had stated "Re-Usable" Code or I would have released this sooner However again I must make it clear that full credit goes to UKBL and per his thread the idea was presented to him by DobieGillis.

You can add your own links to postbit by following this same method just redoing the code snippets a bit so in essence you can have Facebook, Twitter, Myspace, LinkedIn and many more just by playing with the code a bit :D.

Screenshots are in UKBL's original thread and I just tested and verified this to be working on a 4.0.1 forum however it should be perfectly usable on any 4.0.x series. Please refer to the Install.txt file in the .zip for instructions on how to add this to your forum :D and Enjoy!

Sincerely,

TheLastSuperman


TheLastSuperman 01-18-2010 03:05 PM

Quick tips!

1. How 2 Guide - Template Conditionals

A Conditional If Statement simply put will show something to a user based on IF this or IF that SHOW them THIS. Very simple to follow once you initially grasp it so don't let it trick or fool you ;)

Here's an Example:

Code:

<vb:if condition="$show['member']">

This conditional seen above starting with vb:if will only show the code in between the beginning and the end vb:if it is ended by the slash seen below /

</vb:if>

Now if you test this in 4.0 you will only see this code when logged in as a member ;). How do I put this code somewhere and utilize it like UKBL first mentioned? Well you can edit your forums templates... vBulletin uses a .php file with code in it, a template with the code in it that corresponds to the php file and css in your style vars area to show you every single page in your vBulletin so basically all three (and some other minor things no need to confuse you early on eh?) make the page display and you the forums owner can make it do your bidding!!

You can edit your styles templates by going to AdminCP > Style & Templates > Style Manager

Now I would create a Child Style to test with so you don't mess up your Live sites style...

AdminCP > Style & Templates > Style Manager > Select the style and to the right click the drop down and select "Add Child Style" and leave it all alone except change "Allow User Selection" to NO this way you can tinker with it behind the scenes ;).

Then You'll see the new style and click the drop down on the right and choose "Edit Templates" now go down and double click "Header" then at the very top type in TESTING 123 hit save & reload then select the style since you can as an admin and in that style at the very top you'll now see TESTING123 in plain old text :D.

You just edited your first template... now yes your right... you can do that but with all sorts of codes just be careful as some can make the style go :p on you so it will require a slight learning curve... and conditionals?

Code:

<vb:if condition="$show['guest']">
TESTING 123
</vb:if>

Put that in the Header Template instead...

Now refresh your page (your still logged in as an admin) and now it's gone, it is only showing to visitors or Guests of the forum i.e. non-logged in users :D.

Edit: Look what I just found :D https://vborg.vbsupport.ru/showthread.php?t=231525 and special Thanks to BBR-APBT for taking the time to post it up ;)



2. How 2 Guide - Use Facebook ID# OR Name

Revised Code by Steve to show using Facebook ID number and "Vanity" profile name i.e. if you have already selected your custom Facebook URL i.e. mine is no longer a number it is thelastsuperman :D.

Quote:

Originally Posted by abqtj

I got it to work using your code, and also tweaked it using code in the link you gave to the 3.8 version.

If you want an update, here's what I'm using:

PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3,4,5,6,7,9,11,12)">
<
vb:if condition="$post['field6']">
<
a href="http://www.facebook.com/home.php/#/profile.php?id={vb:raw post.field6}&ref=profile">
<
img src="images/misc/facebook.png" alt="My Facebook" style="border-style: none" target="_blank"/></a>
</
vb:if>
</
vb:if>

<
vb:if condition="is_member_of($bbuserinfo, 1,2,3,4,5,6,7,9,11,12)">
<
vb:if condition="$post['field7']">
<
a href="http://www.facebook.com/?ref=home#/{vb:raw post.field7}?ref=profile">
<
img src="images/misc/facebook.png" alt="My Facebook" style="border-style: none" target="_blank"/></a>
</
vb:if>
</
vb:if> 


The second set, with field 7 in it, uses the vanity name instead of the user id.

Thanks again for this mod!!

-Steve

*Full Credit to UKBL so from here on out I need to see THANKS UKBL in your posts if you enjoy it :D

abqtj 01-18-2010 05:02 PM

Installed and still tweaking it to get it to work...should be good, though!

TheLastSuperman 01-18-2010 05:31 PM

Quote:

Originally Posted by abqtj (Post 1959354)
Installed and still tweaking it to get it to work...should be good, though!

I tested just before I put up the mod on here so it should work fine "Out of the box" otherwise post and we'll get you sorted ;).

Mike

TimberFloorAu 01-18-2010 05:47 PM

Cheers Mike.

How is Gerry havent seen him in ages?

Fusion2 01-18-2010 05:49 PM

I like the idea, but could you be a little more explainable in your text file for us beginners!

It says add template conditional. Umm where do i add this?

Also How do I add the box around the section, as seen in the original posts on the profile page. Mine just shows all the text scrunched together with no enclosed box.

abqtj 01-18-2010 06:02 PM

Quote:

Originally Posted by TheLastSuperman (Post 1959375)
I tested just before I put up the mod on here so it should work fine "Out of the box" otherwise post and we'll get you sorted ;).

Mike

THanks,

I think I got it.

I edited the postbit_legacy, not postbit. Went back and edited postbit and it shows up fine.

I do not know what the difference is in those two spots, I suppose.

kersti 01-18-2010 06:11 PM

I'm also asking how do I add the conditional??? Could someone please explain it to us noobs?

kersti 01-18-2010 06:56 PM

I went back to the 3.8 version to work out how to do this.

TheLastSuperman 01-18-2010 07:17 PM

Quote:

Originally Posted by TimberFloorAu (Post 1959385)
Cheers Mike.

How is Gerry havent seen him in ages?

I hope he is doing very well I have not heard from him but do know something came up in real life and I would like to wait for him to come back and let everyone know. I only released this because a few requested and UKBL makred it as re-usable code but I don't care about installs only helping when I have spare time to however when he returns I get to bug Paul M to change the threads owner to UKBL lol :p

Quote:

Originally Posted by Fusion2 (Post 1959387)
I like the idea, but could you be a little more explainable in your text file for us beginners!

It says add template conditional. Umm where do i add this?

Also How do I add the box around the section, as seen in the original posts on the profile page. Mine just shows all the text scrunched together with no enclosed box.

See Post #2 and post again if anymore questions :D

Quote:

Originally Posted by abqtj (Post 1959397)
THanks,

I think I got it.

I edited the postbit_legacy, not postbit. Went back and edited postbit and it shows up fine.

I do not know what the difference is in those two spots, I suppose.

You can specify in your AdminCP > Settings > Options > Style & Language Options > Now scroll down and look for:

PHP Code:

Use Legacy (VerticalPostbit Template

If you prefer the old-style postbitusing two vertical columns rather than the new horizontal layoutyou can switch back to using that template with this switch.

Please note that if you enable this option and wish to customize the templateyou should edit the 'postbit_legacy' template rather than the 'postbit'

Quote:

Originally Posted by kersti (Post 1959406)
I'm also asking how do I add the conditional??? Could someone please explain it to us noobs?

Please see post #2 ;)

Anything else feel free to post :D

Sincerely,

Mike

taffy056 01-18-2010 10:45 PM

cheers mate very much appreciate you porting this for me, and others now , it works fine for me :)

TheLastSuperman 01-18-2010 11:35 PM

Quote:

Originally Posted by taffy056 (Post 1959719)
cheers mate very much appreciate you porting this for me, and others now , it works fine for me :)

No problem taffy056 ;)

Mike

abqtj 01-19-2010 01:31 AM

Thanks UKBL for the original mod!

Rob F 01-24-2010 03:33 AM

Have installed this and working lovely (after a little tweaking to fit my forum layout).

Is there any way to have the facebook icon show up when viewing the who's online listing like you can with the msn/icq/etc icons?

TheLastSuperman 01-25-2010 07:28 AM

Quote:

Originally Posted by Rob F (Post 1964929)
Have installed this and working lovely (after a little tweaking to fit my forum layout).

Is there any way to have the facebook icon show up when viewing the who's online listing like you can with the msn/icq/etc icons?

Great idea, give me a bit I'm terribly busy atm (note the 4:27am my time that this is posted :p) and you have one other member with a signature generator mod in front of you that was asked as a favor so when I have free time first comes first served but bare with me and I'll whip something up and again, great idea :D.

Mike

nci 01-25-2010 10:38 AM

Thanks Mike .
Installed and Working fine.

TheLastSuperman 01-26-2010 12:22 AM

Quote:

Originally Posted by nci (Post 1966035)
Thanks Mike .
Installed and Working fine.

I appreciate the sentiment I truly do but all credit goes to UKBL i.e. Gerry ;)

Rob F 01-26-2010 11:05 AM

Quote:

Originally Posted by TheLastSuperman (Post 1965951)
Great idea, give me a bit I'm terribly busy atm (note the 4:27am my time that this is posted :p) and you have one other member with a signature generator mod in front of you that was asked as a favor so when I have free time first comes first served but bare with me and I'll whip something up and again, great idea :D.

By all means, take your time. I'm in no panic about it, just thought it might enhance the mod that little bit further ;)

Look forward to an update :)

cloferba 01-30-2010 11:59 AM

how can add this information to a tab on user profile?

it will be great to add this widget:
http://www.facebook.com/facebook-wid...filebadges.php
https://vborg.vbsupport.ru/external/2010/01/10.jpg

to the posbit legacy..or a tab on user profile...
only show it writing the facebook user id..

worried 04-03-2010 09:44 AM

Thanks!

I couldn't get facebook to open in a new window until I move the target_blank here:

Code:

<a href="http://www.facebook.com/home.php/#/profile.php?id={vb:raw post.field99}&ref=profile" target="_blank">

SLY LS1 04-03-2010 11:40 AM

Quote:

Originally Posted by worried (Post 2015064)
Thanks!

I couldn't get facebook to open in a new window until I move the target_blank here:

Code:

<a href="http://www.facebook.com/home.php/#/profile.php?id={vb:raw post.field99}&ref=profile" target="_blank">

Yes that is correct,

This is a very simple mod but has been made very hard by the way the instruction have been written, they need to be writtin in the standard mod form.


Heres some more if anyone wants them, Facebook - Twitter - Youtube - My Space - Car Domain

Just add a new profile field as per this mod for each one, then change the profile fields XX below to match, save the images at the bottom of this post to your forum/images/misc folder - anyone who has done the mod above will get the drift

Code:

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,10)">
<vb:if condition="$post['fieldXX']">
<a href="http://www.facebook.com/home.php/#/profile.php?id={vb:raw post.fieldXX}&ref=profile" target="_blank"/>
<img src="images/misc/facebook.png" alt="My Facebook" style="border-style: none" ></a>
</vb:if>
</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,10)">
<vb:if condition="$post['fieldXX']">
<a href="http://twitter.com/{vb:raw post.fieldXX}" target="_blank"/>
<img src="images/misc/twitter.png" alt="My Twitter" style="border-style: none" ></a>
</vb:if>
</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,10)">
<vb:if condition="$post['fieldXX']">
<a href="http://www.youtube.com/{vb:raw post.fieldXX}" target="_blank"/>
<img src="images/misc/youtube.gif" alt="My Youtube" style="border-style: none" ></a>
</vb:if>
</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,10)">
<vb:if condition="$post['fieldXX']">
<a href="http://www.myspace.com/{vb:raw post.fieldXX}" target="_blank"/>
<img src="images/misc/myspace.gif" alt="My Space" style="border-style: none" ></a>
</vb:if>
</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,10)">
<vb:if condition="$post['fieldXX']">
<a href="http://www.cardomain.com/ride/{vb:raw post.fieldXX}" target="_blank"/>
<img src="images/misc/cardomain.gif" alt="My Car Domain" style="border-style: none" ></a>
</vb:if>
</vb:if>

http://www.lsxshootout.com.au/forum/...c/facebook.png
http://www.lsxshootout.com.au/forum/...sc/twitter.png
http://www.lsxshootout.com.au/forum/...sc/youtube.gif
http://www.toughstreetcars.com/forum...im_myspace.gif
http://www.toughstreetcars.com/forum..._cardomain.gif

ARPRDcom 04-16-2010 08:31 PM

I added works great ... I had to do some tweaking though to meet the style I wanted.. I added Facebook, Twitter, YouTube, FriendFeed, and ArticleProductions (my own site has user profiles).

James

taffy056 10-02-2010 10:07 AM

This is still working great thanks ;)

But got a question about the code abqtj posted that is in post 2, I would like to force my users to place their facebook id, so that means that if they supply it in one field they don't need it in the other, but the fields don't appear to work in that way, is there some way to do this ?

Thanks

TheLastSuperman 10-07-2010 02:55 AM

Quote:

Originally Posted by taffy056 (Post 2105835)
This is still working great thanks ;)

But got a question about the code abqtj posted that is in post 2, I would like to force my users to place their facebook id, so that means that if they supply it in one field they don't need it in the other, but the fields don't appear to work in that way, is there some way to do this ?

Thanks

That is an example of both versions he came up with ;)

So use the top or bottom half only, the bottom will display the vanity name if you wish.

Jaske 01-16-2011 05:31 PM

I installed this mod and it does work, but it isn't inline with the yahoo and aol icons...
https://vborg.vbsupport.ru/external/2011/01/26.jpg
any idea on how to fix it? thanks.

*EDIT-nevermind I placed the code after the </div> and that was messing it up...it's fixed now. thanks.

hiker 01-17-2011 04:14 PM

1 Attachment(s)
Great Mod, but I'm having alignment problems as well.

One profile it shows up exactly where I want it (Sombeech)

but on another (and there have been a few others) it shows up right next to the avatar.

The one difference is the "BigShot" badge under the avatar. How can I make the fb image appear under all of that, and next to where the others would be, say Yahoo IM?

I've got a shot of my settings, and the edit to my postbit_legacy template. I'd love to get this fixed.

Thanks.

TheLastSuperman 01-17-2011 04:23 PM

Quote:

Originally Posted by bogley (Post 2150529)
Great Mod, but I'm having alignment problems as well.

One profile it shows up exactly where I want it (Sombeech)

but on another (and there have been a few others) it shows up right next to the avatar.

The one difference is the "BigShot" badge under the avatar. How can I make the fb image appear under all of that, and next to where the others would be, say Yahoo IM?

I've got a shot of my settings, and the edit to my postbit_legacy template. I'd love to get this fixed.

Thanks.

Take all the highlighted code from that last attachment, everything except the last </vb:if> and paste it above that </div> and right after the skypeicon} add one little space and paste, that should sort it ;).

hiker 01-17-2011 04:34 PM

1 Attachment(s)
Quote:

Originally Posted by TheLastSuperman (Post 2150533)
Take all the highlighted code from that last attachment, everything except the last </vb:if> and paste it above that </div> and right after the skypeicon} add one little space and paste, that should sort it ;).


YES!

Awesome, thanks. That did it. :cool::cool::cool:

PiroX 03-06-2011 12:23 PM

i modified it a bit so that you also can enter your facebook username

Code:

<vb:if condition="$post['field27']">
<vb:if condition="is_numeric($post['field27'])">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field27}" target="_blank">
<vb:else />
<a href="http://www.facebook.com/{vb:raw post.field27}" target="_blank">
</vb:if>
<img width="18" height="17" alt="Fb" title="Facebook profile" border="0" src="http://www.yoursite.com/forum/images/misc/facebook.png" /></a>
</vb:if>

it works now with "Username" like www.facebook/test

zeus_r6 03-07-2011 01:06 AM

Quote:

Originally Posted by PiroX (Post 2170130)
i modified it a bit so that you also can enter your facebook username

Code:

<vb:if condition="$post['field27']">
<vb:if condition="is_numeric($post['field27'])">
<a href="http://www.facebook.com/profile.php?id={vb:raw post.field27}" target="_blank">
<vb:else />
<a href="http://www.facebook.com/{vb:raw post.field27}" target="_blank">
</vb:if>
<img width="18" height="17" alt="Fb" title="Facebook profile" border="0" src="http://www.yoursite.com/forum/images/misc/facebook.png" /></a>
</vb:if>

it works now with "Username" like www.facebook/test

A big high five for that addition!


All times are GMT. The time now is 05:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01491 seconds
  • Memory Usage 1,852KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (30)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete