amiyasahu / q2a-social-share

:busts_in_silhouette: Question2Answer plugin for sharing questions and blog posts in social media
GNU General Public License v2.0
18 stars 13 forks source link

Position After question text? #5

Closed yerbol89 closed 10 years ago

yerbol89 commented 10 years ago

Hi @amiyasahu How i add this plugin After question text? I'm not see in add area not select Position After question text?

p.s. Example. In https://github.com/svivian/q2a-widget-anywhere After question text

amiyasahu commented 10 years ago

you need add this function in the layer file - qa-social-share-layer.php

function q_view_content($q_view)
    {
        if ((int)qa_opt(qa_sss_opt::BUTTON_STATUS)) {
            $page_url = urlencode(qa_opt('site_url').$this->request);
            $page_title = urlencode($q_view['raw']['title']);
            $social_button = ami_generate_social_buttons(array(
                    '{{page_url}}'   => $page_url ,
                    '{{page_title}}' => $page_title ,
                ), $this->template );
            $this->output($social_button) ;
        }
        qa_html_theme_base::q_view_content($q_view);
    }

Thanks