Plugin Directory

Changeset 544549


Ignore:
Timestamp:
05/15/2012 04:05:48 PM (14 years ago)
Author:
bemcapaz
Message:

update javascript sdk and fix the link to the comments url

Location:
seo-facebook-comments/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • seo-facebook-comments/trunk/readme.txt

    r533346 r544549  
    99Requires at least: 2.9
    1010
    11 Tested up to: 3.3.1
    12 
    13 Stable tag: 1.4.4
     11Tested up to: 3.3.2
     12
     13Stable tag: 1.4.5
    1414
    1515This plugin will insert a Facebook Comment Form, Open Graph Tags and ALSO insert all Facebook Comments into your Wordpress Database for better SEO.
     
    102102
    103103== Changelog ==
     104
     105= 1.4.5 =
     106
     107* <strong>FIXED</strong> Comments are saved/retrieved through the page permalink, and not by it's id
     108* <strong>TWEAK</strong> Updated Javascript SDK
    104109
    105110= 1.4.4 =
     
    194199== Upgrade Notice ==
    195200
     201= 1.4.5 =
     202
     203* Fixes and Tweaks. Upgrade Highly Advisable
     204
    196205= 1.4.4 =
    197206
  • seo-facebook-comments/trunk/seofacebook.php

    r533362 r544549  
    44 * Plugin URI: http://www.plulz.com
    55 * Description: This plugin will insert a Facebook Comment Form, Open Graph Tags and ALSO insert all Facebook Comments into your Wordpress Database for better SEO.
    6  * Version: 1.4.4
     6 * Version: 1.4.5
    77 * Author: Fabio Zaffani
    88 * Author URI: http://www.plulz.com
     
    308308        {
    309309            if (!isset($this->options['openGraphTags']) )
     310            {
    310311                return;
    311            
    312             global $wp_query;
    313 
    314             $postId = $wp_query->post->ID;
    315 
    316             //$postUrl = get_permalink($postId);
    317 
    318             $siteName = get_bloginfo('name');
    319             $appId = $this->options['app'];
    320 
    321             if ( is_home() || is_search() )
    322             {
    323                 $postTitle = $siteName;
    324                 $postUrl = home_url();
     312            }
     313
     314            global $wp_query;
     315
     316            $postId = $wp_query->post->ID;
     317            $postUrl = get_permalink($postId);
     318            $siteName = get_bloginfo('name');
     319            $appId = $this->options['app'];
     320
     321            if ( is_home() || is_search() )
     322            {
     323                $postTitle = $siteName;
    325324            }
    326325            else if ( is_category() )
    327             {
    328                 $category = get_the_category();
    329                 $postTitle = $category[0]->cat_name . ' - ' . $siteName;
    330                 $postUrl = home_url('?cat='.$category[0]->term_id);
    331             }
    332             else
    333             {
    334                 $postUrl = home_url('?p='.$postId);
     326            {
     327                $category = get_the_category();
     328                $postTitle = $category[0]->cat_name . ' - ' . $siteName;
     329            }
     330            else
     331            {
    335332                $postTitle = single_post_title('', false);
    336333            }
     334
    337335
    338336            // Avoid OG errors by making sure exists a Admin ID
     
    368366            $lang = $this->options['language'];
    369367
    370             $js = " <div id='fb-root'></div>
    371                 <script>
    372                   window.fbAsyncInit = function() {
    373                     FB.init({
    374                       appId  : {$appID},
    375                       status : true, // check login status
    376                       cookie : true, // enable cookies to allow the server to access the session
    377                       xfbml  : true  // parse XFBML
    378                     });
    379                   };
    380 
    381                   (function() {
    382                     var e = document.createElement('script');
    383                     e.src = document.location.protocol + '//connect.facebook.net/{$lang}/all.js';
    384                     e.async = true;
    385                     document.getElementById('fb-root').appendChild(e);
    386                   }());
    387                 </script>";
    388 
    389                echo $js;
     368            $js = "<div id='fb-root'></div>
     369                <script type=\"text/javascript\">
     370                    window.fbAsyncInit = function() {
     371                        FB.init({
     372                          appId      : '{$appID}', // App ID
     373                          status     : true, // check login status
     374                          cookie     : true, // enable cookies to allow the server to access the session
     375                          xfbml      : true  // parse XFBML
     376                        });
     377
     378                        // Additional initialization code here
     379                      };
     380
     381                      // Load the SDK Asynchronously
     382                      (function(d){
     383                         var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     384                         if (d.getElementById(id)) {return;}
     385                         js = d.createElement('script'); js.id = id; js.async = true;
     386                         js.src = \"//connect.facebook.net/{$lang}/all.js\";
     387                         ref.parentNode.insertBefore(js, ref);
     388                   }(document))
     389                </script>";
     390
     391            echo $js;
    390392        }
    391393
Note: See TracChangeset for help on using the changeset viewer.