Plugin Directory

Changeset 419000


Ignore:
Timestamp:
08/03/2011 11:19:29 PM (15 years ago)
Author:
sproject
Message:

1.4.1 release

Location:
facebook-likes-you/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • facebook-likes-you/trunk/facebook-likes-you.php

    r418966 r419000  
    44Plugin URI: http://www.sproject.name/download/wp-facebook-likes-you/
    55Description: 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
     6Version: 1.4.1
    77Author: Piotr Sochalewski
    88Author URI: http://www.sproject.name/
     
    8181    add_option('fb_like_html5', 'false');
    8282    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');
    8384    add_option('fb_like_xfbml', 'true');
    8485    add_option('fb_like_google1', 'false');
     
    107108    $fb_like_settings['html5'] = get_option('fb_like_html5') === 'true';
    108109    $fb_like_settings['opengraph'] = get_option('fb_like_opengraph') === 'true';
     110    $fb_like_settings['defaultpic'] = get_option('fb_like_defaultpic');
    109111    $fb_like_settings['xfbml'] = get_option('fb_like_xfbml') === 'true';
    110112    $fb_like_settings['google1'] = get_option('fb_like_google1') === 'true';
     
    200202
    201203function fb_like_catch_image() {
    202     global $post, $posts;
     204    global $fb_like_settings, $post, $posts;
    203205    ob_start();
    204206    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   
    205211    $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;
    209219}
    210220
     
    217227        <?php if (is_home())
    218228        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() . '"/>
    222231        <meta property="og:site_name" content="<?php bloginfo('name') ?>"/>
    223232        <meta property="fb:app_id" content="<?php echo fb_like_return_appid() ?>"/>
     
    621630        <tr valign="top">
    622631            <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' ); ?>&nbsp;<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'); ?>" />&nbsp;<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>
    624633        </tr>
    625634        <tr valign="top">
  • facebook-likes-you/trunk/languages/fb_like_trans_domain-pl_PL.po

    r418966 r419000  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2011-05-03 01:22-0800\n"
    6 "PO-Revision-Date: 2011-08-03 22:57+0100\n"
     6"PO-Revision-Date: 2011-08-04 01:14+0100\n"
    77"Last-Translator: Piotr Sochalewski <sproject@sproject.name>\n"
    88"Language-Team: Piotr Sochalewski <sproject@sproject.name>\n"
     
    8181
    8282#: facebook-likes-you.php
     83msgid "Absolute path to default picture (used if not found any):"
     84msgstr "Obrazek pokazywany, gdy wpis nie zawiera żadnych grafik:"
     85
     86#: facebook-likes-you.php
     87msgid "Back to default"
     88msgstr "Przywróc domyślne"
     89
     90#: facebook-likes-you.php
    8391msgid "Your app ID:"
    8492msgstr "Twoje app ID:"
  • facebook-likes-you/trunk/languages/fb_like_trans_domain.pot

    r418966 r419000  
    7979
    8080#: facebook-likes-you.php
     81msgid "Absolute path to default picture (used if not found any):"
     82msgstr ""
     83
     84#: facebook-likes-you.php
     85msgid "Back to default"
     86msgstr ""
     87
     88#: facebook-likes-you.php
    8189msgid "Your app ID:"
    8290msgstr ""
  • facebook-likes-you/trunk/readme.txt

    r418966 r419000  
    55Requires at least: 2.9
    66Tested up to: 3.2
    7 Stable tag: 1.4
     7Stable tag: 1.4.1
    88
    99Facebook 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!
     
    4848
    4949== Changelog ==
     50
     51= 1.4.1 =
     52* Few fixes for Open Graph
    5053
    5154= 1.4 =
Note: See TracChangeset for help on using the changeset viewer.