It seems that the problem is in line 24 in widgets.php
if(!is_array($userdata) || !is_array($tweets)) $error = true;
$userdata is an Object and $tweets is an Array
What can be done?
Thanks!!
So after a lot of testing I did:
$userdata = (array) $userdata;
if(!is_array($userdata) || !is_array($tweets)) $error = true;
Which in fact works…almost. It display the picture and the followers count. The thing is that there are no tweets. It only outputs the “About 10 hours ago” message
I’ll keep trying and see if I come up with something but please help me if already know the answer
Thanks!
So after a lot of testing the thing is that I don’t know why but the tweets are empty, only the user details are retrieved:
Array ( [last_twitter_id] => igogarcia [twitterwidget-3] => Array ( [last_update] => 1261513969 [user] => Array ( [profile_image_url] => http://a1.twimg.com/profile_images/480867006/iguito_normal.jpg [name] => Rodrigo Garcia [screen_name] => igogarcia [followers_count] => 119 ) [tweets] => Array ( [0] => Array ( [text] => [created_at] => [id] => ) [1] => Array ( [text] => [created_at] => [id] => ) [2] => Array ( [text] => [created_at] => [id] => ) [3] => Array ( [text] => [created_at] => [id] => ) [4] => Array ( [text] => [created_at] => [id] => ) [5] => Array ( [text] => [created_at] => [id] => ) [6] => Array ( [text] => [created_at] => [id] => ) [7] => Array ( [text] => [created_at] => [id] => ) [8] => Array ( [text] => [created_at] => [id] => ) [9] => Array ( [text] => [created_at] => [id] => ) [10] => Array ( [text] => [created_at] => [id] => ) [11] => Array ( [text] => [created_at] => [id] => ) [12] => Array ( [text] => [created_at] => [id] => ) [13] => Array ( [text] => [created_at] => [id] => ) [14] => Array ( [text] => [created_at] => [id] => ) [15] => Array ( [text] => [created_at] => [id] => ) [16] => Array ( [text] => [created_at] => [id] => ) [17] => Array ( [text] => [created_at] => [id] => ) [18] => Array ( [text] => [created_at] => [id] => ) [19] => Array ( [text] => [created_at] => [id] => ) ) ) )
I’m done with the problem. I mean, it is not a problem because it is validated as such. “There are no Tweets” therefore it can not print a thing. But the problem would be “Why are there no tweets if userdata is correctly retrieved?”
I hope you can help me out. Thanks
I’m not entirely sure but I think it’s a issue with “json_decode” when you’re running PHP <= 4. That’s the function that stores the data received from twitter into a array.
I’ve added the JSON library since this function is not available in PHP 4.x, but it doesn’t seem to work on all systems.
Thanks for answering ๐
So for it to work correctly the version of PHP has to be 5.x+ ? If the userdata was received correctly why weren’t the tweets too? It is the exact same function being called ๐
Update: I’ve contacted my provider http://www.1and1.com and asked them to enable PHP5 in my domains. I could do it manually by changing the extension to .php5 but I rather go for the global solution in the .htaccess file.
Let’s hope it works ๐
It was in fact the PHP version. I’m running PHP5 now with the great help of the 1and1 support team.
Thanks for the feedback
I have the same problem, is there anybody who can help me?
My PHP version is 5.2.4 butt I still have the error: Error while retrieving tweets. Twitter down?
Error not resolved. Most of the time I get the “Error while retrieving tweets (Twitter down?)” message in my widget. When I refresh my page (F5) several times it seems to awake suddenly. I also enabled PHP 5.2.4.
Any ideas? Quite frustrating!
Is it possible that the problem has something to do with including external URLยดs with Perl, using the PHP-command “fopen” or “curl” (allow_url_fopen)?
havin’ the same problem, can’t seem to figure it out! Any help would be appreciated.