} $url = \Base::instance()->get('SCHEME') . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $options = array(); switch ($type) { case 'facebook': $options = array('mobile' => $settings->get('social.facebook.comments.mobile'), 'num_posts' => $settings->get('social.facebook.comments.num_posts'), 'theme' => $settings->get('social.facebook.comments.theme'), 'order' => $settings->get('social.facebook.comments.order'), 'post_url' => $url); break; case 'disqus': $options = array('shortname' => $settings->get('social.disqus.comments.shortname'), 'title' => $item->{'title'}, 'id' => $item->{'id'}, 'post_url' => $url); break; default: return; break; } $comments = \Blog\Lib\Social::instance()->getTool($type . ':comments', $options); $num_comments = \Blog\Lib\Social::instance()->getTool($type . ':count_comments', $options); ?> <div class="blog-comments main-widget"> <div class="widget-title"> <h4>Comments (<?php echo $num_comments; ?> )</h4> </div> <div class="widget-content"> <?php echo $comments; ?> </div> </div>
<?php $social_buttons = array(); $url = \Base::instance()->get('SCHEME') . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $settings = \Blog\Models\Settings::fetch(); $social_networks = $settings->get('post.social_networks'); if (count($social_networks) == 0) { return; } $options = array('post_url' => $url, 'hashtags' => $item->{'tags'}, 'desc' => $item->{'title'}, 'image' => \Base::instance()->get('SCHEME') . '://' . $_SERVER['SERVER_NAME'] . '/asset/' . $item->{'featured_image.slug'}, 'title' => $item->{'title'}); foreach ($social_networks as $button) { $social_buttons[] = \Blog\Lib\Social::instance()->getTool($button, $options); } ?> <ul class="share-buttons list-unstyled list-inline"> <?php foreach ($social_buttons as $button) { ?> <li class="share-button" style="display:table-cell; vertical-align:middle;"> <?php echo $button; ?> </li> <?php } ?> </ul>