Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix for Facebook like.

  • Loading branch information...
commit 6d181b8664114f9224da41e6cb89f01887ae93f4 1 parent 48e0703
@goodpic authored
View
19 plugins/OpenGraphLike/lib/OpenGraphLike.pm
@@ -63,13 +63,19 @@ sub _hdlr_facebook_button {
my ($ctx, $args, $cond) = @_;
my $blog = $ctx->stash('blog') or return '';
my $config = MT->component("OpenGraphLike")->get_config_hash("blog:" . $blog->id);
-
my $entry = $ctx->stash('entry');
my %og = &_get_og($blog, $entry, $config);
my $show_faces = "false";
- my $height = $config->{'fb_layout'} eq "button_count" ? 21 : 35;
-
+ my $send = "false";
+ my $height = 35;
+ if ($config->{'fb_layout'} eq "button_count") {
+ $height = 21;
+ } elsif ($config->{'fb_layout'} eq "box_count") {
+ $height = 90;
+ }
+
+ if ( $config->{'fb_send'} ) { $send = "true";}
if ( $config->{'fb_faces'} ) {
$show_faces = "true";
unless ($config->{'fb_layout'} eq "button_count") { $height = 80;}
@@ -78,14 +84,15 @@ sub _hdlr_facebook_button {
. MT::Util::encode_url($og{'og:url'})
. '&layout=' . $config->{'fb_layout'}
. '&show_faces=' . $show_faces
+ . '&send=' . $send
. '&width=' . $config->{'fb_width'}
+ . '&height=' . $height
. '&action=' . $config->{'fb_verb'}
. '&font=' . $config->{'fb_font'}
. '&colorscheme=' . $config->{'fb_color'}
- . '&height=' . $height
. '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; '
- . 'width:' . $config->{'fb_width'}
- . '; height: ' . $height . 'px;" allowTransparency="true"></iframe>';
+ . 'width:' . $config->{'fb_width'}
+ . 'px; height: ' . $height . 'px;" allowTransparency="true"></iframe>';
return $like;
}
View
6 plugins/OpenGraphLike/lib/OpenGraphLike/L10N/ja.pm
@@ -21,9 +21,9 @@ our %Lexicon = (
'Tall with count' => '縦長 (数を表示)',
'Horizontal with count' => '横長 (数を表示)',
'Horizontal without count' => '横長 (数なし)',
- '' => '',
- '' => '',
- '' => '',
+ 'Standard' => 'テキストでLike数を表示',
+ 'Button_Count' => '横長ボタン',
+ 'Box_Count' => '縦長ボタン',
'' => '',
);
View
10 plugins/OpenGraphLike/tmpl/blog_config.tmpl
@@ -69,15 +69,17 @@
<mtapp:setting id="fb_layout" label="<__trans phrase='Button Size'>" hint="Standard - displays social text to the right of the button and friends' profile photos below. Minimum width: 225 pixels. Default width: 450 pixels. Height: 35 pixels (without photos) or 80 pixels (with photos).<br /> Button_count - displays the total number of likes to the right of the button. Minimum width: 90 pixels. Default width: 90 pixels. Height: 20 pixels." show_hint="1">
+
<select name="fb_layout" id="fb_layout">
- <option value="standard"<mt:if var="fb_layout" eq="standard"> selected="selected"</mt:if>>Standard</option>
- <option value="button_count"<mt:if var="fb_layout" eq="button_count"> selected="selected"</mt:if>>Button_Count</option>
+ <option value="standard"<mt:if var="fb_layout" eq="standard"> selected="selected"</mt:if>><__trans phrase='Standard' /></option>
+ <option value="button_count"<mt:if var="fb_layout" eq="button_count"> selected="selected"</mt:if>><__trans phrase='Button_Count' /></option>
+ <option value="box_count"<mt:if var="fb_layout" eq="box_count"> selected="selected"</mt:if>><__trans phrase='Box_Count' /></option>
</select>
</mtapp:setting>
-<mtapp:setting id="fb_send" label="<__trans phrase='Send Button'>" hint="" show_hint="0">
+<!-- <mtapp:setting id="fb_send" label="<__trans phrase='Send Button'>" hint="" show_hint="0">
<input type="checkbox" name="fb_send" id="fb_send" value="1" <mt:if name="fb_send"> checked="checked"</mt:if> />
-</mtapp:setting>
+</mtapp:setting> -->
<mtapp:setting id="fb_faces" label="<__trans phrase='Show Faces'>" hint="specifies whether to display profile photos below the button (standard layout only)" show_hint="1">
<input type="checkbox" name="fb_faces" id="fb_faces" value="1" <mt:if name="fb_faces"> checked="checked"</mt:if> />
Please sign in to comment.
Something went wrong with that request. Please try again.