I had some trouble in getting images handling in farm mode right. Today I defined
$conf['animal'][/m] and [m]$conf['animal_inc'], but it took still some time to get it right.
Initially, the FCK-editor resources browser did the job, and the path returned in the URL field of the properties dialog window was OK according to the animal, but the image was not displayed. The image was also not displayed in the preview of the FCK resources browser. I could find out that the preview was visible when I copied an uploaded file to
fckeditor/userfiles/image ...
After some fiddling, I found out that the cookie FCK_media had to be set, too. I don't know whether I did something else wrong, but I was focused on getting it working right.
Moreover, I wanted to get rid of those two $conf settings, because it complicates things unnecessarily. E.g. we already have DOKU_FARMDIR. Yet, I could at least omit the
animal_inc assignment (and the operation was OK). See this diff-snippet of inc/meta.php
diff --git a/action/meta.php b/action/meta.php
index eec2139..4b4e10e 100644
--- a/action/meta.php
+++ b/action/meta.php
@@ -425,14 +425,14 @@ function check_userfiles() {
$save_dir = trim($conf['savedir']);
$animal = isset($conf['animal']) ? $conf['animal'] : 'userfiles';
- $userfiles = DOKU_PLUGIN . "ckgedit/fckeditor/$animal/";
+ $userfiles = DOKU_PLUGIN . "ckgedit/fckeditor/$animal/";
if(isset($conf['animal']) && $conf['animal'] !== 'userfiles') {
- setcookie('FCK_animal',$animal, $expire, '/');
- setcookie('FCK_animal_inc',$conf['animal_inc'], $expire, '/');
- preg_match('#^(.*?' . $conf['animal'] . ')#', $save_dir,$matches);
- $save_dir=$matches[1] . '/data/pages';
- setcookie('FCK_farmlocal',$save_dir, $expire, '/');
-
+ setcookie('FCK_animal',$animal, $expire, '/');
+ $dir = DOKU_FARMDIR . '/' . $conf['animal'] . '/';
+ setcookie('FCK_animal_inc',$dir, $expire, '/');
+ setcookie('FCK_farmlocal',$dir . 'data/pages', $expire, '/');
+ $media_dir = '/lib/plugins/ckgedit/fckeditor/'. $animal . '/image/';
+ setcookie('FCK_media',$media_dir, $expire, '/');
return;
}
// msg('BASE='. DOKU_BASE);
BTW: I didn't use the farm setup scripts, because the farms already existed.