Repository navigation
Expand file tree
/
Copy path_facebook.plugin.php
More file actions
79 lines (71 loc) · 2.35 KB
/
Copy path_facebook.plugin.php
File metadata and controls
79 lines (71 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* This file implements the facebook like plugin
*
* This file is part of the b2evolution project - {@link http://b2evolution.net/}
*
* @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
*
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
*
* @package plugins
*
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author asimo: Evo Factory - Attila Simo
*
* @version $Id: _facebook.plugin.php 8373 2015-02-28 21:44:37Z fplanque $
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
/**
* Facebook Plugin
*
* This plugin displays
*/
class facebook_plugin extends Plugin
{
/**
* Variables below MUST be overriden by plugin implementations,
* either in the subclass declaration or in the subclass constructor.
*/
var $name;
var $code = 'evo_facebook';
var $priority = 20;
var $version = '1.0';
var $author = 'The b2evo Group';
var $group = 'widget';
/**
* Init
*/
function PluginInit( & $params )
{
$this->name = T_( 'Facebook Like Widget' );
$this->short_desc = T_('This skin tag displays a Facebook Like button.');
$this->long_desc = T_('Shows how many users like the current page.');
}
/**
* Event handler: SkinTag (widget)
*
* @param array Associative array of parameters.
* @return boolean did we display?
*/
function SkinTag( $params )
{
/**
* Default params:
*/
// This is what will enclose the block in the skin:
if(!isset($params['block_start']) || empty($params['block_start'])) $params['block_start'] = '<div class="bSideItem">';
if(!isset($params['block_end']) || empty($params['block_end'])) $params['block_end'] = "</div>\n";
global $baseurlroot;
//$test_url = url_absolute( regenerate_url( '', '', '', '&' ), 'http://127.0.0.1' );
$current_url = url_absolute( regenerate_url( '', '', '', '&' ), $baseurlroot );
echo $params['block_start'];
echo '<iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode($current_url)
.'&layout=standard&show_faces=true&width=190&action=like&font=arial&colorscheme=light&height=66"
scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:190px; height:66px;"
allowTransparency="true"></iframe>';
echo $params['block_end'];
return true;
}
}
?>