Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-05-20 17:49:47

epearson
New member
Registered: 2007-10-14
Posts: 9

Extended File Manager Help

I have 2 issues with creating links and uploading files. I think I am using Extended File Manager for both.
The first is that I can't upload documents, when we do, i get an error:
"failed to open stream: permission denied in ../../scripts/xinha/plugins/ImageManager/Classes/Files.php on line 65"

The second problem is that I am using Xinha in a sub-folder called "admin" and when I create a link to a relative path like dir/file.php, I end up with admin/dir/file.php. I am NOT using the linker to browse to the file, but rather just typing in the path.  I think I have the right path in my config, but could be wrong.

Thanks for any help.  I did update to .95 just yesterday if it makes any difference.

I have attached my config at the bottom to help.

<!--
xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
   /** STEP 1 ***************************************************************
   * First, specify the textareas that shall be turned into Xinhas.
   * For each one add the respective id to the xinha_editors array.
   * I you want add more than on textarea, keep in mind that these
   * values are comma seperated BUT there is no comma after the last value.
   * If you are going to use this configuration on several pages with different
   * textarea ids, you can add them all. The ones that are not found on the
   * current page will just be skipped.
   ************************************************************************/
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'content'
  ];
 
  /** STEP 2 ***************************************************************
   * Now, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   *
   * The list of plugins below is a good starting point, but if you prefer
   * a simpler editor to start with then you can use the following
   *
   * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
   *
   * which will load no extra plugins at all.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
       'CharacterMap',
       'ContextMenu',
       'ListType',
       'DoubleClick',
      'ExtendedFileManager',
      'Linker',
      'SpellChecker'
  ];
 
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;


  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new Xinha.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
          xinha_config.width  = '500px';
       xinha_config.height = '600px';
       xinha_config.toolbar =
    [
   ["fontsize","bold","italic","underline","strikethrough"],
      ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
   ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
   ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
   ["linebreak","separator","undo","redo","selectall"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
   ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],

];

xinha_config.ExtendedFileManager.use_linker = true;
      
     if (xinha_config.ExtendedFileManager) {
           with (xinha_config.ExtendedFileManager)
        {
            <?php

            // define backend configuration for the plugin
            $IMConfig = array();
            $IMConfig['images_dir'] = '../../../../images/cms_misc';
            $IMConfig['images_url'] = 'http://test.bgmailing.com/images/cms_misc';
            $IMConfig['files_dir'] = '../../../../docs/';
            $IMConfig['files_url'] = 'http://test.bgmailing.com/docs/';
           
            $IMConfig['thumbnail_prefix'] = 't_';
            $IMConfig['thumbnail_dir'] = 't';
            $IMConfig['resized_prefix'] = 'resized_';
            $IMConfig['resized_dir'] = '';
            $IMConfig['tmp_prefix'] = '_tmp';
            $IMConfig['max_filesize_kb_image'] = 100;
            // maximum size for uploading files in 'insert image' mode (2000 kB here)
            $IMConfig['max_filesize_kb_link'] = 5000;
            // Maximum upload folder size in Megabytes.
            // Use 0 to disable limit
            $IMConfig['max_foldersize_mb'] = 0;
           
            $IMConfig['allowed_image_extensions'] = array("jpg","gif");
            $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","txt",
                                                         "xml","xls","doc");


            require_once '../scripts/xinha/contrib/php-xinha.php';
            xinha_pass_to_php_backend($IMConfig);
           
            ?>

Offline

#2 2008-05-21 12:36:59

epearson
New member
Registered: 2007-10-14
Posts: 9

Re: Extended File Manager Help

I see what happened on the links, when I make the path relative starting with no slash it just append the location it is currently at, so we will just interest the links with absolute path.

The second problem with the uploading may be a permission problem. I was on an IIS server and it worked, but have since moved all the code to Apache and there may be some issue there.

If anyone else has any thoughts on my error, please let me know.

Offline

Board footer

Powered by FluxBB