TinyMCPUK welke rechten?
deze tutorial ben ik eens gaan kijken naar TinyMCE, en daarna naar TinyMCPUK (dank aan Jan, voor de link).
een paar probleempjes bij het 'instaleren', maar dat moet natuurlijk ook. Anders is er niks aan :-)
maar nu kom tegen de volgende problemen aan, die ik na googlen en veel zoeken niet kan oplossen.
Het eerste probleem is de image/file manager. Deze kan ik namelijk niet openen. Als ik het probeer via het example, dat bij de download inzat. Doet hij het goed.
Maar als ik het nu op m'n eigen pagina doe, werkt het voor geen meter. hij gaat namelijk naar de verkeerde link. ik kan er wel handmatig naartoe surfen, maar dat is natuurlijk niet de bedoeling.
Mijn vraag is dan ook, waar kan ik de URL(of javascript actie) aanpassen, zodat hij goed gaat.
dit heb ik nu wel goed:
en mijn tweede vraag: wat voor rechten moet ik aan welke bestanden toekennen zodat hij wél mappen kan aanmaken?
naar aanleiding van een paar probleempjes bij het 'instaleren', maar dat moet natuurlijk ook. Anders is er niks aan :-)
maar nu kom tegen de volgende problemen aan, die ik na googlen en veel zoeken niet kan oplossen.
Maar als ik het nu op m'n eigen pagina doe, werkt het voor geen meter. hij gaat namelijk naar de verkeerde link. ik kan er wel handmatig naartoe surfen, maar dat is natuurlijk niet de bedoeling.
Mijn vraag is dan ook, waar kan ik de URL(of javascript actie) aanpassen, zodat hij goed gaat.
dit heb ik nu wel goed:
en mijn tweede vraag: wat voor rechten moet ik aan welke bestanden toekennen zodat hij wél mappen kan aanmaken?
Edit:
hij opent nu al wel de filemanager, maar ik kan geen map aanmaken/bestanden uploaden. Als iemand weet wat voor rechten ik welke map moet geven, zeg het maar. De map heeft nu de rechten 755, en ik heb 777 op de gehele map geprobeerd.. ik google nog wel even.
Gewijzigd op 01/01/1970 01:00:00 door Erwin Nieuwenhuis
File
Flash
Image
Media
om te testen 777 chmodden. Daarna kijken of 755 ook werkt.
Verder config.inc.php aanpassen in de map tinymcpuk/imagemanager/
Hieronder die van mij:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/**
* Image Manager configuration file.
* @author $Author$
* @version $Id$
* @package ImageManager
*/
/*
File system path to the directory you want to manage the images
for multiple user systems, set it dynamically.
NOTE: This directory requires write access by PHP. That is,
PHP must be able to create files in this directory.
Able to create directories is nice, but not necessary.
*/
$IMConfig['base_dir'] = $_SERVER['DOCUMENT_ROOT'] . '/images';
/*
The URL to the above path, the web browser needs to be able to see it.
It can be protected via .htaccess on apache or directory permissions on IIS,
check you web server documentation for futher information on directory protection
If this directory needs to be publicly accessiable, remove scripting capabilities
for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
in this directory and its subdirectories.
*/
$IMConfig['base_url'] = 'http://' . $_SERVER['SERVER_NAME'] . '/images';
/*
Possible values: true, false
TRUE - If PHP on the web server is in safe mode, set this to true.
SAFE MODE restrictions: directory creation will not be possible,
only the GD library can be used, other libraries require
Safe Mode to be off.
FALSE - Set to false if PHP on the web server is not in safe mode.
*/
$IMConfig['safe_mode'] = false;
/*
Possible values: 'GD', 'IM', or 'NetPBM'
The image manipulation library to use, either GD or ImageMagick or NetPBM.
If you have safe mode ON, or don't have the binaries to other packages,
your choice is 'GD' only. Other packages require Safe Mode to be off.
*/
define('IMAGE_CLASS', 'GD');
/*
After defining which library to use, if it is NetPBM or IM, you need to
specify where the binary for the selected library are. And of course
your server and PHP must be able to execute them (i.e. safe mode is OFF).
GD does not require the following definition.
*/
define('IMAGE_TRANSFORM_LIB_PATH', 'h:\\jobber\\imagemagic\\');
/* ============== OPTIONAL SETTINGS ============== */
/*
The prefix for thumbnail files, something like .thumb will do. The
thumbnails files will be named as "prefix_imagefile.ext", that is,
prefix + orginal filename.
*/
$IMConfig['thumbnail_prefix'] = '.';
/*
Thumbnail can also be stored in a directory, this directory
will be created by PHP. If PHP is in safe mode, this parameter
is ignored, you can not create directories.
If you do not want to store thumbnails in a directory, set this
to false or empty string '';
*/
$IMConfig['thumbnail_dir'] = '/.thumbs';
/*
Possible values: true, false
TRUE - Allow the user to create new sub-directories in the
$IMConfig['base_dir'].
FALSE - No directory creation.
NOTE: If $IMConfig['safe_mode'] = true, this parameter
is ignored, you can not create directories
*/
$IMConfig['allow_new_dir'] = true;
/*
Possible values: true, false
TRUE - Allow the user to upload files.
FALSE - No uploading allowed.
*/
$IMConfig['allow_upload'] = true;
/*
Possible values: true, false
TRUE - If set to true, uploaded files will be validated based on the
function getImageSize, if we can get the image dimensions then
I guess this should be a valid image. Otherwise the file will be rejected.
FALSE - All uploaded files will be processed.
NOTE: If uploading is not allowed, this parameter is ignored.
*/
$IMConfig['validate_images'] = true;
/*
The default thumbnail if the thumbnails can not be created, either
due to error or bad image file.
*/
$IMConfig['default_thumbnail'] = 'img/default.gif';
/*
Thumbnail dimensions.
*/
$IMConfig['thumbnail_width'] = 96;
$IMConfig['thumbnail_height'] = 96;
/*
Image Editor temporary filename prefix.
*/
$IMConfig['tmp_prefix'] = '.editor_';
?>
/**
* Image Manager configuration file.
* @author $Author$
* @version $Id$
* @package ImageManager
*/
/*
File system path to the directory you want to manage the images
for multiple user systems, set it dynamically.
NOTE: This directory requires write access by PHP. That is,
PHP must be able to create files in this directory.
Able to create directories is nice, but not necessary.
*/
$IMConfig['base_dir'] = $_SERVER['DOCUMENT_ROOT'] . '/images';
/*
The URL to the above path, the web browser needs to be able to see it.
It can be protected via .htaccess on apache or directory permissions on IIS,
check you web server documentation for futher information on directory protection
If this directory needs to be publicly accessiable, remove scripting capabilities
for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
in this directory and its subdirectories.
*/
$IMConfig['base_url'] = 'http://' . $_SERVER['SERVER_NAME'] . '/images';
/*
Possible values: true, false
TRUE - If PHP on the web server is in safe mode, set this to true.
SAFE MODE restrictions: directory creation will not be possible,
only the GD library can be used, other libraries require
Safe Mode to be off.
FALSE - Set to false if PHP on the web server is not in safe mode.
*/
$IMConfig['safe_mode'] = false;
/*
Possible values: 'GD', 'IM', or 'NetPBM'
The image manipulation library to use, either GD or ImageMagick or NetPBM.
If you have safe mode ON, or don't have the binaries to other packages,
your choice is 'GD' only. Other packages require Safe Mode to be off.
*/
define('IMAGE_CLASS', 'GD');
/*
After defining which library to use, if it is NetPBM or IM, you need to
specify where the binary for the selected library are. And of course
your server and PHP must be able to execute them (i.e. safe mode is OFF).
GD does not require the following definition.
*/
define('IMAGE_TRANSFORM_LIB_PATH', 'h:\\jobber\\imagemagic\\');
/* ============== OPTIONAL SETTINGS ============== */
/*
The prefix for thumbnail files, something like .thumb will do. The
thumbnails files will be named as "prefix_imagefile.ext", that is,
prefix + orginal filename.
*/
$IMConfig['thumbnail_prefix'] = '.';
/*
Thumbnail can also be stored in a directory, this directory
will be created by PHP. If PHP is in safe mode, this parameter
is ignored, you can not create directories.
If you do not want to store thumbnails in a directory, set this
to false or empty string '';
*/
$IMConfig['thumbnail_dir'] = '/.thumbs';
/*
Possible values: true, false
TRUE - Allow the user to create new sub-directories in the
$IMConfig['base_dir'].
FALSE - No directory creation.
NOTE: If $IMConfig['safe_mode'] = true, this parameter
is ignored, you can not create directories
*/
$IMConfig['allow_new_dir'] = true;
/*
Possible values: true, false
TRUE - Allow the user to upload files.
FALSE - No uploading allowed.
*/
$IMConfig['allow_upload'] = true;
/*
Possible values: true, false
TRUE - If set to true, uploaded files will be validated based on the
function getImageSize, if we can get the image dimensions then
I guess this should be a valid image. Otherwise the file will be rejected.
FALSE - All uploaded files will be processed.
NOTE: If uploading is not allowed, this parameter is ignored.
*/
$IMConfig['validate_images'] = true;
/*
The default thumbnail if the thumbnails can not be created, either
due to error or bad image file.
*/
$IMConfig['default_thumbnail'] = 'img/default.gif';
/*
Thumbnail dimensions.
*/
$IMConfig['thumbnail_width'] = 96;
$IMConfig['thumbnail_height'] = 96;
/*
Image Editor temporary filename prefix.
*/
$IMConfig['tmp_prefix'] = '.editor_';
?>
Tenslotte hieronder nog mijn tinymcpuk_init.js, met wat kleine aanpassingen, zodat je hem ook als e-mail editor kunt gebruiken. Het gaat vooral om absolute paden en dergelijke:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,paste,directionality,fullscreen,noneditable,contextmenu",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
// theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor,liststyle",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "hr[class|width|size|noshade]",
file_browser_callback : "fileBrowserCallBack",
paste_use_dialog : false,
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
apply_source_formatting : true,
convert_urls : false, // van de urls afblijven
relative_urls : false, // absolute paden, zodat we plaatjes in mails kunnen stoppen
remove_script_host : false, // bij interne hyperlinks absolute paden blijven gebruiken
width: "700",
height: "400"
});
function fileBrowserCallBack(field_name, url, type, win) {
var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
var enableAutoTypeSelection = true;
var cType;
tinymcpuk_field = field_name;
tinymcpuk = win;
switch (type) {
case "image":
cType = "Image";
break;
case "flash":
cType = "Flash";
break;
case "file":
cType = "File";
break;
}
if (enableAutoTypeSelection && cType) {
connector += "&Type=" + cType;
}
window.open(connector, "tinymcpuk", "modal,width=600,height=400");
}
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,paste,directionality,fullscreen,noneditable,contextmenu",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
// theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor,liststyle",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "hr[class|width|size|noshade]",
file_browser_callback : "fileBrowserCallBack",
paste_use_dialog : false,
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
apply_source_formatting : true,
convert_urls : false, // van de urls afblijven
relative_urls : false, // absolute paden, zodat we plaatjes in mails kunnen stoppen
remove_script_host : false, // bij interne hyperlinks absolute paden blijven gebruiken
width: "700",
height: "400"
});
function fileBrowserCallBack(field_name, url, type, win) {
var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
var enableAutoTypeSelection = true;
var cType;
tinymcpuk_field = field_name;
tinymcpuk = win;
switch (type) {
case "image":
cType = "Image";
break;
case "flash":
cType = "Flash";
break;
case "file":
cType = "File";
break;
}
if (enableAutoTypeSelection && cType) {
connector += "&Type=" + cType;
}
window.open(connector, "tinymcpuk", "modal,width=600,height=400");
}
755 doet het idd ook.
en verder moet ik gebruik maken van stripslashes? want anders komen er allemaal slashes in te staan(bij afbeeldingen)
Kun je doen, maar ik zet de magic quotes altijd uit met een .htaccess bestand. Veel handiger, vind ik.
Maar geeft ik escape m'n string voordat hij de db ingaat, en dan komen er wel slashes bij.
hoort dit? of doe ik iets verkeerd?