4 * Copyright 2010 Reini Urban
6 * This file is part of PhpWiki.
8 * PhpWiki is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * PhpWiki is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 Optional opengraph page meta data to be added to head.tmpl:
25 og:title - The title of your page; if not specified, the title element will be used.
26 og:site_name - The name of your web site, e.g., "CNN" or "IMDb".
27 og:image - The URL of the best picture for this page. The image must be at least
28 50px by 50px and have a maximum aspect ratio of 3:1.
31 class WikiPlugin_FacebookLike
34 function getDescription()
36 return _("Display a Facebook Like button.");
39 function getDefaultArguments()
41 return array('width' => 450,
43 //'title' => '', // override $TITLE (i.e. pagename)
44 'colorscheme' => 'light', // or "dark"
45 'show_faces' => "false",
46 'layout' => "standard", // or "button_count"
47 'action' => "like", // or "recommend"
51 function run($dbi, $argstr, &$request, $basepage)
53 $args = $this->getArgs($argstr, $request);
56 //$iframe = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=false&width=450&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;\" allowTransparency=\"true\"></iframe>";
59 "show_faces" => $show_faces,
61 "action" => "like", // or "recommend"
62 "colorscheme" => $colorscheme,
65 $pagename = $request->getArg('pagename');
66 $url = "http://www.facebook.com/plugins/like.php?"
67 . "href=" . urlencode(WikiUrl($pagename, $urlargs, true));
68 $url = str_replace("%3D", "=", $url);
69 $params = array("src" => $url,
72 "style" => "border:none; overflow:hidden; "
73 . "width:$width" . "px; height:$height" . "px;",
74 "allowtransparency" => "true");
75 return HTML::iframe($params);
83 // c-hanging-comment-ender-p: nil
84 // indent-tabs-mode: nil