Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'release/3.0.1'

  • Loading branch information...
commit 4a5068368de982c235c650c7823346a565e63d2e 2 parents bbbe964 + fae1221
Alex King authored October 16, 2012
11  README.txt
@@ -3,7 +3,7 @@ Contributors: alexkingorg, crowdfavorite
3 3
 Tags: twitter, tweet, integration, post, notify, integrate, archive, widget, shortcode, social
4 4
 Requires at least: 3.4
5 5
 Tested up to: 3.4.2
6  
-Stable tag: 3.0
  6
+Stable tag: 3.0.1
7 7
 License: GPLv2
8 8
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
9 9
 
@@ -101,7 +101,7 @@ Get creative! Here are some examples of ways to use more of the full Twitter dat
101 101
 - linking to "in reply to" tweets
102 102
 
103 103
 
104  
-== FAQ ==
  104
+== Frequently Asked Questions ==
105 105
 
106 106
 = What if I don't want to use Social's comment display? =
107 107
 
@@ -128,6 +128,13 @@ Version 3.0 is a complete rewrite that utilizes <a href="http://wordpress.org/ex
128 128
 
129 129
 == Changelog ==
130 130
 
  131
+= 3.0.1 =
  132
+
  133
+* Set categories and post tags properly on posts created from tweets
  134
+* Set GMT date explicitly for blog posts created from tweets (fixes time offset issue)
  135
+* Make enabled/disabled accounts more explicit
  136
+
  137
+
131 138
 = 3.0 =
132 139
 
133 140
 * Complete rewrite!
4  classes/aktt.php
@@ -2,7 +2,7 @@
2 2
 
3 3
 class AKTT {
4 4
 	// settings: aktt_v3_settings
5  
-	static $ver = '3.0dev';
  5
+	static $ver = '3.0.1';
6 6
 	static $enabled = false;
7 7
 	static $prefix = 'aktt_';
8 8
 	static $post_type = 'aktt_tweet';
@@ -110,7 +110,7 @@ static function set_default_settings() {
110 110
 				'label' => __('Create URLs for tweets', 'twitter-tools'),
111 111
 				'type' => 'radio',
112 112
 				'options' => array(
113  
-					'1' => sprintf(__('Yes <span class="help">(%s)</span>', 'twitter-tools'), site_url('tweet/{tweet-id}')),
  113
+					'1' => sprintf(__('Yes <span class="help">(%s)</span>', 'twitter-tools'), home_url('tweet/{tweet-id}')),
114 114
 					'0' => __('No', 'twitter-tools')
115 115
 				),
116 116
 			),
18  classes/aktt_tweet.php
@@ -470,7 +470,7 @@ function add() {
470 470
 			'post_content' => $this->content(),
471 471
 			'post_status' => 'publish',
472 472
 			'post_type' => AKTT::$post_type,
473  
-			'post_date' => date('Y-m-d H:i:s', self::twdate_to_time($this->date()) + (get_option('gmt_offset') * 3600)),
  473
+			'post_date_gmt' => date('Y-m-d H:i:s', self::twdate_to_time($this->date())),
474 474
 			'guid' => $this->guid(),
475 475
 //			'tax_input' => $tax_input, // see below...
476 476
 		));
@@ -546,13 +546,14 @@ function create_blog_post($args = array()) {
546 546
 			'post_title' => $title_prefix.$this->title(),
547 547
 			'post_content' => $post_content,
548 548
 			'post_author' => $post_author,
549  
-			'tax_input' => array(
550  
-				'category' => array($post_category),
551  
-				'post_tag' => array_map('trim', explode(',', $post_tags)),
552  
-			),
  549
+// see below
  550
+// 			'tax_input' => array(
  551
+// 				'category' => array($post_category),
  552
+// 				'post_tag' => array_map('trim', explode(',', $post_tags)),
  553
+// 			),
553 554
 			'post_status' => 'publish',
554 555
 			'post_type' => 'post',
555  
-			'post_date' => date('Y-m-d H:i:s', self::twdate_to_time($this->meta['created_at'])),
  556
+			'post_date_gmt' => date('Y-m-d H:i:s', self::twdate_to_time($this->meta['created_at'])),
556 557
 			'guid' => $this->guid().'-post'
557 558
 		);
558 559
 		$data = apply_filters('aktt_tweet_create_blog_post_data', $data);
@@ -563,6 +564,11 @@ function create_blog_post($args = array()) {
563 564
 			AKTT::log('WP_Error:: '.$this->blog_post_id->get_error_message());
564 565
 			return false;
565 566
 		}
  567
+		
  568
+		// have to set up taxonomies after the insert in case we are in a context without
  569
+		// a 'current user' - see: http://core.trac.wordpress.org/ticket/19373
  570
+		wp_set_object_terms($this->blog_post_id, intval($post_category), 'category');
  571
+		wp_set_object_terms($this->blog_post_id, array_map('trim', explode(',', $post_tags)), 'post_tag');
566 572
 
567 573
 		set_post_format($this->blog_post_id, 'status');
568 574
 		
2  twitter-tools.php
@@ -3,7 +3,7 @@
3 3
 Plugin Name: Twitter Tools
4 4
 Plugin URI: http://crowdfavorite.com/wordpress/plugins/twitter-tools/
5 5
 Description: An integration between your WordPress site and Twitter. Create posts from your tweets. Show your tweets in your sidebar. Relies on <a href="http://wordpress.org/extend/plugins/social/">Social</a>.
6  
-Version: 3.0
  6
+Version: 3.0.1
7 7
 Author: Crowd Favorite
8 8
 Author URI: http://crowdfavorite.com
9 9
 */
2  upgrade/3.0.php
@@ -160,7 +160,7 @@ function(response) {
160 160
 	echo aktt_upgrade_30_shell(__('Twitter Tools Upgrade', 'twitter-tools'), $body, $head, $foot);
161 161
 }
162 162
 
163  
-function aktt_upgrade_30_run($count = 10) {
  163
+function aktt_upgrade_30_run($count = 25) {
164 164
 	global $wpdb;
165 165
 // pull next tweet(s)
166 166
 	$count = intval($count);
2  views/admin-account.php
@@ -4,7 +4,7 @@
4 4
 
5 5
 ?>
6 6
 <div class="aktt-account">
7  
-	<h3 style="background: url(<?php echo esc_url($account->social_acct->avatar()); ?>) left top no-repeat;"><?php echo esc_html($account->social_acct->name()); ?></h3>
  7
+	<h3 style="background: url(<?php echo esc_url($account->social_acct->avatar()); ?>) left top no-repeat;"><?php echo esc_html($account->social_acct->name()); ?> <span class="aktt-account-disabled-notice"><?php _e('(disabled)', 'twitter-tools'); ?></span></h3>
8 8
 	<div class="settings">
9 9
 		<p>
10 10
 			<label for="<?php echo esc_attr(sprintf($name, 'enabled')); ?>">
31  views/admin.php
@@ -38,8 +38,7 @@
38 38
 	margin: 0;
39 39
 	padding: 0;
40 40
 }
41  
-.aktt-account-enabled {
42  
-	background: url(<?php echo esc_url(admin_url('images/yes.png')); ?>) right center no-repeat;
  41
+.aktt-account-enabled.aktt-account-collapsed {
43 42
 	color: #333;
44 43
 	opacity: 1;
45 44
 }
@@ -50,6 +49,12 @@
50 49
 	margin: 0;
51 50
 	padding: 0 0 0 58px;
52 51
 }
  52
+.aktt-account-disabled-notice {
  53
+	color: #999;
  54
+}
  55
+.aktt-account-enabled .aktt-account-disabled-notice {
  56
+	display: none;
  57
+}
53 58
 .aktt-none .aktt-account h3 {
54 59
 	cursor: default;
55 60
 }
@@ -200,13 +205,11 @@ function akttSetState(elem) {
200 205
 	var $enabled = $account.find('input.enabled');
201 206
 	var $createPosts = $account.find('input.create-posts');
202 207
 // toggle enabled icon
203  
-	if (!$settings.is(':visible')) {
204  
-		if ($enabled.is(':checked')) {
205  
-			$account.addClass('aktt-account-enabled');
206  
-		}
207  
-		else {
208  
-			$account.addClass('dim');
209  
-		}
  208
+	if ($enabled.is(':checked')) {
  209
+		$account.addClass('aktt-account-enabled');
  210
+	}
  211
+	else {
  212
+		$account.removeClass('aktt-account-enabled');
210 213
 	}
211 214
 // toggle enabled/dimmed for enabled dependent fields
212 215
 	if ($enabled.is(':checked')) {
@@ -229,18 +232,10 @@ function akttSetState(elem) {
229 232
 		var $account = $(this);
230 233
 		akttSetState($account);
231 234
 		$account.find('h3').click(function() {
232  
-			$account.removeClass('dim aktt-account-enabled').find('.settings').slideToggle(function() {
  235
+			$account.find('.settings').slideToggle(function() {
233 236
 				akttSetState($account);
234 237
 			});
235 238
 		}).end().find('input[type="checkbox"].enabled, input[type="checkbox"].create-posts').change(function() {
236  
-// 			if ($(this).filter('.create-posts').size()) {
237  
-// 				if ($(this).is(':checked')) {
238  
-// 					$account.find('.depends-on-create-posts').slideDown();
239  
-// 				}
240  
-// 				else {
241  
-// 					$account.find('.depends-on-create-posts').slideUp();
242  
-// 				}
243  
-// 			}
244 239
 			akttSetState($account);
245 240
 		});
246 241
 	});

0 notes on commit 4a50683

Please sign in to comment.
Something went wrong with that request. Please try again.