image gallery not working - all paths look correct - please help!

Last post 08-25-2009, 4:25 PM by Eric. 3 replies.
Sort Posts: Previous Next
  •  08-22-2009, 8:33 AM 54917

    image gallery not working - all paths look correct - please help!

    hi,
     
    I have just downloaded the trial version of this for PHP (on a Windows box) and general functionality seems to be working OK.
     
    However, I can't get the image gallery functionality to work. The gallery path is as per the default, /uploads, and it has write permissions applied to it. I am getting the following error:
     
    Warning: opendir(/Uploads) [function.opendir]: failed to open dir: Invalid argument in C:\Inetpub\vhosts\amazonia.org.uk\httpdocs\22\editor\CuteEditor_Files\Dialogs\browse_Img_gallery.php on line 182
     
    I have checked the forum and the help files and this looks like it should work - please help!
     
    The test script is set up here:http://amazonia.org.uk/22/editor/test2.php
     
    thanks Toby
  •  08-22-2009, 11:18 AM 54919 in reply to 54917

    Re: image gallery not working - all paths look correct - please help!

    OK, I've made some headway partly from similar issues in other posts. It turns out the LoadHtml wasn't working either so I suspected it had something to do with the paths. I'm new to PHP but it looks like Windows (which I'm on) doesn't declare a ROOT variable. For others struggling with the same, you can declare it by pasting this at the top of the code:
     
    // let's make sure the $_SERVER['DOCUMENT_ROOT'] variable is set
    if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['SCRIPT_FILENAME'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
    }; };
    if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
    }; };
    // $_SERVER['DOCUMENT_ROOT'] is now set - you can use it as usual...

    However, gallery functions are still not working. I've tried setting all the basehref vars, both in the head, and in php, but no joy.
     
    any ideas?
     
    thanks Toby
  •  08-25-2009, 2:06 PM 55033 in reply to 54917

    Re: image gallery not working - all paths look correct - please help!

    Dear Cutesoft,
     
    I appreciate I am not a customer (yet), but I am trying to evaluate this product without success. Do you have any suggestions re the above?
     
    thanks Toby
  •  08-25-2009, 4:25 PM 55040 in reply to 55033

    Re: image gallery not working - all paths look correct - please help!

    Dear typeb:

    Please refer to :
         http://cutesoft.net/developer+guide/index.html
    Search "ImageGalleryPath", you will find a solution how you can set the the path of image gallery.
    You can remove the following code:
     
    if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['SCRIPT_FILENAME'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
    }; };
    if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
    }; };
     
    You can set 'DOCUMENT_ROOT' in the configuration file of apache. The file name is httpd.conf .
     
    Regards,
    Eric
     
View as RSS news feed in XML