I'm making a site that uses alot of ressources. Not only images. I made a custom file upload script, that uploads the files and makes an entry in the database.
Now i wan't to make the use of the fine FCK file browser, and it pisses me off cause it's making subfolders in the root i specify. Image/, File/, Flash/ and Media/ ressource types.
I just want it to enter the folder i specify in ServerPath and list the files that i have uploaded there with my own script, no ressource selection in the left top frame, so subfolders by type...
This seems to be embedded very deep in the FCK code and it seems that it's not to easy to get rid of this. Or am i mistaking?
Now i wan't to make the use of the fine FCK file browser, and it pisses me off cause it's making subfolders in the root i specify. Image/, File/, Flash/ and Media/ ressource types.
I just want it to enter the folder i specify in ServerPath and list the files that i have uploaded there with my own script, no ressource selection in the left top frame, so subfolders by type...
This seems to be embedded very deep in the FCK code and it seems that it's not to easy to get rid of this. Or am i mistaking?
RE: file browser
This was one of the limitations that prompted me to make my own browser as I work with some web applications that must have a specific file structure. Try the LFO Browser. https://sourceforge.net/projects/lfobrowser
RE: file browser
Three files should be modified:
************
- config.php
// Path to user files relative to the document root.
$Config['UserFilesPathDefault'] = '' ;
$Config['UserFilesPath'] = array('Image' => '/img/') ;
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPathDefault' must point to the same directory.
$Config['UserFilesAbsolutePathDefault'] = '' ;
$Config['UserFilesAbsolutePath'] = array() ;
***************
- connector.php
// Get the "UserFiles" path.
$rType = NULL;
if (isset( $_GET['Type']) || isset( $Config['UserFilesPath'][$_GET['Type']] )) $rType = $_GET['Type'];
if (! $rType)
{
$GLOBALS["UserFilesPath"] = '' ;
if ( isset( $Config['UserFilesPathDefault'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPathDefault'] ;
else if ( isset( $_GET['ServerPath'] ) )
$GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
if ( strlen( $Config['UserFilesAbsolutePathDefault'] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePathDefault'] ;
if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}
else
{
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
}
}
else
{
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'][$rType] ;
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
if ( isset($Config['UserFilesAbsolutePath'][$rType]) && strlen( $Config['UserFilesAbsolutePath'][$rType] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'][$rType] ;
if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}
else
{
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
}
}
********
- io.php
function GetUrlFromPath( $resourceType, $folderPath )
{
global $Config;
if (! isset($Config['UserFilesPath'][$resourceType]))
{
if ( $resourceType == '' )
return RemoveFromEnd( $GLOBALS["UserFilesPathDefault"], '/' ) . $folderPath ;
else
return $GLOBALS["UserFilesPathDefault"] . $resourceType . $folderPath ;
}
else
{
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
}
}
function ServerMapFolder( $resourceType, $folderPath )
{
global $Config;
// Get the resource type directory.
if (! isset($Config['UserFilesPath'][$resourceType]))
{
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '/' ;
}
else
{
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] ;
}
// Ensure that the directory exists.
CreateServerFolder( $sResourceTypePath ) ;
// Return the resource type directory combined with the required path.
return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
}