You are not logged in.
Pages: 1
I am trying to configure ExtendedFileManager without actually going into those config files within Xinha (for fear of always replacing them by accident when I update).
To do this, of course, I am adding a bunch of PHP to xinhaconfig.js, as it appears the Readme for ExtendedFileManager tells me to do:
if (xinha_config.ExtendedFileManager) {
with (xinha_config.ExtendedFileManager)
{
<?php
// define backend configuration for the plugin
$IMConfig = array();
$IMConfig['images_dir'] = '../../../../_files'; //Disgusting, I know. Whatever :(
$IMConfig['images_url'] = '/_files';
//$IMConfig['files_dir'] = '/_files';
//$IMConfig['files_url'] = '/_files';
$IMConfig['thumbnail_prefix'] = 't_';
$IMConfig['thumbnail_dir'] = '.thumbs';
$IMConfig['resized_prefix'] = 'resized_';
$IMConfig['resized_dir'] = '';
$IMConfig['tmp_prefix'] = '.tmp';
$IMConfig['max_filesize_kb_image'] = 4000;
// maximum size for uploading files in 'insert image' mode (2000 kB here)
$IMConfig['max_filesize_kb_link'] = 15000;
// maximum size for uploading files in 'insert link' mode (5000 kB here)
// Maximum upload folder size in Megabytes.
// Use 0 to disable limit
$IMConfig['max_foldersize_mb'] = 0;
require_once '/path/to/xinha/contrib/php-xinha.php';
xinha_pass_to_php_backend($IMConfig);
?>
}
}
If I change config.inc.php with those same settings it works, so I doubt it is the settings... I'm assuming that the problem is that I am daftly inserting php within a javascript file. Clearly the PHP code is not being read by PHP, since it is still present after loading the page if I view the Javascript source.
So how, then, can I configure things in the PHP backend?
Can I have a xinhaconfig.php file like the .js file? Is there an example of such a file? What includes should it have?
Thanks in advance!
Last edited by Mr. Picklesworth (2006-12-17 23:13:10)
Offline
You're correct - files with .js extension will not be parsed by PHP. You simply have to rename it to e.g. configfile.php and include it like that:
<script type="text/javascript" src="path/to/configfile.php"></script>
Offline
Heh, I didn't notice require_once or /path/to/xinha bit. It works now!
Thanks
Offline
PHP Fusion - the google bot is unable to pick up the header titles or content off our webpages other than the front page - see www.snapt.co.nz - can anyone help?
Offline
Pages: 1