Announcement

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

#1 2011-01-31 13:59:14

Number208
New member
Registered: 2011-01-31
Posts: 6

ExtendedFileManager UGH!!!!

Before I start, apologies for being a retard. I can't get this figured out even after exhausting these forums as well as others.

I have two problems, both of which are probably related.

Problem 1) The Upload button doesn't come up, even though I have...

$IMConfig['allow_upload'] = true;

...set in the page where I'm using the EFM, lets call that page edit.php

Problem 2) Even though I've set the image_dir etc etc paths as well as what I'm able to, it always goes back to...

xinha/plugins/ExtendedFileManager/demo_images/

...ignoring my config.

Here are the paths of the various files and folders in question:

http://www.mysite.com/    <--Site Root
http://www.mysite.com/uploads/   <--Where I want my uploads to go to (I have given this folder "777" permissions which should cover everything)
http://www.mysite.com/secure/xinha/  <--This is where the Xinha folder is located.
http://www.mysite.com/secure/pages/edit.php   <--This is where I'm using Xinha and the EFM plugin, with the $IMConfig settings etc, all in this file.

The .JS file (inside edit.php) is referenced with...
<script type="text/javascript" src="../xinha/XinhaCore.js"></script>

Currently I'm using these settings, which clearly don't work...

$IMConfig['images_dir'] = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], 'secure')).'imgs/';
$IMConfig['images_url'] = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'secure')).'imgs';
$IMConfig['files_dir'] = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], 'secure')).'files/';
$IMConfig['files_url'] = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'secure')).'files';

Can one of you gurus please help me out? I've gone through SO many WYSIWYG editors and image managers, I cannot afford not to get this working, again.

PLEEEASE.

Offline

#2 2011-01-31 18:29:37

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

Re: ExtendedFileManager UGH!!!!

1. I do not recommend EFM, use MFM (MootoolsFileManager) instead if possible.
2. Are you setting _editor_url etc correctly.
3. What manner are you using for passing your configuration to the EFM.
4. Have you confirmed that your server is parsing your config correctly.
5. Have you observed the error console of your browser.


James Sleeman

Offline

#3 2011-01-31 18:30:25

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

Re: ExtendedFileManager UGH!!!!


James Sleeman

Offline

#4 2011-02-01 01:14:13

Number208
New member
Registered: 2011-01-31
Posts: 6

Re: ExtendedFileManager UGH!!!!

gogo wrote:

1. I do not recommend EFM, use MFM (MootoolsFileManager) instead if possible.
2. Are you setting _editor_url etc correctly.
3. What manner are you using for passing your configuration to the EFM.
4. Have you confirmed that your server is parsing your config correctly.
5. Have you observed the error console of your browser.

1. I can't find a decent download/demo link for Mootools, they are all either dead or point nowhere.
2. I'm setting _editor_url as:

_editor_url  = "http://www.mysite.com/secure/xinha/"   

..that is from within the edit.php page, see above how that page relates to where Xinha is installed, it should be correct?

3. If I am understanding you correctly, I'm keeping all my Xinha/EFM code in the edit.php page, here's the code block for the sake of completeness.

  <script type="text/javascript">
    _editor_url  = "http://www.mysite.com/secure/xinha/"   // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";       // And the language we need to use in the editor.
    _editor_skin = "silva";    // If you want use a skin, add the name (of the folder) here
    _editor_icons = "classic"; // If you want to use a different iconset, add the name (of the folder, under the `iconsets` folder) here
  </script>
  <script type="text/javascript" src="../xinha/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()
{
 
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'txtContent'
  ];

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean',
   'ExtendedFileManager',
   'TableOperations'
  ];
 

 
     // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
     if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

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

    if (xinha_config.ExtendedFileManager)
    {
        with (xinha_config.ExtendedFileManager)
        {
            <?php

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

            $IMConfig['allow_upload'] = true;

            $IMConfig['images_dir'] = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], 'secure')).'imgs/';
            $IMConfig['images_url'] = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'secure')).'imgs';
           
            $IMConfig['files_dir'] = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], 'secure')).'files/';
            $IMConfig['files_url'] = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'secure')).'files';

            $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;

            $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 '../xinha/contrib/php-xinha.php';
            xinha_pass_to_php_backend($IMConfig);
           
            ?>
        }
    }
 
  xinha_config.toolbar =
  [
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
    ["separator","htmlmode","showhelp"]
  ];
 
   xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
                                            // and does not interfere with window.onload properties set by other scripts
 
  </script>

4. Whether the server is parsing everything correctly. I wouldn't know where to check this, but seeing Xinha renders correctly and EFM comes up I would assume so? Problem is just with the paths, where it starts off at and that I can't upload.

5. In Firefox, no Error Console problems.

Offline

#5 2011-02-01 02:47:50

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

Re: ExtendedFileManager UGH!!!!

Are you using standard php session handling in your PHP application?

Paste the generated source of the IM config.

Instructions for configuring MootoolsFileManager are in plugins/MootoolsFileManager/config.php


James Sleeman

Offline

#6 2011-02-01 03:30:56

Number208
New member
Registered: 2011-01-31
Posts: 6

Re: ExtendedFileManager UGH!!!!

Hi,

Yes, each page under /secure checks a certain session value, and if it isn't set or isn't the value that the login page sets it redirects back to the login screen. I can't see that affecting EFM at all though...

By generated source I assume a "View Source" when the page is loaded... Here it is.

with (xinha_config.ExtendedFileManager)
        {
            backend_data = {
'backend_data[data]': 'a:15:\x7Bs:12:\x22allow_upload\x22;b:1;s:10:\x22images_dir\x22;s:56:\x22/home/ameerlux/public_html/www.mysite.com/imgs/\x22;s:10:\x22images_url\x22;s:35:\x22http://www.mysite.com/imgs\x22;s:9:\x22files_dir\x22;s:57:\x22/home/ameerlux/public_html/www.mysite.com/files/\x22;s:9:\x22files_url\x22;s:36:\x22http://www.mysite.com/files\x22;s:16:\x22thumbnail_prefix\x22;s:2:\x22t_\x22;s:13:\x22thumbnail_dir\x22;s:1:\x22t\x22;s:14:\x22resized_prefix\x22;s:8:\x22resized_\x22;s:11:\x22resized_dir\x22;s:0:\x22\x22;s:10:\x22tmp_prefix\x22;s:4:\x22_tmp\x22;s:21:\x22max_filesize_kb_image\x22;i:2000;s:20:\x22max_filesize_kb_link\x22;i:5000;s:17:\x22max_foldersize_mb\x22;i:0;s:24:\x22allowed_image_extensions\x22;a:3:\x7Bi:0;s:3:\x22jpg\x22;i:1;s:3:\x22gif\x22;i:2;s:3:\x22png\x22;\x7Ds:23:\x22allowed_link_extensions\x22;a:11:\x7Bi:0;s:3:\x22jpg\x22;i:1;s:3:\x22gif\x22;i:2;s:3:\x22pdf\x22;i:3;s:2:\x22ip\x22;i:4;s:3:\x22txt\x22;i:5;s:3:\x22psd\x22;i:6;s:3:\x22png\x22;i:7;s:4:\x22html\x22;i:8;s:3:\x22swf\x22;i:9;s:3:\x22xml\x22;i:10;s:3:\x22xls\x22;\x7D\x7D',
'backend_data[session_name]': 'PHPSESSID',
'backend_data[key_location]': 'Xinha:BackendKey',
'backend_data[hash]': '643ada82e8c9f4d36936d28183c76a31ec5c4a15',
PHPSESSID: '8f3aea6f4e4fef6fbe5d07f3f29fd838'
};
        }

Yes, the www.mysite.com folder falls under public_html and not in the wwwroot as such, it is a extra "free domain" that I got with the hosting.

I would have preferred to stay with EFM as it seems I could have changed it as I need it (integrate Lightbox onClick for galleries etc), but will give MTFM a try if we can't get this right...

Offline

#7 2011-02-01 07:49:08

Number208
New member
Registered: 2011-01-31
Posts: 6

Re: ExtendedFileManager UGH!!!!

OMG I'm so sick of struggling I'm going to flip.

I've put in MooTools now, also seems pretty nice. But, also doesn't work.

The starting off path works this time, so the image_dir setting works. I am also able to create folders inside the main folder. The problem is I can't upload as I get this message in a nice popup: "In order to upload files you need to install Adobe Flash." I DO have flash installed and have tried this on both FF and IE and both give the same results. Please, wtf???

Offline

#8 2011-02-01 08:50:06

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

Re: ExtendedFileManager UGH!!!!

Yes, each page under /secure checks a certain session value, and if it isn't set or isn't the value that the login page sets it redirects back to the login screen. I can't see that affecting EFM at all though...

Standard methods of configuring EFM, ImageManager, MootoolsFileManager etc all depends on your PHP application using standard file based sessions, configuration data is passed via session for security. 

See the functions in contrib/php-xinha.php they may need adapting to your application.

To continue your debugging you should probably start by adding some debugging statements to config.php in the relevant plugin so that you may examine the state of and contents of the session. 

This is an application issue, not an issue with Xinha (naturally, ensure you are using the current Trunk).  Xinha is a developer's tool and must be adapted by the developer to their specific application requirements.

As for your flash problem, ensure flash is up to date, that it is not being blocked, and that your application is not potentially causing this failure.

NB: Also, I would suggest that you carefully examine each request (AJAX, script loading, everything) in Firebug or Chrome's developer tools so you make sure that your "session security check" is not redirecting some request from Xinha.  Remember, the EFM, ImageManager, MFM etc all contain PHP and perform PHP requests, if your security check is intercepting these, Xinha could still work but not as you expect it.


James Sleeman

Offline

#9 2011-02-01 09:06:31

Number208
New member
Registered: 2011-01-31
Posts: 6

Re: ExtendedFileManager UGH!!!!

I'm going to disable all my session checks and see where that goes.

I added you onto MSN if you could help with a chat later.

Offline

#10 2011-02-02 05:23:03

Number208
New member
Registered: 2011-01-31
Posts: 6

Re: ExtendedFileManager UGH!!!!

I'm still stuck with this. sad

Given the above paths that I have provided, what should my image_dir and image_url be? Here they are again...

http://www.mysite.com/    <--Site Root (physical path on server is "/home/ameerlux/public_html/www.mysite.com/")
http://www.mysite.com/uploads/   <--Where I want my uploads to go to (I have given this folder "777" permissions which should cover everything)
http://www.mysite.com/secure/xinha/  <--This is where the Xinha folder is located.
http://www.mysite.com/secure/pages/edit.php   <--This is where I'm using Xinha and the EFM plugin, with the $IMConfig settings etc, all in this file.

I'm doing all my Xinha and EFM code and config in edit.php. Should I be doing anything to the config file under plugins/ExtendedFileManager ?

Offline

#11 2011-02-02 19:28:59

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

Re: ExtendedFileManager UGH!!!!

dir = /home/ameerlux/public_html/www.mysite.com/uploads/
url = /uploads/

I don't recall if trailing slash or not.

As I have said, you need to debug, start with dumping the final config in config.php and work from there.


James Sleeman

Offline

Board footer

Powered by FluxBB