Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

about facebook comment pluging..

+3 votes
1,854 views
asked Jan 4, 2015 in Plugins by How To Lanka
about facebook comment pluging..

i have r facebook comment HTML and java scrypt code.. but i dont now where is the put this.. then i want to put this file. please who can help me to put in to file.

how can i make this?
Q2A version: v1.3

2 Answers

0 votes
answered Jan 5, 2015 by Ami

You can do this by crating a new plugin with  a leyer http://www.question2answer.org/layers.php . 

You need to override the q_view_main() to fit your needs . 

https://github.com/q2a/question2answer/blob/7f8e3a71492f3c6d140323e1cf8bf2a8147bd5bc/qa-include/qa-theme-base.php#L2055

Also here is the functions which are responsible for showing comments and comment form . Override them as per your needs . 

c_form -- For comment form

c_list -- For showing comment thread

 

Hope this helps

commented Jan 6, 2015 by Tharidu Pradeep
hello Ami..!
im not r developer.. then i can't understand this moment..
please can you explain more?
(with step by step)
+1 vote
answered Mar 17 by Nguyễn Đăng Phú

Here is my plugin for my own page. You should modify to make use of it.

http://mrphu.net/download/facebook-comment-box.zip

Modify the code in the plugin main file: qa-plugin/facebook-comment-box/qa-facebook-comment-box-layer.php

class qa_html_theme_layer extends qa_html_theme_base
{
        
    public function body_suffix()
    {
        $this->output('<div id="fb-root"></div>');
        $this->output('
                    <script>(function(d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id)) return;
                    js = d.createElement(s); js.id = id;
                    js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=<your facebook app id here>";
                    fjs.parentNode.insertBefore(js, fjs);
                    }(document, \'script\', \'facebook-jssdk\'));</script>');
        parent::body_suffix();
    }

    public function main_parts($content)
    {
        parent::main_parts($content);
        //$q_view = @$this->content['q_view'];
        $q_view = @$content['q_view'];
        // link title where appropriate
        $url = isset($q_view['url']) ? 'http://your_page.com'.substr($q_view['url'],2) : 'http://your_page.com';
        $this->output('
                    <div class="fb-comments" data-href="'.$url.'" data-numposts="5"></div>
                    ');
    }
}

If you still don't know how to do, please google search for "how to register a facebook appid for your page" and "how to add a facebook comment box". And, if needed, "how to install a plugin" also (search in this forum).

commented Mar 17 by Nguyễn Đăng Phú
visit my page: kiwidic.com for example
...