<![CDATA[ Ideas for fixing Image Display and Preview in both FCK and Tiny - MODX Community Forums]]> https://forums.modx.com/thread/?thread=46361 <![CDATA[display and preview with file browser mcpuck]]> https://forums.modx.com/thread/46361/ideas-for-fixing-image-display-and-preview-in-both-fck-and-tiny#dis-post-268117
After searching this forum and trying several things (permissions, paths, user rules etc.) i found this thread and tried it too.
But it didnt solve my problem with displaying images in the browser.

I use modx 0.9.6.2 and the tinyMCE (updated to 3.2.0.1). Inserting images by typing the path works fine. Also uploading works and i get no errors, the files are there (checked with ftp) and i also can see folders within my assets/images folder, but no images itself.

What went wrong?]]>
Newton Oct 05, 2008, 11:16 AM https://forums.modx.com/thread/46361/ideas-for-fixing-image-display-and-preview-in-both-fck-and-tiny#dis-post-268117
<![CDATA[Ideas for fixing Image Display and Preview in both FCK and Tiny]]> https://forums.modx.com/thread/46361/ideas-for-fixing-image-display-and-preview-in-both-fck-and-tiny#dis-post-268116 a. show the right files when trying to browse to and insert a pic.
b. having preview work both in the browser and in the editor window after selecting an image.

Sounds simple, but after reading countless posts about this, it’s often nasty. I thought I’d share what worked for me so that someone out there will have fewer headaches than I had. Obviously, YMMV - I can’t speak for IIS, for instance. Hosts often differ, too, at the server level. Anyway...

There are 2 key settings that I found that greatly affected what I was doing. Despite their names, they effect Tiny, too. They are located in here:
\manager\media\browser\mcpuk\connectors\php\config.php

$fckphp_config[’urlprefix’]="/assets/YourSpecialFolder";
This setting is the key for getting Preview to work. Note the beginning slash, and no trailing slash! In the example, I have a special folder for the client’s stuff. The config.php contains a default line of code that tries to figure out the correct path for this parm. In my experience, it didn’t work for Tiny or FCK, so I needed to hard-code it. If you’re not using a special folder, you could probably use "/assets". Either way, whatever you put here should probably match MODx configuration (minus the trailing slash): Tools-Configuration-Interface-Resource URL. (Resource Path needs to be set correctly too - on my system it had the whole hard-coded server path all the way to the upload folder).

$fckphp_config[’UserFilesPath’] = "";
This is the key for getting the Images to appear when you use the Image Browser in the editors; what you see in the file browser when you actually try to find a file to add to your edited page. I found that having "nothing" in here was good for both FCK and Tiny, and FF and IE browsers. One key is that you have to have the right setting in Resource URL (see last paragraph). Putting the wrong thing here may cause the "Invalid XML response..." error in IE, or may just show no files at all.

[I mention this because I wasted a lot of time trying various things here - I even tried just one slash, and this allowed FF and IE6 to work, but borked IE7!]

Many folks also get "Invalid XML response from connector" due to another reason (there are many causes for this error in the code!). This works for some people (I didn’t need it):

\manager\media\browser\mcpuk\connectors\php\Commands\GetUploadProgress.php

In "GetUploadProgress.php" Just add:

header ("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";

directly after:
//Progresshandler not specified, return generic response

Other things to check:

  • Be sure your folder that you want to use for images, etc. is set to 777 permissions.
  • GD has to be active for image display (for preview). Check with your tech support.
  • suhosin - this is a PHP security app that I just found out about. It can bork the editors if it’s on - talk to your sysadmin.
  • If all else fails, RTFM. This is actually a pretty good readme: \manager\media\browser\mcpuk\connectors\php\Docs\readme.txt

Final thought: I wasted a lot of time looking at plug-in code for FCK under the /assets folder. There are config parms to set there, but messing with them did not help me at all (it may help others). Same with Tiny, actually. I also understand that the Mcpuk browser is not being used that much by FCK users anymore, so support from that angle may be waning.

Recently I’ve been plundering other people’s brains here to great effect, so I thought I’d try to give back by helping with something. I hope it helps you!

Samba]]>
samba Sep 10, 2007, 11:46 AM https://forums.modx.com/thread/46361/ideas-for-fixing-image-display-and-preview-in-both-fck-and-tiny#dis-post-268116