Topic-icon After installing JFBconnect,there is an abnormal block appearing above

Active Subscriptions:

None
After installing JFBconnect,there is an abnormal block appearing above the header and some messy codes such as gf.org.tw/about-us/found-genesis.html
The site is built by Joomla V2.5.8 with k2 V2.6.2.
The social plugins(fb like button) here for k2 items also don't work well.
Please see the image:
The topic has been locked.
Support Specialist
We're looking into this problem. It's an issue with how K2 is generating their own Open Graph tags in their 2.6 release. If you switch the Social Button position from "Both" to either Top or Bottom, that usually fixes the problem. If you're not set to display them on "Both" right now, let us know (or try a different position anyways). You can set the location of the display in the Social configuration -> Content Plugin - K2 tab of JFBConnect's admin area.

Let us know how that goes, and sorry for the troubles,
Alex
The topic has been locked.
Active Subscriptions:

None
But I'm not set to display them on "Both".
I set to display them on "Top".
Is there any other solution or should I go back to k2 V.2.5.X ?
The topic has been locked.
Support Specialist
jnts1980,
Set the location to "Bottom" and that should get rid of the problem. You can go back to K2 v2.5, but I don't think that should be necessary. We're working on a possible change that will fix the issue, but it may take a few more days to implement and test.

Alex
The topic has been locked.
Active Subscriptions:

None
Thanks for your advice.
I'll temporarily set them to display on bottom.
I really need them on top, so i'll wait for the updated version.
Many thanks.
The topic has been locked.
Support Specialist
We have a fix that we're testing right now. If you're interested in implementing it to see if it fixes the issues on your site, we'd love to hear your feedback. We're planning a release over the next week with quite a few fixes, and this is likely going to be one.

To make the change, please edit the /plugins/system/jfbcsystem/jfbcsystem.php file. Around line 313, you'll see the following block of code:
/*
             * Code to strip any {JFBCxyz} tags from head. Caused issues on some users sites in 4.3.1
             * Removing until more error-proof method found.
            //Get the head
            $content = JResponse::getBody();
            $regex = '|<head(.*)?</head>|sui';
            preg_match($regex, $content, $matches);

            //Remove the tag if it's in the head
            $newHead = preg_replace('|{'.$tag.'(.*?)}|ui', '', $matches[0]);

            //Replace the head
            $content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content);
            JResponse::setBody($content);
            */
Replace that whole block with the following:
/*
             * Code to strip any {JFBCxyz} tags from head. Caused issues on some user's sites in 4.3.1
             * Removing until more error-proof method found.
             */
            //Get the head
            $content = JResponse::getBody();
            $regex = '|<head(.*)?</head>|sui';
            if (preg_match($regex, $content, $matches))
            {
                if (count($matches) == 2) // more than one head is a problem, don't do anything
                {
                    //Remove the tag if it's in the head
                    $newHead = preg_replace('|{' . $tag . '(.*?)}|ui', '', $matches[0], -1, $count);

                    if ($count > 0)
                    {
                        //Replace the head
                        $content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content, -1, $count);
                        if ($count == 1) // Only update the body if exactly one head was found and replaced
                            JResponse::setBody($content);
                    }
                }
            }
Make sure you do not leave the */ from the bottom of original block, or you will run into issues.

Please let us know how that goes for you. Also, please make sure you test on many pages of your site, not just the one(s) that were having issues. The code can modify the whole output HTML and affect other pages in a bad way, so we just want to make sure we're not trading a fix for one issue just to break another.

Thanks,
Alex
The topic has been locked.