News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Help With New Facebook Like Button with SMF

Started by alphacaveman, April 28, 2010, 07:30:56 PM

Previous topic - Next topic

alphacaveman

I've gotten the new Facebook Like button to work on standard webpages, but not with my SMF.

The button shows up but it either gives an error message once it's clicked or appears to do as it's supposed to by opening a pop up login box BUT instead of going away after you login it tries to open your Facebook account in that small pop up browser window.

Here's an example of it on a normal page (scroll to end). Please test that and then LOG OUT of Facebook so that there's a consistent test. Then see my forum thread template where I've put it.

Here's the code Facebook gives:

<iframe src="http://www.facebook.com/plugins/like.php?layout=standard&amp;show_faces=true&amp;width=350&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:350px; height:px"></iframe>

I suspect there's a PHP or SMF tweak that needs to be made. I'd sure appreciate someone telling me how to do it. Thanks!

alphacaveman

#1
Ok, I have figured out that it has something to do with the process of getting the URL of the page being liked...BUT I need help to do that please.

Here's the code for a static page where you have the URL. I think a change needs to be made to have SMF get the url of the thread:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.gracecentered.com%2Fchristian_forums%2F&amp;layout=standard&amp;show_faces=false&amp;width=350&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:350px; height:30px"></iframe>


~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Mayhem30

It's taking forever for mods to be approved ... alphacaveman here is what you need to do :

<iframe src="http://www.facebook.com/plugins/like.php?href=';, $scripturl, '?topic=', $context['current_topic'], '&amp;layout=button_count&amp;show_faces=true&amp;width=80&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:21px"></iframe>

(Tested)


NoobDeveloper

Quote from: Mayhem30 on May 10, 2010, 01:51:35 AM
It's taking forever for mods to be approved ... alphacaveman here is what you need to do :

<iframe src="http://www.facebook.com/plugins/like.php?href=';, $scripturl, '?topic=', $context['current_topic'], '&amp;layout=button_count&amp;show_faces=true&amp;width=80&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:21px"></iframe>

(Tested)
hey buddy...i need your help
if i put below code it works for static URL of my site.
<iframe src="http://www.facebook.com/plugins/like.php?href=www.MYWEBSITE.COM&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

n if i replace your above code it gives ERROR in red when i click on LIKE.

what i want is topic URL wise LIKE button and hence it has to do something with URL.
can you help me what to put in URL so that when SMF topic page loads and if i click on LIKE button. the LIKE is applied to that particular post ?

i tried your code but it gives me error in red.

thanks in advance.

Advertisement: