The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Simple Facebook "like" button on the navbar
Hi,
Recently I've put a facebook button in my forum regarding my facebook page. First I've tried placing it in the logo (using the ad managment) but didn't like it much, there. Now I have it below the navbar, as you can see in the first image, but I don't like it much there, either. It takes too much space altogether (including the white space). I think I'd prefer a simple button on the navbar next to the rest of the tabs like you can see here below: Is there a way to do so? thx |
#2
|
|||
|
|||
depends what vb version
|
#3
|
||||
|
||||
vBulletin v 4.2.2
|
#4
|
|||
|
|||
dimitrisvb-
Did you ever get this figured out? I am trying to do something very similar in vB4.2 as well. I would like to know what you did to get this done. Thank you. |
#5
|
|||
|
|||
Quote:
See template: "facebook_header", look for the following two lines. Code:
<img id="fb_squarepic" width="16" height="16" alt="{vb:rawphrase facebook_connect}" src="{vb:raw squarepicurl}" /> <img id="fb_icon" width="14" height="14" alt="{vb:rawphrase facebook_connect}" src="{vb:stylevar imgdir_misc}/facebook.gif" /> |
#6
|
|||
|
|||
Quote:
Here is where I inserted my facebook like code (in the facebook_header template): Code:
<li id="fb_headerbox" class="hidden"> <div class="fb-like" data-href="http://facebook.com/myfacebookpage" data-send="false" data-layout="button_count" data-width="30" data-show-faces="false" data-font="verdana" data-colorscheme="dark"> </div> <vb:if condition="$show['facebookuser']"> <a id="fb_link" href="{vb:raw profileurl}"> <img id="fb_squarepic" width="16" height="16" alt="{vb:rawphrase facebook_connect}" src="{vb:raw squarepicurl}" /> <img id="fb_icon" width="14" height="14" alt="{vb:rawphrase facebook_connect}" src="{vb:stylevar imgdir_misc}/facebook.gif" /> </a> <vb:else /> <a id="fb_loginbtn" href="#"><img src="{vb:stylevar imgdir_misc}/facebook_login.gif" alt="{vb:rawphrase facebook_connect}" /></a> </vb:if> </li> How do i get the "Like" button to appear to the left of the facebook connect icon, and have them all lined up in a wonderfully horizontal flow? p.s. I appreciate your confidence in my ability to work with vB... LOL :up: |
#7
|
||||
|
||||
Quote:
You can use two different tricks: 1) float-left / float-right CSS property 2) display: inline-block CSS property I recommend you to use the float-left CSS property because this facebook "like" button code is too messy and it should be too difficult use inline-block! Try this: PHP Code:
You're welcome |
Благодарность от: | ||
tbworld |
#8
|
|||
|
|||
Quote:
Thanks for the tip about float left, it seems to keep the formatting on the rest of the page correct (in Chrome at least) but still the like button is on top of the facebook connect functions. I'm trying to get this to appear to the left... so everything is in a single row. Having a tough time with this! |
#9
|
|||
|
|||
Yeah, the CSS here can get a bit tricky. On top of that the selector names are inconsistent, some use "fb-" others use "fb_". Even if you do not use some of the selectors below keep them handy for the future. Alter the margins to your layout.
I modified the HTML structure just a bit with a container class ".fb_custom_container". Code:
<style> /* Add this to the bottom of your CSS file, It was just placed here for convience. 1px = property placeholder so you can see the properties in a browser debugger. Their actual value is 0px; You will need to alter the following values to adapt to your layout. */ .toplinks ul.nouser #fb_loginbtn { margin-right: 1px; /* 0px */ } .toplinks ul.isuser #fb_loginbtn { margin-right: 5px; } .toplinks ul.nouser .fb-like { margin-right: 12px; } .toplinks ul.isuser .fb-like { margin-right: 1px; /* 0px */ } .toplinks ul.isuser #fb_link { margin-right: 12px; } .toplinks div.fb_custom_container { float: left; } </style> <li id="fb_headerbox" class="hidden"> <div class="fb-like" data-href="http://facebook.com/myfacebookpage" data-send="false" data-layout="button_count" data-width="30" data-show-faces="false" data-font="verdana" data-colorscheme="dark"> </div> <div class="fb_custom_container"> <vb:if condition="$show['facebookuser']"> <a id="fb_link" href="{vb:raw profileurl}"> <img id="fb_squarepic" width="16" height="16" alt="{vb:rawphrase facebook_connect}" src="{vb:raw squarepicurl}" /> <img id="fb_icon" width="14" height="14" alt="{vb:rawphrase facebook_connect}" src="{vb:stylevar imgdir_misc}/facebook.gif" /> </a> <vb:else /> <a id="fb_loginbtn" href="#"><img src="{vb:stylevar imgdir_misc}/facebook_login.gif" alt="{vb:rawphrase facebook_connect}" /></a> </vb:if> </div> </li> |
#10
|
||||
|
||||
Quote:
---------------- Edit: Ok, i have found it with the link of your screenshots! But i can't see the connect button! :S |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|