Announcement

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

#1 2011-05-30 08:45:43

raymondbusch
New member
Registered: 2011-05-30
Posts: 1

ExtendedFileManager plugin problem

I am having a bit of trouble using PHP based plugins, such as the ExtendedFileManager.

Here is my environment.

Windows XP Professional Service Pack 2
IIS 5.1
Xinha 0.96.1
Microsoft FastCGI for IIS 5.1 and 6.0
PHP 5.3 (5.3.3) - VC9 x86 Non Thread Safe (2010-Jul-21 20:38:25)

==> I am attempting to follow the standard examples for the ExtendedFileManager plugin. The plugin seems to work fine. When I click on the Insert/Modify Image button, the new ExtendedFileManager is displayed amd appears to work. I believe that this is an indication that I have things configured correctly.

See Example Below.

  <script type="text/javascript">
    // You must set _editor_url to the URL (including trailing slash) where
    // where xinha is installed, it's highly recommended to use an absolute URL
    //  eg: _editor_url = "/path/to/xinha/";
    // You may try a relative URL if you wish]
    //  eg: _editor_url = "../";
    // in this example we do a little regular expression to find the absolute path.
    _editor_url  = document.location.href.replace(/examples\/.*/, '')
    _editor_lang = "en";      // And the language we need to use in the editor.
  </script>

  <!-- Load up the actual editor core -->
  <script type="text/javascript" src="../XinhaCore.js"></script>
  <script type="text/javascript">
    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, 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.
       ************************************************************************/

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

      /** STEP 2 ***************************************************************
       * Now, what are the names of the textareas you will be turning into
       * editors?
       ************************************************************************/

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'myTextArea'
      ];

      /** 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 4.
       *
       * If you want to modify the default config you might do something like this.
       *
       *   xinha_config = new Xinha.Config();
       *   xinha_config.width  = 640;
       *   xinha_config.height = 420;
       *
       *************************************************************************/

       xinha_config = xinha_config ? xinha_config : new Xinha.Config();
....

==> At first, no cofniguration is being done. I am just using the ExtendedFileManager using default options. It seems to work fine.

==> Next I want to try and change some of the options, such as allow_upload. I add the following to the code above (from the example).

with (xinha_config.ExtendedFileManager)
        {
            <?php

            // define backend configuration for the plugin
            $IMConfig = array();

            $IMConfig['allow_upload'] = true;

            $IMConfig['images_dir'] = 'graphics';
            $IMConfig['images_url'] = 'graphics';
            $IMConfig['files_dir'] = 'download';
            $IMConfig['files_url'] = 'download';

            $IMConfig['thumbnail_prefix'] = 't_';
            $IMConfig['thumbnail_dir'] = 't';
            $IMConfig['resized_prefix'] = 'resized_';
            $IMConfig['resized_dir'] = '';
            $IMConfig['tmp_prefix'] = '_tmp';
            $IMConfig['max_filesize_kb_image'] = 2000;
            // maximum size for uploading files in 'insert image' mode (2000 kB here)

            $IMConfig['max_filesize_kb_link'] = 5000;
            // maximum size for uploading files in 'insert link' mode (5000 kB here)

            // Maximum upload folder size in Megabytes.
            // Use 0 to disable limit
            $IMConfig['max_foldersize_mb'] = 0;
           
            $IMConfig['allowed_image_extensions'] = array("jpg","gif","png");
            $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","ip","txt",
                                                         "psd","png","html","swf",
                                                         "xml","xls");

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

==> I recieve an error on the webpage when the PHP tries to get interpreted.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; .NET4.0C; .NET4.0E; OfficeLiveConnector.1.5; OfficeLivePatch.1.3)
Timestamp: Sun, 24 Oct 2010 18:31:41 UTC

Message: Syntax error
Line: 85
Char: 7
Code: 0
URI: http://192.168.1.102/catsweb/xinha/exam … tbed2.html

==> Line: 85 is the <?php statement. I am clearly doing something wrong, I just do not know what it is.

If I make manual changes to config.inc.pho the changes work as expected. Is there a way to pass in changes via the web page?

Offline

#2 2011-05-30 20:15:56

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: ExtendedFileManager plugin problem

Is the file in which you have the above PHP statements actually being executed by PHP?  Looks like it is "testbed2.html" which in at least typical default server setups would not be parsed by PHP.


James Sleeman

Offline

Board footer

Powered by FluxBB