Announcement

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

#1 2010-10-24 14:34:56

p-buchanan
New member
Registered: 2009-07-31
Posts: 4

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 2010-10-24 19:55:48

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

Re: ExtendedFileManager plugin problem

Sounds to me like your .html is not being parsed by PHP.  Have you configured your IIS to run .html as PHP?


James Sleeman

Offline

#3 2010-10-25 10:50:01

p-buchanan
New member
Registered: 2009-07-31
Posts: 4

Re: ExtendedFileManager plugin problem

Hi James,
  Thank you for your response! That may be what the problem is. In this case, it is a ,asp page that contains both the javascript and the PHP. I am not really familiar with PHP, and am trying to understand how all of this works together.

==> Here are the steps that one must follow to get FastCGI to interpret .PHP pages.

Configure the FastCGI extension to handle PHP-specific requests by running the command shown below. Replace the value of the "-path" parameter with the absolute file path to the php-cgi.exe file.

Example #2 Configuring FastCGI extension to handle PHP requests

cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^
-extension:php -path:"C:\PHP\php-cgi.exe"

This command will create an IIS script mapping for *.php file extension, which will result in all URLs that end with .php being handled by FastCGI extension. Also, it will configure FastCGI extension to use the executable php-cgi.exe to process the PHP requests.

==> Would I need to to something similar for .HTML and or .ASP pages? Is this what you are recommending, or is there some other step that one must take?

Pat

Offline

#4 2010-10-25 18:15:29

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

Re: ExtendedFileManager plugin problem

Can't help you with IIS/Windows server configuration.

Typically you can't use asp and php both in a page.  One or the other.  Name your file .php, or port php-xinha.php to asp.


James Sleeman

Offline

Board footer

Powered by FluxBB