Changed to PHP 5. It's working. Great mod. Thanks!
Printable View
Changed to PHP 5. It's working. Great mod. Thanks!
Good, glad to hear it. Sorry I hadnt realized the php 4 thing sooner.
Hi, I have installed the autotweet mod after changing the update_product.php file but get the following errors:
Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /usr/www/users/soundoa/admin/twitter/bitly.php on line 141
{ "errorCode": 0, "errorMessage": "", "results": { "http://www.soundonline.co.za/index.php?main_page=product_info&cPath=93&products_id=427": { "hash": "cxFYvi", "shortCNAMEUrl": "http://bit.ly/9UmxW9", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/9UmxW9", "userHash": "9UmxW9" } }, "statusCode": "OK" }
Fatal error: Uncaught exception 'BitlyException' with message 'Invalid JSON-response' in /usr/www/users/soundoa/admin/twitter/bitly.php:196 Stack trace: #0 /usr/www/users/soundoa/admin/twitter/bitly.php(382): Bitly->doCall('shorten', Array) #1 /usr/www/users/soundoa/admin/includes/modules/update_product.php(146): Bitly->shorten('http://www.soun...') #2 /usr/www/users/soundoa/admin/product.php(62): require('/usr/www/users/...') #3 {main} thrown in /usr/www/users/soundoa/admin/twitter/bitly.php on line 196
I have PHP5 and cURL enabled.
I have no idea how to fix this. Please help.
I'm looking into this. In the meantime;
1. Make sure your host's PHP configuration in not in safe mode (php.ini).
2. Is open_basedir set to correct directories?
You make have to contact your hosting co. to verify.
It looks like CURLOPT_FOLLOWLOCATION doesn't work with open_basedir on. Your host may have to turn this off
fixed this.
You have to edit both bitly.php and twitter.php
on line 133 bitly.php and line 158 of twitter.php comment out
so that it looks like:PHP Code:
$options[CURLOPT_FOLLOWLOCATION] = true;
then somewhere around line 136 on bitly.php and line 161 on twitter.php add:PHP Code:
//$options[CURLOPT_FOLLOWLOCATION] = true;
Everything should work fine. (at least it did on my local machine)PHP Code:
if ( ini_get('open_basedir') == '' ) {
$options[CURLOPT_FOLLOWLOCATION] = true;
}
I have used your mod for an oscommerce shop by inserting the twitter code from update_product.php into the same place in osc's categories.php
When using your default code:
include 'twitter/twitter.php';
require_once 'twitter/bitly.php';
it's posting fine to twitter, but I'm getting this error after adding the new product:
Quote:
Fatal error: Cannot redeclare class TwitterException in /home/account/public_html/admin/twitter/twitter.php on line 1867
If I use this code instead (or require_once for both):
include_once 'twitter/twitter.php';
require_once 'twitter/bitly.php';
then I am not getting the error but my twitter post is missing the product name:
Do you have any ideas what is causing this?Quote:
I fixed it by adding if ($language_id == 1){} around the code in categories.php so it only included the code for english.
Thanks for a great mod!
Oh, good catch, and thanks I'm glad you like it.
I've installed the Autotwitter, but I can't figure out, why it doesn't work by me.
When I set up a new product, it always shows me a blanc site, and nothing happend, and the new product is not inserted.
I use Zen Cart 1.38, PHP 5, I've set the safe mode off .
Hugs Micki