Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Facebook Comments Box for Each Profile

Asked Modified Viewed 18,943 times
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
asked
Veteran Member

Hello Guyz,

It may look nice if there's a Facebook Comments Box in each Member's Profile where Comments can be Posted by the FB Users.

DEMO : http://www.clan-icsl.com/profile.php?...p?lookup=1

1. Register your Application on Facebook and Keep your Required Information like Application ID, Application Secret etc etc with you(e.g in a TXT file)

2. Download the Cross Domain Receiver file from here and Upload it to the Root of your Website.

3. Backup your original profile.php first in a safe place and then Open profile.php. Go to the Line 200. You will Find a Closing Bracket }. i.e,

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false] echo "</tr>\n</table>\n</form>\n";
}
} // I am Talking about this Bracket[/syntaxhighlighter]

Just After this Bracket add this Code : http://pastebin.com/BpnkShf4
Code is in the Link. It was giving BB Code problem and converting smilies angry so had to pastebin it.

Replace XXXXXXXXXXXXXXX with your Application ID which is provided to you with your Application.

If you want to change How many Comments should be Displayed(Maximum), then change the numposts='10' to your needs.
If you want to change width, just change the width='400'

Last and Optional Step :

Open themes/templates/header.php and Find for this line :

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";[/syntaxhighlighter]

Add the given below code after xmlns='http://www.w3.org/1999/xhtml' :

xmlns:fb='http://www.facebook.com/2008/fbml'

I called this Optional Step because the Comments will work without this step too. But I don't want to Break any Rules even by mistake pfft

Done !!!

Enjoy !!!

If you want to Customize the Text Color of Comment, or want to Customize the CSS related to it, you have to put an extra parameter named css where the code for :
echo "<fb:comments numposts='10' width='400' publish_feed='false' css='http://yourwebsite.com/fbcomment.css'></fb:comments>\n"; is defined

This will be a CSS file on your Server made by you...

Download the CSS file here : http://www.clan-icsl.com/includes/css...omment.css

Now Do whatever changes you want But Under Policies like changing Text Color.

Remember !!!

If you are changing the CSS the 2nd time(means you have been able to see the comment box once after you have installed your own CSS), then you have to change the CSS path in :
echo "<fb:comments numposts='10' width='400' publish_feed='false' css='http://yourwebsite.com/fbcomment.css'></fb:comments>\n"; also

There nothing much to do. Just change the File URL to something http://yourwebsite.com/fbcomment.css?1,http://yourwebsite.com/fbcomment.css?2,http://yourwebsite.com/fbcomment.css?3 everytime you make changes in your CSS !!!

This is because Facebook uses CACHE to Store CSS so it is required to change the file. In this way, it will not affect the real content .... wink

You should provide a Link to your Website's Terms of Agreement and a Link to your Website's Privacy Policy too...

> Better, Add the Code as a Lower Center panel with Display on All Pages

Code Updated below to the Updated version of Comments Box :

Add it as either Lower Center or Upper Center Panel : Remember to replace XXXXX with your APP ID or XID. In new Interface, Old Comments may Lost !

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]opentable("Comments via Facebook"wink;

$curlink = 'http://';
$curlink .= $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$curlink = urlencode($curlink);

echo "<table cellpadding='0' cellspacing='0' width='auto' class='center tbl-border'>\n<tr>\n";
echo "<td class='tbl2' colspan='2'><strong>Comments Box</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl1'>\n";
echo "<div id='fb-root'></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'XXXXX', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'wink; e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root'wink.appendChild(e);
}());
</script>\n";
echo "<fb:comments xid='XXXXX' href='".$curlink."' numposts='5' width='auto' publish_feed='false' migrated='1'></fb:comments>\n";
echo "</td></tr>\n</table>\n";
closetable();[/syntaxhighlighter]

You can also Set the width according to your needs...
Edited by Ankur on 27-03-2011 16:24,
0 replies

45 posts

R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Cannot see the Image.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

See it now?
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote

Jack Daniels wrote:
See it now?

Yes, I do. Harly will be able to help, I think, because he is the themes-author.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Yes I hope so. It is strange it work's in FF, Opera and Chrome but not in IE.
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote

Jack Daniels wrote:
Yes I hope so. It is strange it work's in FF, Opera and Chrome but not in IE.

That happens very often. I don't use IE except for testing for customers.
0 replies
H
Harly
H
Harly 10
Regards, Har1y.
  • Senior Member, joined since
  • Contributed 302 posts on the community forums.
  • Started 51 threads in the forums
answered
Senior Member

@JaCk Daniels - I'm not sure, if I can help, but where did you add the code? Under the footer, in the theme.php, ('cause that's what it looks like, in the screenshot)?
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

No the code is in news.php in the root after line 176.
And like I said earlier, it works fine in Firefox and Opera browsers.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

And by the way, it's not shown in that picture, that the first part of the commentbox is at the right place and then the rest is down there.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Sometimes I feel like a total idiot. :(
I was using old version of IE and that's why it turn up the way the picture shows.
After upgrading IE everything work's fine.
0 replies
L
l0nelyc0wboy
L
I am always doing things that which i cannot do, in order that i may learn how to do it.
whatpulse.org/dynamic-../../images/300224.jpg
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
answered
Junior Member

not trying to bump an old thread but since FB is rapidly growing and PF is getting better & better, if someone plan on integrating the comments system, just wanna let you know that facebook develops a new comment system with "moderation" support.
http://developers.facebook.com/blog/post/472
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Hmm... The new interface looks much better :)

Thanks L0nely for this useful info....... ;)

EDIT :

[size=28]Post#1 Updated ![/size]
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

This is the code I get and it does not work

Quote

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxxx&amp;xfbml=1"></script><fb:comments href="linuxvefurinn.is" num_posts="10" width="500"></fb:comments>
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Sorry, doble post.....
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Any way, is there anyone that know where to put this code so it works?
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Quote

Ankur wrote:

Code Updated below to the Updated version of Comments Box :

Add it as either Lower Center or Upper Center Panel : Remember to replace XXXXX with your APP ID or XID. In new Interface, Old Comments may Lost !

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]openside("Comments via Facebook");

$curlink = 'http://';
$curlink .= $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$curlink = urlencode($curlink);

echo "<table cellpadding='0' cellspacing='0' width='auto' class='center tbl-border'>\n<tr>\n";
echo "<td class='tbl2' colspan='2'><strong>Comments Box</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl1'>\n";
echo "<div id='fb-root'></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'XXXXX', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>\n";
echo "<fb:comments xid='XXXXX' href='".$curlink."' numposts='5' width='auto' publish_feed='false' migrated='1'></fb:comments>\n";
echo "</td></tr>\n</table>\n";
closeside();[/syntaxhighlighter]

You can also Set the width according to your needs...

There is something really wrong about this code.
When I put in my page and reload my page I get into my facebook site in stead geting the commentbox on my site.

I totaly hate this **** right now cause of endless problems.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Ok, got it working but now it take the panels on the right site and move it under the whole damn thing.

http://linuxvefurinn.is/news.php?readmore=11

Scroll down to see how it is.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

Jack Daniels wrote:
Ok, got it working but now it take the panels on the right site and move it under the whole damn thing.


Try changing openside to opentable and closeside to closetable and see if it work !
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

If I use this code

Quote

openside("Comments via Facebook"<img src="../images/smiley/wink.gif" alt="Wink" style="vertical-align:middle;">;

I get error. If I use only opentable; I get error and if I don't use this code but the rest it works like its on the site right now.
Change closesite to closetable and that don't change a bit.
0 replies
J
Jack Daniels
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
answered
Member

Got it works perfectly and post the code here.

// Code Added for Facebook Comments Box
opentable("Comments via Facebook");
$curlink = 'http://';
$curlink .= $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$curlink = urlencode($curlink);
 
echo "<table cellpadding='0' cellspacing='0' width='auto' class='center tbl-border'>\n<tr>\n";
                echo "<td class='tbl2' colspan='2'><strong>Umsagnir</strong></td>\n";
                echo "</tr>\n<tr>\n";
                echo "<td class='tbl1'>\n";
                echo "<div id='fb-root'></div>
                                <script>
                                window.fbAsyncInit = function() {
                                FB.init({appId: 'XXXXXXXXXXXXX', status: true, cookie: true,
                                         xfbml: true});
                                };
                                (function() {
                                var e = document.createElement('script'); e.async = true;
                                e.src = document.location.protocol +
                                '//connect.facebook.net/is_IS/all.js';
                                document.getElementById('fb-root').appendChild(e);
                                }());
                                </script>\n";
                echo "<fb:comments xid='XXXXXXXXXXXX' href='".$curlink."' numposts='5' width='auto' publish_feed='true' migrated='1'></fb:comments>\n";
                echo "</td></tr>\n</table>\n";
closetable();

// Code Ends here

Only thing you have to do is change XXXX to your xid number and is_IS to your languge for example us_US for english.
Once again thanks for your help.
0 replies
— 9 years later —
S
SkeeredOfMyMind
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums
answered
Member

I assume this does not work for PHPFusion 9.03? Any chance of this becoming an Infusion for 9.03 or updated for 9.03?
1 reply

Labels

None yet

Statistics

  • Views 0 views
  • Posts 45 posts
  • Votes 0 votes
  • Topic users 9 members

9 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
H
H
Harly 10
Regards, Har1y.
  • Senior Member, joined since
  • Contributed 302 posts on the community forums.
  • Started 51 threads in the forums
S
S
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 11 threads in the forums
E
E
  • Member, joined since
  • Contributed 176 posts on the community forums.
  • Started 49 threads in the forums
L
L
I am always doing things that which i cannot do, in order that i may learn how to do it.
whatpulse.org/dynamic-../../images/300224.jpg
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
J
J
  • Member, joined since
  • Contributed 77 posts on the community forums.
  • Started 9 threads in the forums
R
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
S
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet