• Welcome to Simple Machines Community Forum. Please login or sign up.
December 01, 2021, 07:28:39 PM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


Simple ImageShack (latest release: v3.1.3)

Started by Rik©, June 03, 2005, 02:50:34 PM

Previous topic - Next topic

vroum

Rik©, is there any way to debug the mod on a "production" forum in order to take a look at the XML return ?

It's because php_info() says cURL enabled but the mod says XML return failed, on google i've seen people having problems with cURL & .htaccess creating malformed URL s.

Thanks !
Vroum

Sakae

Rik, that's one of the greatest mods ever written.

Send you the first dollar of your contributions lol!
http://www.tigrelog.com.br
l: simple p: machines

Rik©

Quote from: Sakae on May 08, 2010, 02:26:31 PM
Rik, that's one of the greatest mods ever written.

Send you the first dollar of your contributions lol!
Thanks! Much appreciated.

@ vroum: check_curl.zip is available at the SMF Mod Site
http://custom.simplemachines.org/mods/index.php?mod=134

-Rik©


vroum


vroum

May 08, 2010, 10:35:50 PM #624 Last Edit: May 08, 2010, 10:44:26 PM by vroum
Well, check_curl.php says "curl is installed" but I was unable to upload any pic on the forum installed on that server using SIS3.0.4 & 3.0.1 both give the "XML return failed" message.

Is there any way for me to print the returned data on that forum so we can see what is wrong with it

I'm suspecting my .htaccess to mess things up but i've no idea which directive is the problem.

Regards,
Vroum.

ProfDrDenis


Rik©

Quote from: ProfDrDenis on May 09, 2010, 05:45:32 AM
Quote from: Rik© on May 07, 2010, 06:52:28 AM
Does Highslide work with other 'external' images?

please remember my problem. Any idea?
Haven't looked at this issue yet, but it should work...
Quote from: Highslide 4 SMF FeaturesWorks for thumbnails from Imageshack, Photobucket, iPicture, Radikal, Keep4u, Xs and Fotosik. (ported from digger's highslide viewer mod)
SIS only provides the links to the hosted files, so they should work fine.
Try to upload an image @ www.imageshack.us , then copy/paste the (thumbnail)url provided and see if that works.
If not i think you should contact the author of Highslide 4 SMF...

-Rik©

Rik©

Quote from: vroum on May 08, 2010, 10:35:50 PM
Well, check_curl.php says "curl is installed" but I was unable to upload any pic on the forum installed on that server using SIS3.0.4 & 3.0.1 both give the "XML return failed" message.

Is there any way for me to print the returned data on that forum so we can see what is wrong with it

I'm suspecting my .htaccess to mess things up but i've no idea which directive is the problem.

Regards,
Vroum.
did you try
allow from .imageshack.us
in your .htaccess file?

-Rik©

vroum

Quote from: Rik© on May 09, 2010, 06:24:11 AM

did you try
allow from .imageshack.us
in your .htaccess file?

-Rik©

No, i didn't do that !

1) is it wierd that i have no allow or deny directive in my htaccess ? 

2) What will it allow from imageshack.us ?

3) Do i have to add this directive to the htaccess that is in the website's root dir (/public_html/) or the one that is in my forum dir (/public_html/forum) ?

Some of the directives are:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|tiff)$ http://www.mydomain.com [R,NC] HOT link protection
php_flag display_errors off
php_value auto_append_file none
php_value auto_prepend_file none
#Redirect non-WWW to WWW URLs
#The next lines check for Email Spammers Robots and redirect them to a fake page one of the specified http user agents is ^-?$


Thanks !
Vroum.

Rik©

@vroum
No, it's not weird.
But i think the errors you get are related to the hotlink protection.
So maybe the errors disappear if you allow imageshack.us



First i'll make a work-around for the .png/.bmp bug since it will take some time to really fix it (a lot of rewriting). Then i'll start coding the new SIS, AND i will look at the other errors some of you guys/girls get.

-Rik©

ps happy Mothersday!  ;D

vroum

May 09, 2010, 06:36:26 PM #630 Last Edit: May 09, 2010, 07:39:29 PM by vroum
Sorry to announce that I couldn't get it to work  even after adding the "allow from .imageshack.us" directive & disabling the hot linking protection i'm still getting XML return failed.

Check_curl.php returned curl is installed when uploaded to / & /forums but the mod isn't working.

Is there a way to hack the mod in order to get it to print the malformed returned data ?

EDIT:  renamed .htaccess to 1.htaccess & it's still not working, i've noticed though that the sis folder & all its contents are owned by 99 (the web server)  & I can't even chmod it from 755 to 777.

RewriteBase /forums
php_flag display_errors off
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com/forums
RewriteRule (.*) http://www.example.com/forums/$1 [R=301,L]
allow from .imageshack.us


Rik©, did you ever get sis3.0.4 to work on a clean & fresh forum install without installing any previous version of SIS ?

The only forum i got it to work on is a test forum that had all the previous sis versions installed & removed before installing sis3.0.4 it's also on the same web host but on a different server than the problematic forum.

Thanks !
Vroum.

Rik©

@vroum
Sorry to say i never had the issues you have, except the permission/chmod thing.
Since you can't change permissions (and you probably also won't be able to edit/overwrite a file in the sis folder) i made you a custom version of SIS304 and attached it to this post.
It's the same as the original version, but with an extra 'echo' so the returned xml is displayed above the mod.


Soon i will release a new version of SIS v3.0.x and v3.1.x. which will have the option to use the classic upload form in case there is an error.
This way your members will still be able to upload .png and .bmp (but without the advanced options of forumtag/personaltag etc.) while i'm working on the new SIS.

-Rik©

amcapt89

Hello everyone; something strange is going on my SIS; when I try to upload a picture, after a while I get this message:

QuoteSimple ImageShack  Oops, something went wrong
(XML return failed)

Click here to try again

I'm using SMF 1.1.11, all SIS folders and files are 755.

What is going on?

Many thanks for your help!

amcapt89



Rik©

Quote from: amcapt89 on May 10, 2010, 12:30:56 PM
Hello everyone; something strange is going on my SIS; when I try to upload a picture, after a while I get this message:

QuoteSimple ImageShack  Oops, something went wrong
(XML return failed)

Click here to try again

I'm using SMF 1.1.11, all SIS folders and files are 755.

What is going on?

Many thanks for your help!

amcapt89
Is PHP extension CURL installed?
You can check this with check_curl.zip (read the readme.txt for instructions).
--> http://custom.simplemachines.org/mods/index.php?mod=134

-Rik©

vroum

Quote from: Rik© on May 10, 2010, 09:30:39 AM
@vroum
Sorry to say i never had the issues you have, except the permission/chmod thing.
Since you can't change permissions (and you probably also won't be able to edit/overwrite a file in the sis folder) i made you a custom version of SIS304 and attached it to this post.
It's the same as the original version, but with an extra 'echo' so the returned xml is displayed above the mod.


Soon i will release a new version of SIS v3.0.x and v3.1.x. which will have the option to use the classic upload form in case there is an error.
This way your members will still be able to upload .png and .bmp (but without the advanced options of forumtag/personaltag etc.) while i'm working on the new SIS.

-Rik©

:-* :-* :-* :-* :-* :-* :-* Thanks !!! i'll try  it right now...hoping to catch that bug ;)

vroum

May 10, 2010, 04:26:17 PM #635 Last Edit: May 10, 2010, 06:55:42 PM by vroum
tried to upload a gif and here is the output from the debugging echo: "Wrong file type detected for file noris_logo.gif:application/octet-stream"

Then a jpg : "Wrong file type detected for file ts600_336x204.jpg:application/octet-stream"

Then a png : "Wrong file type detected for file logo_414_80.png:application/octet-stream"

Same error, regardless of the the file type.... What do you think about it ?

EDIT:

Guess what I've found out...installed the hacked mod on the working test forum that uploads everything but .png files.
And when I upload a .png file on that working forum I get the same kind of error I got on the non working forum when uploading anything...."Wrong file type detected for file 1236.png:application/octet-stream" this is  from a forum that uploads jpg gif but not png....From what I understand/think/guess is that the curl config on the non working server is more strict than on the working server so it doesn't forgive you the slightest "coding error"/"protocol rule breaking"

Some output from phpinfo() on the NON working server:

Configure Command
'./configure' '--disable-cgi' '--disable-pdo' '--disable-posix' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-bz2' '--with-config-file-path=/usr/local/lib' '--with-config-file-scan-dir=/usr/local/lib/php.ini.d' '--with-curl=/opt/curl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-png-dir=/usr' '--with-ttf' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'

Server API Apache 2.0 Handler
ctype functions enabled

curlcURL support enabled
cURL Information libcurl/7.19.5 zlib/1.2.3 libidn/0.6.5

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.3
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

libXML support active
libXML Version 2.7.3
libXML streams enabled
Simplexml support enabled
Revision $Revision: 272374 $
Schema support enabled
XML Support active
XML Namespace Support active
libxml2 Version 2.7.3
XMLReader enabled
XMLWriter enabled

Input Validation and Filtering enabled
Revision $Revision: 288083 $
filter.default unsafe_raw unsafe_raw
filter.default_flags no value no value

EXIF Support enabled
EXIF Version 1.4 $Id: exif.c 287371 2009-08-16 14:31:27Z iliaa $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF

apache2handler
Apache API Version 20051115
Loaded Modules
core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_log_config mod_env mod_expires mod_headers mod_setenvif mod_version prefork http_core mod_mime mod_status mod_autoindex mod_info mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_php5

mime-type text/html




Thanks for the "tailored" developpment !
Vroum.

amcapt89

May 10, 2010, 08:24:57 PM #636 Last Edit: May 10, 2010, 09:03:19 PM by amcapt89
I checked the cURL, as you reccomended. And it is correctly installed.

I tried to re-install the package, but it did not work.

It's strange though, as it was working perfectly fine a couple of days ago, and now it doesn't work at all. Any other idea?

EDIT: Apparently it does not work for me only; infact another guy tried it, and it was working just fine... What is the problem with me?

Many thanks.

amcapt89

BWJM

Quote from: LondonDragon on May 07, 2010, 03:06:44 AM
Now everytime I try to upload an image I get this error:

Quote
  Oops, something went wrong
(XML return failed)

Click here to try again

Any ideas? Thanks

@ Rik©:

I am currently using v3.0.3 of SIS and I ran into the above issue as well. Doing some further investigation (and I admit, I ravaged your code a little in the process), I determined that the ImageShack API was returning the following:

<links>
<error id="wrong_file_type">Wrong file type detected for file filename:application/octet-stream</error>
</links>

After pulling my hair out for over an hour, I found out that you can specify the content type of an attachment by appending the type to the end of the file name.

More details are on the hxxp:php.net [nonactive] sitebelow (go to the comment from obones_remove_me at free dot fr on 27-Apr-2010 10:27):
hxxp:ca.php.net/manual/en/function.curl-setopt.php#97591 [nonactive]
EDIT: Apparently links have been deliberately broken on this site. I can understand why. Anyway, just copy and paste the above and replace the hxxp: with http://. Duh.

More to the point, how do you fix SIS v3.0.3?

In SISxmlapi.php, make the following changes:

1. Look for the following line of code:
$xmlString = uploadToImageshack($dest);
and replace it with:
$xmlString = uploadToImageshack($dest, $_FILES['fileupload']['type']);

2. Look for the following line of code:
function uploadToImageshack($filename) {
and replace it with:
function uploadToImageshack($filename, $sFileType) {

3. Look for the following line of code:
$post['fileupload']='@'.$filename;
and replace it with:
$post['fileupload']='@'.$filename.";type=".$sFileType;

The above solution has worked for me and I'm back in business now. I thought I would share the solution with you and the rest of the community here so that more people can get themselves back in business soon too.

Cheers,

Sakae

The solution from BWJM worked great!!

I haven't realized that this MOD stopped worked from a few days ago... I tested once, worked great, but then every upload gave me xml error.

But I did this changes BWJM suggested and now I'm back on business too :)
http://www.tigrelog.com.br
l: simple p: machines

Rik©

May 11, 2010, 03:44:52 AM #639 Last Edit: May 11, 2010, 08:30:16 AM by Rik©
Thanks BWJM.
Hope you still have some hair left  ;D

When i find the time i will release the 'official' fix today.

-Rik©

update:
Quote from: obones_remove_me at free dot frNote that this has been reported not to work in all versions of PHP
also working on SISv4 with a new 'engine' which will (hopefully) also work with older php/libcurl.

Advertisement: