From: <ru...@us...> - 2010-06-14 12:38:23
|
Revision: 7533 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7533&view=rev Author: rurban Date: 2010-06-14 12:38:16 +0000 (Mon, 14 Jun 2010) Log Message: ----------- fix pagename, improve url encoding Modified Paths: -------------- trunk/lib/plugin/FacebookLike.php Modified: trunk/lib/plugin/FacebookLike.php =================================================================== --- trunk/lib/plugin/FacebookLike.php 2010-06-14 12:05:35 UTC (rev 7532) +++ trunk/lib/plugin/FacebookLike.php 2010-06-14 12:38:16 UTC (rev 7533) @@ -38,32 +38,36 @@ function getDefaultArguments() { return array('width' => 450, 'height' => 35, - //'title' => '', // override WIKINAME + //'title' => '', // override $TITLE (i.e. pagename) 'colorscheme' => 'light', // or "dark" 'show_faces' => "false", 'layout' => "standard", // or "button_count" - 'action' => "like", // or "recommend" + 'action' => "like", // or "recommend" ); } function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); extract($args); + //$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>"; - $urlargs = array("href" => $url, - "layout" => $layout, - "show_faces" => $show_faces, - "width" => $width, - "action" => "like", // or "recommend" - "colorscheme"=> $colorscheme, - "height" => $height - ); - $url = "http://www.facebook.com/plugins/like.php?href=".htmlentities(WikiUrl($pagename,$urlargs,true)); + $urlargs = array( + "layout" => $layout, + "show_faces" => $show_faces, + "width" => $width, + "action" => "like", // or "recommend" + "colorscheme"=> $colorscheme, + "height" => $height + ); + $pagename = $request->getArg('pagename'); + $url = "http://www.facebook.com/plugins/like.php?" + . "href=" . urlencode(WikiUrl($pagename,$urlargs,true)); + $url = str_replace("%3D","=",$url); $params = array("src" => $url, "scrolling" => 'no', "frameborder" => '0', "style" => "border:none; overflow:hidden; " - ."width:$width"."px; height:$height"."px;", + . "width:$width"."px; height:$height"."px;", "allowtransparency" => "true"); return HTML::iframe($params); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |