Skip to content

Commit

Permalink
Fixing fbcomment
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Jul 21, 2018
1 parent 51c5549 commit ac1682a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
16 changes: 8 additions & 8 deletions libraries/fabrik/fabrik/Helpers/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -2190,14 +2190,14 @@ public static function facebookGraphAPI($appId, $locale = 'en_US', $meta = array

$retStr = <<<EOT
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script id="fb-like-script">(function(d, s, id) {
var js, fjs = d.getElementById('fb-like-script');
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/$locale/sdk.js#xfbml=1&version=v2.11";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/$locale/sdk.js#xfbml=1&version=v3.0&appId=$appId&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
EOT;

return $retStr;
Expand Down
4 changes: 2 additions & 2 deletions plugins/fabrik_element/fbcomment/fbcomment.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function render($data, $repeatCounter = 0)
$displayData->colour = $params->get('fb_comment_scheme') == '' ? '' : ' colorscheme="dark" ';
$displayData->href = $params->get('fbcomment_href', '');

if (empty($data->href))
if (!isset($data->href) || empty($data->href))
{
$rowId = $this->app->input->getString('rowid', '', 'string');

Expand All @@ -81,7 +81,7 @@ public function render($data, $repeatCounter = 0)
if (!empty($displayData->href))
{
$w = new FabrikWorker;
$displayData->href = $w->parseMessageForPlaceHolder($data->href, $data);
$displayData->href = $w->parseMessageForPlaceHolder($displayData->href, $data);
$locale = $params->get('fbcomment_locale', 'en_US');

if (empty($locale))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@

<?php
if ($d->href !== '') :
echo $d->graphApi;
?>
<div id="fb-root">
<fb:comments href="<?php echo $d->href; ?>" nmigrated="1"
um_posts="<?php echo $d->num;?>" width="<?php echo $d->width;?>" <?php echo $d->colour; ?>></fb:comments>
<div class="fb-comments"
data-href="<?php echo $d->href; ?>"
data-numposts="<?php echo $d->num;?>"
width="<?php echo $d->width;?>"
<?php echo $d->colour; ?>
>
</div>
<?php
else :
?>
Expand Down

0 comments on commit ac1682a

Please sign in to comment.