Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.3k views
in Q2A Core by

I was wanting to integrate the fb like button for each question on my website. http://blankanswer.com/

Thanks.. in advance. also, any suggestions for improvements are welcome!

by
Can you explain how you did this?

2 Answers

+1 vote
by

Looks like you already did, it's on the toolbar at the bottom. But another method is a sharing tool like AddThis.

+2 votes
by

This is my own solution:

- First you get code from Addthis.

- Then go to qa-app-format.php and search for:

if ($microformats)
                    $fields['title']='<SPAN CLASS="entry-title">'.$fields['title'];

replace it by code below:

if ($microformats)
                    $fields['title']='<SPAN CLASS="entry-title">'.$fields['title'].'</SPAN><br/>'.
                    '<div class="addthis_toolbox addthis_default_style">'.
                    '<a class="addthis_button_facebook"></a>'.
                    '<a class="addthis_button_twitter"></a>'.
                    '<a class="addthis_button_googlebuzz"></a>'.
                    '<a class="addthis_button_email"></a>'.
                    '<span class="addthis_separator"> </span>'.
                    '<a class="addthis_button_facebook_like"></a>'.                    
                    '<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>';

You can see demo here And if you like my solution, just like my site ;)

 

 

by
My suggest above works just fine in QAv1.3 but 'm not sure for QAv1.4. In version 1.4 I dont modify original code any more just do it all in advanced theme.

For AddThis stuff you should follow dofmike instruction or put this stuff below into your advance theme. Sure it works.

function q_view_main($q_view){
            $this->output('<DIV CLASS="qa-q-view-main">');
            /*-- Tenkana-QA Addon: Socialstream buttons --*/
            $this->output('<div class="addthis_toolbox addthis_default_style">'.
                    '<a class="addthis_button_facebook"></a>'.
                    '<a class="addthis_button_twitter"></a>'.
                    '<a class="addthis_button_googlebuzz"></a>'.
                    '<a class="addthis_button_email"></a>'.
                    '<span class="addthis_separator"> </span>'.
                    '<a class="addthis_button_facebook_like"></a>'.                   
                    '<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script></div>');
            /*-- ------------------------------------- --*/
            $this->q_view_content($q_view);
            $this->q_view_follows($q_view);
            $this->post_tags($q_view, 'qa-q-view');
            $this->post_avatar($q_view, 'qa-q-view');
            $this->post_meta($q_view, 'qa-q-view');
            $this->q_view_buttons($q_view);
            $this->c_list(@$q_view['c_list'], 'qa-q-view');
            $this->form(@$q_view['a_form']);
            $this->c_list(@$q_view['a_form']['c_list'], 'qa-a-item');
            $this->form(@$q_view['c_form']);
           
            $this->output('</DIV> <!-- END qa-q-view-main -->');
        }
by
edited by
@tenkana But how can i add above of the title? because in your tutorial is below the title.

Thanks
by
hey thank you so much. I used your code except changed it a little because yours is outdated.
...