XMB Forum Software

Facebook like button

gagf - 4-3-2012 at 11:34 PM

Can someone help me with a piece of code to put a facebook like button up where search , memberslist, and FAQ are

I can get the button to show in the header area but don't know how to get it to show where my other links are

this is my like button code if it helps

Code:
<div class="fb-like" data-href="http://www.facebook.com/georgiagunforum" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false"></div>

gagf - 4-6-2012 at 01:10 AM

anyone have any info that would help

vlonjat4ever - 4-6-2012 at 01:06 PM

I suggest to use iframe not HTML5 becouse some old browsers not support it.
You can modify header.php
Open header.php
Find:
Code:
// 'Forum Rules'-link if ($SETTINGS['bbrules'] == 'on') { $links[] = '<img src="'.$imgdir.'/top_bbrules.gif" alt="'.$lang['altrules'].'" border="0" /> <a href="faq.php?page=forumrules"><font class="navtd">'.$lang['textbbrules'].'</font></a>'; }

Add code below:
Code:
$links[] = '<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fgeorgiagunforum&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=18" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:18px;" allowTransparency="true"></iframe>';

Save and try it.
=======================================
Another way to do this is to edit header template
Find in header template:
Code:
<td class="navtd"><font class="navtd">$searchlink $links $pluglink</font></td>


and add iframe code like this:

Code:
<td class="navtd"><font class="navtd">$searchlink $links $pluglink &nbsp; <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fgeorgiagunforum&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=18" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:18px;" allowTransparency="true"></iframe></font></td>

I hope this helps you!

gagf - 4-7-2012 at 03:08 AM

added iframe code worked perfectly, thanks

vamsee - 4-18-2012 at 04:11 PM

iframe sucks !

here's how i did it for FB like and Google+ buttons in header
http://www.xmbforum.com/viewthread.php?tid=776489#pid1372935

1.login as admin and go to admin control panel
2. edit templates and below chose header template
3. find this code in header template :

<td class="navtd"><font class="navtd">$searchlink $links $pluglink</font>
</td>

and replace with :

<td class="navtd"><font class="navtd">$searchlink $links $pluglink</font><g:plusone size="medium"></g:plusone><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="" send="true" width="300" show_faces="false" font="verdana"></fb:like><div id="fb-root"></div>
</td>

and save the template.
This will install Google +1 button and Facebook Like and Send buttons next to your site links and plugins(if any)

you can adjust the width="300" to suit your page width
and chose show_faces="true" if you want to show face thumbnails of those who like your pages.



vamsee - 5-9-2012 at 03:56 PM

is there any way to make this facebook like button addup all likes on all pages for each thread, instead of showing fresh like button for each page of a thread

Aerosmith - 5-10-2012 at 03:05 AM

facebook sucks. big brother at its finest.

kuba1 - 5-14-2012 at 09:12 PM

there is no way we can make the facebook like button act that way ..... you are better off posting your question in the facebook developers forum.

vamsee - 5-16-2012 at 07:55 PM

SMF has a MOD called facebook integration, which is like XMB's facebook connect.
and it does what i said