Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
635 views
in Plugins by

Recently Social share plugin is not working but it worked before properly. When I want to share it is showing this following message. 

Please somebody help. My site is https://www.ask-ans.com

Q2A version: 1.8.3

1 Answer

–1 vote
by
Facebook the shepherd keeps changing so developers (sheep) must follow them.

As I look at your buttons, some Facebook sharer parameters were depreciated. They no longer support them.

The simplest functional URL should be: https://www.facebook.com/sharer/sharer.php?u=https://www.ask-ans.com/123456789/i-want-it-that-way

To get the current URL using PHP is something like this: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]

There are also some other long and sophisticated ways by using Q2A functions, as you can see in http://docs.question2answer.org/code/functions/

Another solution is to use other non-Q2A social plugins. Go to any news site and you can grab one, for example addtoany.

https://stackoverflow.com/questions/20956229/has-facebook-sharer-php-changed-to-no-longer-accept-detailed-parameters
by
+1
If you still find it hard, here's my personal trick in my site:
I edited the qa-theme.php (in the theme folder) by adding this function.

//Social Media Icons
   
public function q_view_buttons($q_view) {

        $this->output(
                     '<div class="qa-social-buttons">',
'<a href="#" onclick="window.open(\'https://www.facebook.com/sharer/sharer.php?u=\'+encodeURIComponent(location.href), \'facebook-share-dialog\', \'width=626,height=436\'); return false;"> <img src=../media/fb.png style="max-height:20px;width:auto;vertical-align: sub;padding-right:3px" width="18" height="18" /></a>',
'<a href="#" onclick="window.open(\'https://reddit.com/submit?url=\'+encodeURIComponent(location.href), \'reddit-share-dialog\', \'width=626,height=436\'); return false;"> <img src=../media/rd.png style="max-height:20px;width:auto;vertical-align: sub;padding-right:3px" width="18" height="18" /></a>',
'<a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;https://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());"> <img src=../media/pi.png style="max-height:20px;width:auto;vertical-align: sub;padding-right:3px" width="18" height="18" /></a>',
            '</div>'
        );

        qa_html_theme_base::q_view_buttons($q_view);
    }
...