Changeset 990247
- Timestamp:
- 09/15/2014 02:17:45 PM (11 years ago)
- Location:
- sm2wp-google-minimal
- Files:
-
- 10 added
- 5 edited
-
tags/1.1.6 (added)
-
tags/1.1.6/classes (added)
-
tags/1.1.6/classes/common.php (added)
-
tags/1.1.6/classes/google_plus.php (added)
-
tags/1.1.6/classes/sm2wp_googleplus.php (added)
-
tags/1.1.6/classes/sm2wp_googleplus_admin.php (added)
-
tags/1.1.6/readme.txt (added)
-
tags/1.1.6/sm2wp.php (added)
-
tags/1.1.6/views (added)
-
tags/1.1.6/views/admin.php (added)
-
trunk/classes/google_plus.php (modified) (8 diffs)
-
trunk/classes/sm2wp_googleplus.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sm2wp.php (modified) (1 diff)
-
trunk/views/admin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sm2wp-google-minimal/trunk/classes/google_plus.php
r989546 r990247 70 70 protected $_author_url; 71 71 72 public $reshares = 0; 73 public $plusones = 0; 74 72 75 public function __construct($parent, $id, $url, $type, $content, $date, $annotation='', $poster=null, $poster_url, $images=array(), $video=null, $article=array(), $album=array()) { 73 76 $this->id = $id; … … 89 92 $this->_video = $video; 90 93 $this->_article = $article; 91 92 94 } 93 95 … … 176 178 '{{google-url}}', 177 179 '{{album-title}}', 178 '{{album-url}}'), 180 '{{album-url}}', 181 '{{plusones}}', 182 '{{reshares}}'), 179 183 array($this->get_title(), 180 184 $this->_images ? $this->_images[0]['full'] : '', … … 191 195 $this->url, 192 196 $albumTitle, 193 $albumUrl), 197 $albumUrl, 198 $this->plusones, 199 $this->reshares), 194 200 $content); 195 201 … … 300 306 } else if (get_option('gfw_overwrite', true)) { 301 307 wp_update_post($wp_post); 308 if (!has_post_thumbnail($this->postId) && get_option('gfw_featured_images', false) && $this->_images) { 309 $this->_add_featured_image($this->postId); 310 } 311 302 312 } 303 313 … … 453 463 } 454 464 455 if (!$r &&$s != 200) {465 if (!$r || $s != 200) { 456 466 log_running("Unable to fetch posts for ".$this->name.'. ('.$s.')'); 457 467 return; … … 461 471 $pageToken = @$r->nextPageToken; 462 472 463 foreach ( $r->items as $post) {473 foreach (@$r->items as $post) { 464 474 if (!in_array($post->provider->title, array('Google+', 'HootSuite', 'Mobile', 'Photos', 'Google Reader', 'Reshared Post', 'Community', 'Buffer', ''))) continue; 465 475 $posts++; 466 476 if ($posts > get_option('gfw_history', 10)) break; 467 477 $p = new GFW_Post($this, $post->id, $post->url, $post->verb, trim($post->object->content), $post->published, @$post->annotation, @$post->object->actor->displayName, @$post->actor->url); 468 478 $p->plusones = $post->object->plusoners->totalItems; 479 $p->reshares = $post->object->resharers->totalItems; 469 480 if (!@$post->object->attachments) $post->object->attachments = array(); 470 481 foreach ($post->object->attachments as $a) { … … 539 550 $id = $this->id; 540 551 list($s, $r) = SM2WP_GooglePlus_Library::get(SM2WP_AUTH_URL.'r/'.$id.'/'); 541 if ( $s &&$s != 200) {542 log_ error('Connection lost to "'.$this->name.'" please connect network again.');552 if (!$r || $s != 200) { 553 log_running('Unable to refresh access for "'.$this->name.'" you may need to reconnect it.'); 543 554 return; 544 555 } -
sm2wp-google-minimal/trunk/classes/sm2wp_googleplus.php
r989017 r990247 6 6 7 7 class SM2WP_GooglePlus { 8 public static $slug = 'sm2wp-googleplus';9 protected static $instance = null;8 public static $slug = 'sm2wp-googleplus'; 9 protected static $instance = null; 10 10 11 private function __construct() {12 add_action( 'wpmu_new_blog', array($this, 'activate_new_site'));13 add_filter('get_avatar', array($this, 'avatar_replace'), 10, 5);14 if (!get_option('gfw_ignore_canonical', false)) {15 add_action('wp_head', array($this, 'canonical_add'));16 remove_action('wp_head', 'rel_canonical');17 }11 private function __construct() { 12 add_action( 'wpmu_new_blog', array($this, 'activate_new_site')); 13 add_filter('get_avatar', array($this, 'avatar_replace'), 10, 5); 14 if (!get_option('gfw_ignore_canonical', false)) { 15 add_action('wp_head', array($this, 'canonical_add')); 16 remove_action('wp_head', 'rel_canonical'); 17 } 18 18 19 add_action('gfw_import', array('SM2WP_GooglePlus', 'run'));19 add_action('gfw_import', array('SM2WP_GooglePlus', 'run')); 20 20 21 }21 } 22 22 23 23 -
sm2wp-google-minimal/trunk/readme.txt
r989852 r990247 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.0 7 Stable tag: 1.1. 57 Stable tag: 1.1.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == Changelog == 50 50 51 = 1.1.6 = 52 * Reshare count template tag added {{reshares}} 53 * +1 count template tag added {{plusones}} 54 * Better capturing of request errors 55 * Misc fixes 56 51 57 = 1.1.5 = 52 58 * HTTP Request changes to support hosts not giving status codes -
sm2wp-google-minimal/trunk/sm2wp.php
r989546 r990247 4 4 * Plugin URI: http://sm2wp.com 5 5 * Description: Import your Google+ Posts to your WordPress Blog 6 * Version: 1.1. 56 * Version: 1.1.6 7 7 * Author: Daniel Treadwell 8 8 * Author URI: http://minimali.se -
sm2wp-google-minimal/trunk/views/admin.php
r989546 r990247 80 80 QTags.addButton( 'gfw_content', 'Content', '{{content}}'); 81 81 QTags.addButton( 'gfw_post_url', 'G+ Post URL', '{{google-url}}'); 82 QTags.addButton( 'gfw_plusones', '+1 Count', '{{plusones}}'); 83 QTags.addButton( 'gfw_reshares', 'Reshare Count', '{{reshares}}'); 82 84 83 85 }); … … 206 208 <p><b>{{content}}</b> This content of the post (or reshared post)</p> 207 209 <p><b>{{google-url}}</b> The link of the post on Google+</p> 210 <p><b>{{plusones}}</b> The number of +1s a post received</p> 211 <p><b>{{reshares}}</b> The number of times a post was reshared</p> 208 212 <p><hr /></p> 209 213 <p><b>{{if-reshare-start}}</b> Keep reshare specific information between the start and end tags</p>
Note: See TracChangeset
for help on using the changeset viewer.