Textpattern CMS support forum

You are not logged in. Register | Login | Help

#251 2013-08-05 21:06:58

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 581
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

I also noticed that when I install this plugin, it defaults to “Yes” in the “Activated” column. Does that signify some sort of error, or is that the expected behavior?

Offline

#252 2013-08-08 09:48:31

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Hi,
I’m getting this error message when saving articles (Articles are saved anyway and tweets are published):
Fatal error: Cannot use object of type stdClass as array in /Applications/MAMP/htdocs/vsv_found_cercle/textpattern/lib/txplib_misc.php(812) : eval()’d code on line 1035
Everything is fine if I disable the tweet.
I’m using arc_twitter-4.0 published on July 2, 2013.
Is there a known solution?
Thx

Last edited by NicolasGraph (2013-08-08 09:50:11)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#253 2013-08-08 10:00:37

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,160
Website

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

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#255 2013-08-08 16:02:36

Gocom
Plugin Author
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,526
Website

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

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#257 2013-08-09 14:21:56

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

@philwareham

I’m using Mamp 1.8.4.

Last edited by NicolasGraph (2013-08-09 14:22:25)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#258 2013-08-09 14:34:15

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,160
Website

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

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

It seems to be PHP Version 5.2.11.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#260 2013-08-09 15:20:18

Gocom
Plugin Author
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,526
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

NicolasGraph wrote:

It seems to be PHP Version 5.2.11.

You should have updated years ago, but that particular error is not related to your PHP version. The plugin just has errors.

Offline

Board footer

Powered by FluxBB