1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-29 01:00:20 +02:00

Added Facebook Like Menu and corrected some FB.init issues.

This commit is contained in:
Cameron
2015-06-02 13:17:52 -07:00
parent 4eb9f7884f
commit efe6f27c46
4 changed files with 74 additions and 27 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* e107 website system
*
* Copyright (C) 2008-2015 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
//@see https://developers.facebook.com/docs/plugins/like-button
if(deftrue('SOCIAL_FACEBOOK_INIT') )
{
e107::js('footer-inline', SOCIAL_FACEBOOK_INIT); // defined in e_header.php
$pref = e107::pref('social');
$action = vartrue($pref['facebook_like_menu_action'], 'like'); // or 'recommend';
$layout = vartrue($pref['facebook_like_menu_layout'], 'standard'); // standard, button_count, button or box_count.
$width = vartrue($pref['facebook_like_menu_width'], 150);
$theme = vartrue($pref['facebook_like_menu_theme'], 'light');
$text = "<div style='overflow:hidden'>"; // prevent theme breakages.
$text .= '<div class="fb-like" data-href="'.SITEURL.'" data-width="'.$width.'px" data-layout="'.$layout.'" data-colorscheme="'.$theme.'" data-action="'.$action.'" data-show-faces="true" data-share="true"></div>';
$text .= "</div>";
e107::getRender()->tablerender('Facebook '.$theme,$text,'facebook-like-menu');
}elseif(ADMIN)
{
$text = "<div class='alert alert-danger'>Unable to display feed. Facebook App ID has not been defined in preferences.</div>";
e107::getRender()->tablerender('Facebook',$text,'twitter-menu');
}