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


All times are GMT. The time now is 05:43 AM.

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.01180 seconds
  • Memory Usage 1,768KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete