Topic-icon JFBCSocialShare - Hide Facebook Like - Show Facebook Share

Active Subscriptions:

None
Version: 6.1.2 J2.5

Hi, is there a way to hide Facebook Like and show facebook share. I read this post
www.sourcecoast.com/forums/jfbconnect/jf...-share-button#p42426
and maybe it is possible to have the code.

Thank you, best regards
Francesco
The topic has been locked.
Support Specialist
9 years 1 month ago #51915 by mel
In your version of /plugins/content/jfbccontent/jfbccontent.php around line 278, try replacing
else
   $likeText = '';
with
else if($showShareButton && !$showFacebook)
{
   if($buttonStyle == 'standard' || $buttonStyle == 'button')
      $style = 'button';
   else if($buttonStyle == 'box_count')
      $style = 'box_count';
   else
      $style = 'button_count';

   $likeText .= '{JFBCShare layout=' . $style . $widthField . ' href=' . $url . $renderKeyString . '}';
}

Try this, but please note that this code is untested.

-Melissa
The topic has been locked.
Active Subscriptions:

None
Thanks for your answer.

unfortunatly it seems not working, I'm using it in this site www.taichionline.it

Best regards
Francesco
The topic has been locked.
Support Specialist
9 years 1 month ago #51922 by mel
Francesco,

Can you make sure the setting for the Facebook Like button is off, but the Facebook Share button is on?

[Edited to Add] Can you also paste the code that you have for the entire _getLikeButton method at line 264, so that I can test/tweak it on my test site.

-Melissa
The topic has been locked.
Active Subscriptions:

None
I'm very sorry Mel, you are right, I set everything as it was before (Show Like & Share). Now I settings are: Hide Like and Show Share, and none of both is visible in front-end.

I add the file so you have all the code.

Thank you, best regards
Francesco
jfbccontent.zip
The topic has been locked.
Support Specialist
9 years 1 month ago #51929 by mel
Here's the new method with a couple small changes:
function _getLikeButton($article, $buttonStyle, $showFacebook, $showFaces, $showShareButton, $showLinkedInButton, $showTwitterButton, $showGooglePlusButton, $showPinterestButton, $width, $verbToDisplay, $font, $colorScheme, $pinImage, $pinText, $renderKeyString, $isJoomla)
    {
        $likeText = '';
        $url = SCArticleContent::getCurrentURL($article, $isJoomla);

        //Only set width for standard layout, not box_count or button_count
        if ($buttonStyle == 'standard')
            $widthField = ' width=' . $width;
        else
            $widthField = '';

        if($showFacebook)
            $likeText = '{JFBCLike layout=' . $buttonStyle . ' show_faces=' . $showFaces . ' share=' . $showShareButton
                . $widthField . ' action=' . $verbToDisplay . ' font=' . $font
                . ' colorscheme=' . $colorScheme . ' href=' . $url . $renderKeyString . '}';
        else if($showShareButton && !$showFacebook)
        {
           if($buttonStyle == 'standard' || $buttonStyle == 'button')
              $style = 'button';
           else if($buttonStyle == 'box_count')
              $style = 'box_count';
           else
              $style = 'button_count';

           $likeText = '{JFBCShare layout=' . $style . $widthField . ' href=' . $url . $renderKeyString . '}';
        }

        $buttonText = '<div style="position: relative; top:0px; left:0px; z-index: 99;" class="scsocialbuttons '.$buttonStyle.'">';
        if ($showLinkedInButton || $showTwitterButton || $showGooglePlusButton || $showPinterestButton)
        {
            $extraButtonText = SCSocialUtilities::getExtraShareButtons($url, $buttonStyle, false, false, $showTwitterButton, $showGooglePlusButton, $renderKeyString, $showLinkedInButton, '50', $showPinterestButton, $pinImage, $pinText);
            $buttonText .= $extraButtonText;
        }
        $buttonText .= $likeText;
        $buttonText .= '</div><div style="clear:left"></div>';
        $likeText = $buttonText;

        return $likeText;
    }

From what you have, it adds
$likeText = ''; at the very top and changes $likeText .= '{JFBCShare... to $likeText = '{JFBCShare...
The topic has been locked.
Active Subscriptions:

None
Thanks for your efforts, unfortunatly it doesn'w work again.

I copied and pasted the code, but still can not see both buttons facebook.

Let's try to shorten the time, buying the new version will options work setting them from Joomla backend?

Thank you

Best regards
Francesco
The topic has been locked.
Support Specialist
9 years 1 month ago #51939 by mel
Looking at our tracker, the issue for showing the Share without the Like button is fixed in the upcoming 6.3 release, which I am anticipating being able to put out this week.

If you don't want to wait until then, you can PM me backend credentials, FTP credentials and the specific URL to test on and I can fix it for you. It should be a simple fix and making sure the settings in the content plugin are correct. The code I last sent above is working on my test site.

-Melissa
The topic has been locked.
Active Subscriptions:

None
Hi, there's no hurry, I will buy the new version with the fixed code.
Thank you, best regards

Francesco
The topic has been locked.
Active Subscriptions:

None
Hi, I bought the last version 6.3.0 but still if I set FB hide like and show share it doesn't show anything. On the contrary if I set show like and hide share it works.

Now settings are: hide like and show share
www.taichionline.it/news.html

you can see linkedin, g+ and twitter, but you cannot see facebook share.

After installation I use the AutoTune tool till the end and no error was found

Best regards
Francesco
The topic has been locked.