xoops forums

Hasanibrahim

Just popping in
Posted on: 2013/8/28 8:30
Hasanibrahim
Hasanibrahim (Show more)
Just popping in
Posts: 70
Since: 2009/2/12
#1

An important hack for Facebook "comment and like"

Hello dear xoops users,

i was working to fix FBConnect module for a huge problem explained in https://xoops.org/modules/newbb/viewtopic.php?post_id=354114 . As you know when you use this module, visitors can only comment on one section and all comments were collecting in the comment box.

I tried to fix the module with millions of the ways but result was un-succesfful. So i tried to use php codes for that,The easiest and basic way to fix that is addind a php block includes these codes:

echo '<div class="fb-like" data-href="http://YOURDOMAIN.com/" data-width="450" data-show-faces="true" data-send="true"></div>';

echo 
'<div class="fb-comments" data-href="' 'YOURDOMAIN.com' $_SERVER['REQUEST_URI'] . '" data-width="450" data-num-posts="15"></div>';


The first code is for "facebook like" which is not making issue, but the second code is working greatly. As you see, its target site is the current url of your website, hence visitors now comment the true page.

EDİT:
i forgot to explain how to moderate the comments. This problem was another annoying issue. But at the end, i have found its solution, too. You need to add these codes to your default theme html file:

<meta property="fb:moderator" content="YOUR_FACEBOOK_ID"/>
<
meta property="fb:admins" content="YOUR_FACEBOOK_ID"/>
<
meta property="fb:app_id" content="YOUR_FACEBOOK_APP_ID"/>


The last app_id is optional. You can learnd your facebook id via with http://findmyfacebookid.com/ .

After you add these codes between head tags, you can moderate the comments comes from facebook users.

enjoy

Cesagonchu

Moderator
Posted on: 2013/11/1 17:09
Cesagonchu
Cesagonchu (Show more)
Moderator
Posts: 864
Since: 2010/2/1 2
#2

Re: An important hack for Facebook "comment and like"

Thank you