iHaveacomputer
iHaveacomputer

Reputation: 1437

TinyMCE image uploader and paths

I'm using the TinyMCE editor and imagemanager to edit pages here. For backup reasons i also have to store a copy of uploaded images in the database. So after reading the TinyMCE doc i started editing the _Template.php file to biuld my own plugin, and it's stored in

$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php

my problem is that i want to access my common functions and classes in "my" $HOMEDIR/inc/ form within CacheToDb.php; however i have problems to point back to /inc/class_database.php from

$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php.

I tried to add the following lines on top of ChacheToDb.php

define('__ROOT__', "../../../../"); 
require_once(__ROOT__."inc/global.php");
require_once(__ROOT__."inc/class_database.php");

Going up 4 folders here because it's apparently included from

$HOMEDIR/js/tiny_mce/plugins/imagemanager/index.php

However, this dosnt work. Every time i try require_one() i always get an empty window when i click the "add image" button in TinyMCE, so i assume a php error message breaks the json response...? Firebug did not reveal any obvious bugs or usefull info at all. Anyone who had this issue before and know how to include a path without breaking the whole thing?

Upvotes: 1

Views: 1412

Answers (1)

Thariama
Thariama

Reputation: 50832

You should have a closer look into the servers error log in order to check what the error is.

Upvotes: 2

Related Questions