Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#253 2013-08-08 10:00:37
Re: TXP Tweet: arc_twitter and arc_twitter_intents
@NicolasGraph
What version of PHP are you running in MAMP? Then I’ll try to replicate the error as well.
Offline
#254 2013-08-08 15:01:14
Re: TXP Tweet: arc_twitter and arc_twitter_intents
Mostly not related to any of the errors reported on this thread since the release of v4.0, below there is a diff of changes (fixes) that I made to my patched version (previous to the release of v4.0) that it seems that Andy didn’t port to v4.0. Not sure if he missed them, or if there was any good reason not to port them.
global $prefs,$txpcfg,$arc_twitter_consumerKey,$arc_twitter_consumerSecret;
$arc_twitter = array();
@@ -156,9 +105,9 @@
switch ($timeline) {
case 'home': case 'friends':
- $timeline = 'statuses/friends_timeline'; break;
+ $timeline = 'statuses/home_timeline'; break;
case 'mentions':
- $timeline = 'statuses/mentions'; break;
+ $timeline = 'statuses/mentions_timeline'; break;
case 'user': default: $timeline = 'statuses/user_timeline';
}
@@ -546,7 +495,7 @@
$sql = "CREATE TABLE IF NOT EXISTS ".PFX."arc_twitter ";
$sql.= "(arc_twitterid INTEGER AUTO_INCREMENT PRIMARY KEY,
article_id INTEGER(11),
- tweet_id BIGINT(20),
+ tweet_id VARCHAR(100),
tweet VARCHAR(140),
tinyurl VARCHAR(30));";
@@ -695,7 +644,7 @@
),
'arc_twitter_suffix' => array(
'label' => 'Tweet suffix',
- 'value' => $prefix
+ 'value' => $suffix
),
'arc_twitter_tweet_default' => array(
'label' => 'Tweet articles by default',
@@ -891,11 +840,10 @@
$id = strip_tags(gps('id'));
if ($id) {
- $twit->delete('statuses/destroy'.$id);
+ $twit->delete('statuses/destroy/'.$id);
safe_delete('arc_twitter',"tweet_id = $id");
- }
-
pagetop('Twitter','Twitter updated');
+ }
} else {
@@ -944,7 +892,7 @@
$out.= tr(td($date,'span')
.td(arc_Twitter::makeLinks(htmlentities($tweet->text
, ENT_QUOTES,'UTF-8')))
- .td(dLink('arc_admin_twitter','delete','id',$tweet->id,''))
+ .td(dLink('arc_admin_twitter','delete','id',$tweet->id_str,''))
);
}
@@ -1083,7 +1031,7 @@
, $prefs['arc_twitter_accessTokenSecret']);
$result = $twit->post('statuses/update', array('status' => $tweet));
- $tweet_id = (is_object($result)) ? $result[0]->id : 0;
+ $tweet_id = (is_object($result)) ? $result->id_str : 0;
if ($tweet_id) {
@@ -2448,499 +2396,3 @@
return implode('&', $pairs);
}
}
It fixes:
- changes in the API URLs (
friends_timeline
>home_timeline
,mentions
>mentions_timeline
,statuses/destroy
>statuses/destroy/
). - Tweet IDs saved now as a string (
varchar(100)
), as the API returns it as an string (this is related to the Tweetpocalypse). - a minor issue with the prefix/suffix functionality provided by the plugin.
The above is the output of command: diff -uw arc_twitter_v4.0.php arc_twitter_v3.3.1_patched.php
. So, the lines marked with +
are the ones I’ve changed/added
BTW, ignore the line numbers in the diff, as they won’t probably match yours (as I’m using the plugin from plugin_cache_dir, exported using the Bloke’s Plugin Composer).
Offline
#255 2013-08-08 16:02:36
Re: TXP Tweet: arc_twitter and arc_twitter_intents
maniqui wrote:
It fixes
Julián, Andy has made a git repository available for the plugin’s development and contributions. If Andy doesn’t find interest or time to manually patch the code base, the easiest way to merge the changes could be by a pull request.
Offline
#256 2013-08-08 17:53:01
Re: TXP Tweet: arc_twitter and arc_twitter_intents
Oh, thanks Gocom. Totally missed there was a repository. Would have I known about it before, I’d have sent the patches as pull requests. Will look to send these changes as atomic patch when I’ve some time.
Offline
#257 2013-08-09 14:21:56
Offline
#258 2013-08-09 14:34:15
Re: TXP Tweet: arc_twitter and arc_twitter_intents
@NicolasGraph
Sorry, I mean within MAMP, which version of PHP are you running. MAMP lets you choose a specific PHP version.
You can also find out PHP version by placing a info.php file in your site root and running it…
<?php phpinfo(); ?>
Offline
#259 2013-08-09 14:48:12
Offline
#260 2013-08-09 15:20:18
Offline
#261 2013-09-04 16:28:32
Re: TXP Tweet: arc_twitter and arc_twitter_intents
It’s coming online and I still have the same problem when I save articles.
Fatal error: Cannot use object of type stdClass as array in […]/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 1035
Anyone?
Edit: this fix by Juliàn (in this previous post) works great (thanks!) :
- $tweet_id = (is_object($result)) ? $result[0]->id : 0;
+ $tweet_id = (is_object($result)) ? $result->id_str : 0;
Last edited by NicolasGraph (2013-09-04 17:21:40)
Offline
#262 2013-09-04 18:28:31
Re: TXP Tweet: arc_twitter and arc_twitter_intents
I still have a small problem in the date encoding.
In french, “août” becomes “août” I know it’s about UTF-8 but… ???
Last edited by NicolasGraph (2013-09-04 18:28:48)
Offline
#263 2013-11-27 22:51:40
Re: TXP Tweet: arc_twitter and arc_twitter_intents
A new version of arc_twitter is available for download with some bug fixes. Sorry for the long delay in patching up the plugin. I haven’t forgotten it. In fact, I am working on a new feature so stay tuned.
Offline
#264 2013-11-30 09:52:08
- adamr
- Member
- Registered: 2011-08-01
- Posts: 10
Re: TXP Tweet: arc_twitter and arc_twitter_intents
Hi all, apologies if this has already been addressed but I’ve had a scan of the thread and can’t see it.
Tag error: <txp:arc_twitter etc etc /> -> Warning: file_put_contents(): Exclusive locks may only be set for regular files while parsing form None on page default
Anyone seen this before?
Offline