1
fdeconiac
Need page url to use facebook plugin : how to do?
  • 2010/8/4 10:34

  • fdeconiac

  • Quite a regular

  • Posts: 278

  • Since: 2008/11/29


Hello xoopsers,

I would like to incorporate facebook below my articles and photos in a block.

facebook gives the code, but i need the url of each page to use it.

Do you know how i can integrate it on my code?

On french xoops support, Muss adviced me to use the tag
le="color: #000000"><?php <{$xoops_requesturl}>
but it doesn't work. I also use with and without < >


Facebook code :
le="color: #000000"><?php <iframe src="http://www.facebook.com/plugins/like.php?href=%7B%24xoops_requesturl%7D&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>


Does someone already use facebook like plugins on his website?

Thanks for your help,

Francois

2
ghia
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 11:53

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It should be xoops_requesturi

3
fdeconiac
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 12:22

  • fdeconiac

  • Quite a regular

  • Posts: 278

  • Since: 2008/11/29


Thanks Ghia,

Just tried with

le="color: #000000"><?php <iframe src="http://www.facebook.com/plugins/like.php?href=$xoops_requesturi+&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>


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


Still not working ;)

Maybe i'm missing something else in the url? I do not have knowledge in php ($, <>, ? ...)

Any idea ?

4
ghia
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 12:42

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You must use it as Smarty tag:
le="color: #000000"><?php <{$xoops_requesturi}>
You are trying to insert this in a theme or template file, right?
Use like:
le="color: #000000"><?php <iframe src="http://www.facebook.com/plugins/like.php?href=<{$xoops_requesturi}>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Not sure if this is the correct FaceBook code required.

5
fdeconiac
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 13:47

  • fdeconiac

  • Quite a regular

  • Posts: 278

  • Since: 2008/11/29


Hi Ghia,

Im trying to insert it in a block (not in the theme or template)...

Because i would like to insert it only for some module (news, extgallery,...)

Your code doesn't seems to work :( but il'm sure it should be something like that!

Tks a lot


6
ghia
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 15:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Try a php block
le="color: #000000"><?php echo '<iframe src="http://www.facebook.com/plugins/like.php?href='.htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES).'&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';

7
fdeconiac
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/4 16:21

  • fdeconiac

  • Quite a regular

  • Posts: 278

  • Since: 2008/11/29


Thanks Ghia,

Can i use it in a block?

Or should i insert it in the theme?

8
fdeconiac
Re: Need page url to use facebook plugin : how to do?
  • 2010/8/29 17:21

  • fdeconiac

  • Quite a regular

  • Posts: 278

  • Since: 2008/11/29


For xoppser interested, i found an alternative to the iframe code, using xfbml :

First, add facebook SDK javascript allowing to use fbml on your site :
More infos here : Javascript SDK Facebook
le="color: #000000"><?php <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: '[b]your app id[/b]', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/[b]en_US[/b]/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script>


- If you want to change like by j'aime, modify "en_US" by "fr_FR"
- You also have to complete the code with the id of a facebook application or page (change "your app id")
Next you can insert fbml :
le="color: #000000"><?php <fb:like></fb:like>


Hope it will be usefull

Regards

9
spyblaster91
Re: Need page url to use facebook plugin : how to do?

can someone tell me where to put the sdk codes?

10
ghia
Re: Need page url to use facebook plugin : how to do?
  • 2010/9/1 6:24

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I assume you have to replace 'your app id'.
Check the link to the Facebook site above for more details.

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits