Changeset 419000
- Timestamp:
- 08/03/2011 11:19:29 PM (15 years ago)
- Location:
- facebook-likes-you/trunk
- Files:
-
- 1 added
- 5 edited
-
facebook-likes-you.php (modified) (6 diffs)
-
images/facebook.png (added)
-
languages/fb_like_trans_domain-pl_PL.mo (modified) (previous)
-
languages/fb_like_trans_domain-pl_PL.po (modified) (2 diffs)
-
languages/fb_like_trans_domain.pot (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
facebook-likes-you/trunk/facebook-likes-you.php
r418966 r419000 4 4 Plugin URI: http://www.sproject.name/download/wp-facebook-likes-you/ 5 5 Description: Facebook Likes You! is simple plugin which makes it easy to add Facebook Like button and widgetable Like box. It's fully configurable, so you can decide where to append the button. 6 Version: 1.4 6 Version: 1.4.1 7 7 Author: Piotr Sochalewski 8 8 Author URI: http://www.sproject.name/ … … 81 81 add_option('fb_like_html5', 'false'); 82 82 add_option('fb_like_opengraph', 'true'); 83 add_option('fb_like_defaultpic', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) . 'images/facebook.png'); 83 84 add_option('fb_like_xfbml', 'true'); 84 85 add_option('fb_like_google1', 'false'); … … 107 108 $fb_like_settings['html5'] = get_option('fb_like_html5') === 'true'; 108 109 $fb_like_settings['opengraph'] = get_option('fb_like_opengraph') === 'true'; 110 $fb_like_settings['defaultpic'] = get_option('fb_like_defaultpic'); 109 111 $fb_like_settings['xfbml'] = get_option('fb_like_xfbml') === 'true'; 110 112 $fb_like_settings['google1'] = get_option('fb_like_google1') === 'true'; … … 200 202 201 203 function fb_like_catch_image() { 202 global $ post, $posts;204 global $fb_like_settings, $post, $posts; 203 205 ob_start(); 204 206 ob_end_clean(); 207 208 if(has_post_thumbnail( $post->ID )) 209 return wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); 210 205 211 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 206 $first_img = $matches[1][0]; 207 208 return $first_img; 212 $img = $matches[1][0]; 213 214 // Oh my god! This is nasty, pathetic and ridiculous, but it's better than random image! Facebook FTW… 215 if (empty($first_img)) 216 $img = $fb_like_settings['defaultpic']; 217 218 return $img; 209 219 } 210 220 … … 217 227 <?php if (is_home()) 218 228 echo '<meta property="og:type" content="blog"/> <meta property="og:url" content="' . get_bloginfo("home") . '"/>'; 219 else echo '<meta property="og:type" content="article"/> <meta property="og:url" content="' . get_permalink() . '"/>'; ?> 220 <?php if ( (!is_home()) && (fb_like_catch_image()!='') ) 221 echo '<meta property="og:image" content="' . fb_like_catch_image(). '"/>'; ?> 229 else echo '<meta property="og:type" content="article"/> <meta property="og:url" content="' . get_permalink() . '"/>' ?> 230 <meta property="og:image" content="' . fb_like_catch_image() . '"/> 222 231 <meta property="og:site_name" content="<?php bloginfo('name') ?>"/> 223 232 <meta property="fb:app_id" content="<?php echo fb_like_return_appid() ?>"/> … … 621 630 <tr valign="top"> 622 631 <th scope="row"><?php _e("Use Open Graph:", 'fb_like_trans_domain' ); ?></th> 623 <td><input type="checkbox" name="fb_like_opengraph" value="true" <?php echo (get_option('fb_like_opengraph') == 'true' ? 'checked' : ''); ?>/> <small><?php _e("Mainly fixes an issue with wrong thumbnails. Turn off if you have another Open Graph plugin.", 'fb_like_trans_domain' ); ?>< /small></td>632 <td><input type="checkbox" name="fb_like_opengraph" value="true" <?php echo (get_option('fb_like_opengraph') == 'true' ? 'checked' : ''); ?>/> <small><?php _e("Mainly fixes an issue with wrong thumbnails. Turn off if you have another Open Graph plugin.", 'fb_like_trans_domain' ); ?><br /><?php _e("Absolute path to default picture (used if not found any):", 'fb_like_trans_domain' ); ?> <input size="40" type="text" id="fb_like_defaultpic" name="fb_like_defaultpic" style="font-size: 11px; height: 18px;" value="<?php echo get_option('fb_like_defaultpic'); ?>" /> <a onclick="document.getElementById('fb_like_defaultpic').value='<?php echo WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) . 'images/facebook.png' ?>'">[ <?php _e("Back to default", 'fb_like_trans_domain' ); ?> ]</a></small></td> 624 633 </tr> 625 634 <tr valign="top"> -
facebook-likes-you/trunk/languages/fb_like_trans_domain-pl_PL.po
r418966 r419000 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2011-05-03 01:22-0800\n" 6 "PO-Revision-Date: 2011-08-0 3 22:57+0100\n"6 "PO-Revision-Date: 2011-08-04 01:14+0100\n" 7 7 "Last-Translator: Piotr Sochalewski <sproject@sproject.name>\n" 8 8 "Language-Team: Piotr Sochalewski <sproject@sproject.name>\n" … … 81 81 82 82 #: facebook-likes-you.php 83 msgid "Absolute path to default picture (used if not found any):" 84 msgstr "Obrazek pokazywany, gdy wpis nie zawiera żadnych grafik:" 85 86 #: facebook-likes-you.php 87 msgid "Back to default" 88 msgstr "Przywróc domyślne" 89 90 #: facebook-likes-you.php 83 91 msgid "Your app ID:" 84 92 msgstr "Twoje app ID:" -
facebook-likes-you/trunk/languages/fb_like_trans_domain.pot
r418966 r419000 79 79 80 80 #: facebook-likes-you.php 81 msgid "Absolute path to default picture (used if not found any):" 82 msgstr "" 83 84 #: facebook-likes-you.php 85 msgid "Back to default" 86 msgstr "" 87 88 #: facebook-likes-you.php 81 89 msgid "Your app ID:" 82 90 msgstr "" -
facebook-likes-you/trunk/readme.txt
r418966 r419000 5 5 Requires at least: 2.9 6 6 Tested up to: 3.2 7 Stable tag: 1.4 7 Stable tag: 1.4.1 8 8 9 9 Facebook Likes You! is simple plugin which makes it easy to add Like Button and widgetable Like Box. Google +1 Button isn't a problem too! … … 48 48 49 49 == Changelog == 50 51 = 1.4.1 = 52 * Few fixes for Open Graph 50 53 51 54 = 1.4 =
Note: See TracChangeset
for help on using the changeset viewer.