summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--liberty_lib.php27
-rw-r--r--plugins/filter.htmlpurifier.php2
-rw-r--r--plugins/mime.audio.php8
-rw-r--r--plugins/mime.default.php25
-rw-r--r--plugins/mime.flash.php2
-rw-r--r--plugins/mime.image.php6
-rw-r--r--plugins/mime.pdf.php4
-rw-r--r--plugins/mime.video.php8
-rw-r--r--plugins/processor.gd.php2
-rw-r--r--plugins/processor.imagick.php4
-rw-r--r--plugins/processor.magickwand.php4
-rw-r--r--plugins/storage.bitfile.php2
12 files changed, 49 insertions, 45 deletions
diff --git a/liberty_lib.php b/liberty_lib.php
index 7e4ca52..3040abd 100644
--- a/liberty_lib.php
+++ b/liberty_lib.php
@@ -572,12 +572,13 @@ function liberty_process_archive( &$pFileHash ) {
function liberty_process_generic( &$pFileHash, $pMoveFile = TRUE ) {
$ret = NULL;
$destBase = $pFileHash['dest_path'].$pFileHash['name'];
- $actualPath = BIT_ROOT_PATH.$destBase;
+ $actualPath = STORAGE_PKG_PATH.$destBase;
if ( is_windows() ) {
$destBase = str_replace( '/', "\\", str_replace( "\\", '/', $destBase ) );
$actualPath = str_replace( '//', '\\', str_replace( "\\", '\\', $actualPath ) );
- mkdir_p(str_replace('/','',BIT_ROOT_PATH).$pFileHash['dest_path']);
+ mkdir_p(str_replace('/','',STORAGE_PKG_PATH).$pFileHash['dest_path']);
}
+
if( is_file( $pFileHash['source_file']) ) {
if( $pFileHash['source_file'] == $actualPath ) {
// do nothing if source and dest are the same
@@ -610,9 +611,9 @@ function liberty_process_image( &$pFileHash, $pMoveFile = TRUE ) {
$ret = NULL;
list($type, $ext) = explode( '/', strtolower( $pFileHash['type'] ) );
- mkdir_p( BIT_ROOT_PATH.$pFileHash['dest_path'] );
+ mkdir_p( STORAGE_PKG_PATH.$pFileHash['dest_path'] );
if( $resizePath = liberty_process_generic( $pFileHash, $pMoveFile )) {
- $pFileHash['source_file'] = BIT_ROOT_PATH.$resizePath;
+ $pFileHash['source_file'] = STORAGE_PKG_PATH.$resizePath;
//set permissions if possible - necessary for some wonky shared hosting environments
if(chmod($pFileHash['source_file'], 0644)){
//does nothing, but fails elegantly
@@ -647,7 +648,7 @@ function liberty_clear_thumbnails( &$pFileHash ) {
// get thumbnails we want to remove
if( $thumbs = liberty_fetch_thumbnails( $thumbHash )) {
foreach( $thumbs as $thumb ) {
- $thumb = BIT_ROOT_PATH.$thumb;
+ $thumb = STORAGE_PKG_PATH.$thumb;
if( is_writable( $thumb )) {
unlink( $thumb );
}
@@ -704,7 +705,7 @@ function liberty_generate_thumbnails( &$pFileHash ) {
$pFileHash['name'] = 'original.jpg';
$pFileHash['max_width'] = MAX_THUMBNAIL_DIMENSION;
$pFileHash['max_height'] = MAX_THUMBNAIL_DIMENSION;
- if( $pFileHash['original_path'] = BIT_ROOT_PATH.$resizeFunc( $pFileHash )) {
+ if( $pFileHash['original_path'] = STORAGE_PKG_PATH.$resizeFunc( $pFileHash )) {
$ret = TRUE;
}
}
@@ -724,8 +725,8 @@ function liberty_generate_thumbnails( &$pFileHash ) {
// create a subdirectory for the thumbs
$pFileHash['dest_path'] .= 'thumbs/';
- if( !is_dir( BIT_ROOT_PATH.$pFileHash['dest_path'] )) {
- mkdir( BIT_ROOT_PATH.$pFileHash['dest_path'] );
+ if( !is_dir( STORAGE_PKG_PATH.$pFileHash['dest_path'] )) {
+ mkdir( STORAGE_PKG_PATH.$pFileHash['dest_path'] );
}
foreach( $pFileHash['thumbnail_sizes'] as $thumbSize ) {
@@ -746,7 +747,7 @@ function liberty_generate_thumbnails( &$pFileHash ) {
unset( $pFileHash['max_height'] );
}
- if( $pFileHash['icon_thumb_path'] = BIT_ROOT_PATH.$resizeFunc( $pFileHash )) {
+ if( $pFileHash['icon_thumb_path'] = STORAGE_PKG_PATH.$resizeFunc( $pFileHash )) {
$ret = TRUE;
// use the previous thumb as the source for the next, decreasingly smaller thumb as this GREATLY increases speed
$pFileHash['source_file'] = $pFileHash['icon_thumb_path'];
@@ -799,8 +800,8 @@ function liberty_fetch_thumbnails( $pParamHash, $pAltImageUrl = NULL, $pThumbSiz
$path = &$pParamHash['storage_path'];
// $path might already be the absolute path or it might already contain BIT_ROOT_URL
- if( !( $path = preg_replace( "!^".preg_quote( BIT_ROOT_PATH, "!" )."!", "", $path ))) {
- $path = preg_replace( "!^".preg_quote( BIT_ROOT_URL, "!" )."!", "", $path );
+ if( !( $path = preg_replace( "!^".preg_quote( STORAGE_PKG_PATH, "!" )."!", "", $path ))) {
+ $path = preg_replace( "!^".preg_quote( STORAGE_PKG_URL, "!" )."!", "", $path );
}
// remove the filename if there is one (we can't just use dirname() becuase we might only have the path to the dir)
@@ -809,9 +810,9 @@ function liberty_fetch_thumbnails( $pParamHash, $pAltImageUrl = NULL, $pThumbSiz
foreach( $pParamHash['thumbnail_sizes'] as $size ) {
foreach( $exts as $ext ) {
$image = $size.'.'.$ext;
- if( is_readable( BIT_ROOT_PATH.$dir.'thumbs/'.$image )) {
+ if( is_readable( STORAGE_PKG_PATH.$dir.'thumbs/'.$image )) {
$ret[$size] = storage_path_to_url( $dir.'thumbs/'.$image );
- } elseif( is_readable( BIT_ROOT_PATH.$dir.$image )) {
+ } elseif( is_readable( STORAGE_PKG_PATH.$dir.$image )) {
$ret[$size] = storage_path_to_url( $dir.$image );
}
}
diff --git a/plugins/filter.htmlpurifier.php b/plugins/filter.htmlpurifier.php
index 7f27b6b..f5c8d04 100644
--- a/plugins/filter.htmlpurifier.php
+++ b/plugins/filter.htmlpurifier.php
@@ -133,7 +133,7 @@ function htmlpure_getDefaultConfig( &$htmlp_version, $pObject=NULL ){
$config = HTMLPurifier_Config::createDefault();
// Necessary setup for custom configuration I think. http://htmlpurifier.org/docs/enduser-customize.html
- //$config->set( 'HTML.DefinitionID', BIT_ROOT_PATH );
+ //$config->set( 'HTML.DefinitionID', STORAGE_PKG_PATH );
//$config->set('HTML.DefinitionRev', 1);
//$config->set('Cache.DefinitionImpl', null); // remove this later!
diff --git a/plugins/mime.audio.php b/plugins/mime.audio.php
index 63bf6bf..fecf2b2 100644
--- a/plugins/mime.audio.php
+++ b/plugins/mime.audio.php
@@ -118,7 +118,7 @@ function mime_audio_update( &$pStoreRow, $pParams = NULL ) {
// if there was no upload we'll process the file parameters
if( empty( $pStoreRow['upload'] ) && !empty( $pParams['meta'] )) {
// update our local version of the file
- $file = BIT_ROOT_PATH.$pStoreRow['storage_path'];
+ $file = STORAGE_PKG_PATH.$pStoreRow['storage_path'];
if( is_file( dirname( $file ).'/bitverted.mp3' )) {
$verted = dirname( $file ).'/bitverted.mp3';
} elseif( is_file( dirname( $file ).'/bitverted.m4a' )) {
@@ -162,10 +162,10 @@ function mime_audio_load( &$pFileHash, &$pPrefs, $pParams = NULL ) {
$ret['meta'] = LibertyMime::getMetaData( $pFileHash['attachment_id'], "ID3" );
if( !empty( $ret['storage_path'] )) {
- if( is_file( dirname( BIT_ROOT_PATH.$ret['storage_path'] ).'/bitverted.mp3' )) {
+ if( is_file( dirname( STORAGE_PKG_PATH.$ret['storage_path'] ).'/bitverted.mp3' )) {
$ret['media_url'] = storage_path_to_url( dirname( $ret['storage_path'] )).'/bitverted.mp3';
// we need some javascript for the player:
- } elseif( is_file( dirname( BIT_ROOT_PATH.$ret['storage_path'] ).'/bitverted.m4a' )) {
+ } elseif( is_file( dirname( STORAGE_PKG_PATH.$ret['storage_path'] ).'/bitverted.m4a' )) {
$ret['media_url'] = storage_path_to_url( dirname( $ret['storage_path'] )).'/bitverted.m4a';
}
}
@@ -189,7 +189,7 @@ function mime_audio_converter( &$pParamHash ) {
$ret = FALSE;
$log = array();
- $source = BIT_ROOT_PATH.$pParamHash['upload']['dest_path'].$pParamHash['upload']['name'];
+ $source = STORAGE_PKG_PATH.$pParamHash['upload']['dest_path'].$pParamHash['upload']['name'];
$dest_path = dirname( $source );
if( @BitBase::verifyId( $pParamHash['attachment_id'] )) {
diff --git a/plugins/mime.default.php b/plugins/mime.default.php
index e750c07..9ac5cd5 100644
--- a/plugins/mime.default.php
+++ b/plugins/mime.default.php
@@ -112,7 +112,7 @@ if( !function_exists( 'mime_default_verify' )) {
// Store all uploaded files in the users storage area
if( empty( $pStoreRow['upload']['dest_path'] )) {
- $pStoreRow['upload']['dest_path'] = $pStoreRow['this']->getStorageBranch( $pStoreRow['attachment_id'], $pStoreRow['user_id'], $pStoreRow['this']->getStorageSubDirName( $pStoreRow['upload'] ));
+ $pStoreRow['upload']['dest_path'] = liberty_mime_get_storage_branch( $pStoreRow['attachment_id'], $pStoreRow['user_id'], liberty_mime_get_storage_sub_dir_name( $pStoreRow['upload'] ));
}
$ret = TRUE;
@@ -139,13 +139,13 @@ if( !function_exists( 'mime_default_update' )) {
if( BitBase::verifyId( $pStoreRow['attachment_id'] ) && !empty( $pStoreRow['upload'] )) {
if( !empty( $pStoreRow['storage_path'] )) {
// First we remove the old file
- $file = BIT_ROOT_PATH.$pStoreRow['storage_path'];
+ $file = STORAGE_PKG_PATH.$pStoreRow['storage_path'];
if(( $nuke = LibertyMime::validateStoragePath( $file )) && is_file( $nuke )) {
if( !empty( $pStoreRow['unlink_dir'] )) {
- @unlink_r( dirname( BIT_ROOT_PATH.$pStoreRow['storage_path'] ));
- mkdir( dirname( BIT_ROOT_PATH.$pStoreRow['storage_path'] ));
+ @unlink_r( dirname( STORAGE_PKG_PATH.$pStoreRow['storage_path'] ));
+ mkdir( dirname( STORAGE_PKG_PATH.$pStoreRow['storage_path'] ));
} else {
- @unlink( BIT_ROOT_PATH.$pStoreRow['storage_path'] );
+ @unlink( STORAGE_PKG_PATH.$pStoreRow['storage_path'] );
}
}
@@ -161,7 +161,7 @@ if( !function_exists( 'mime_default_update' )) {
// Now we process the uploaded file
if( $storagePath = liberty_process_upload( $pStoreRow )) {
$sql = "UPDATE `".BIT_DB_PREFIX."liberty_files` SET `storage_path` = ?, `mime_type` = ?, `file_size` = ?, `user_id` = ? WHERE `file_id` = ?";
- $gBitSystem->mDb->query( $sql, array( $pStoreRow['upload']['dest_path'].$pStoreRow['upload']['name'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $pStoreRow['user_id'], $pStoreRow['file_id'] ));
+ $gBitSystem->mDb->query( $sql, array( $pStoreRow['upload']['name'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $pStoreRow['user_id'], $pStoreRow['file_id'] ));
}
// ensure we have the correct guid in the db
@@ -241,13 +241,16 @@ if( !function_exists( 'mime_default_load' )) {
WHERE la.`attachment_id`=?";
if( $row = $gBitSystem->mDb->getRow( $query, array( $pFileHash['attachment_id'] ))) {
$ret = array_merge( $pFileHash, $row );
-
+ $storageName = basename( $row['storage_path'] );
+ $storageBranch = liberty_mime_get_storage_branch( $row['attachment_id'], $row['user_id'], liberty_mime_get_storage_sub_dir_name( $row ) ).$storageName;
// this will fetch the correct thumbnails
- $thumbHash['storage_path'] = $row['storage_path'];
+ $thumbHash['storage_path'] = STORAGE_PKG_PATH.$storageBranch;
+ $row['storage_path'] = $storageBranch;
$canThumbFunc = liberty_get_function( 'can_thumbnail' );
if( $canThumbFunc && $canThumbFunc( $row['mime_type'] )) {
$thumbHash['default_image'] = LIBERTY_PKG_URL.'icons/generating_thumbnails.png';
}
+
$ret['thumbnail_url'] = liberty_fetch_thumbnails( $thumbHash );
// indicate that this is a mime thumbnail
if( !empty( $ret['thumbnail_url']['medium'] ) && strpos( $ret['thumbnail_url']['medium'], '/mime/' )) {
@@ -267,8 +270,8 @@ if( !function_exists( 'mime_default_load' )) {
// some stuff is only available if we have a source file
// make sure to check for these when you use them. frequently the original might not be available
// e.g.: video files are large and the original might be deleted after conversion
- if( is_file( BIT_ROOT_PATH.$row['storage_path'] )) {
- $ret['source_file'] = BIT_ROOT_PATH.$row['storage_path'];
+ if( is_file( STORAGE_PKG_PATH.$row['storage_path'] )) {
+ $ret['source_file'] = STORAGE_PKG_PATH.$row['storage_path'];
$ret['source_url'] = storage_path_to_url( $row['storage_path'] );
$ret['last_modified'] = filemtime( $ret['source_file'] );
if( $gBitSystem->isFeatureActive( "pretty_urls" ) || $gBitSystem->isFeatureActive( "pretty_urls_extended" )) {
@@ -375,7 +378,7 @@ if( !function_exists( 'mime_default_expunge' )) {
if( $fileHash = LibertyMime::getAttachment( $pAttachmentId )) {
if( $gBitUser->isAdmin() || $gBitUser->mUserId == $fileHash['user_id'] && !empty( $fileHash['storage_path'] )) {
// make sure this is a valid storage directory before removing it
- if(( $nuke = LibertyMime::validateStoragePath( BIT_ROOT_PATH.'/'.$fileHash['storage_path'] )) && is_file( $nuke )) {
+ if(( $nuke = LibertyMime::validateStoragePath( STORAGE_PKG_PATH.$fileHash['storage_path'] )) && is_file( $nuke )) {
unlink_r( dirname( $nuke ));
}
$query = "DELETE FROM `".BIT_DB_PREFIX."liberty_files` WHERE `file_id` = ?";
diff --git a/plugins/mime.flash.php b/plugins/mime.flash.php
index 6c8b497..a21b778 100644
--- a/plugins/mime.flash.php
+++ b/plugins/mime.flash.php
@@ -101,7 +101,7 @@ function mime_flash_store_preferences( &$pFileHash ) {
$ret = FALSE;
if( @BitBase::verifyId( $pFileHash['attachment_id'] )) {
- list( $pFileHash['preferences']['width'], $pFileHash['preferences']['height'], $type, $attr) = getimagesize( BIT_ROOT_PATH.$pFileHash['upload']['dest_path'].$pFileHash['upload']['name'] );
+ list( $pFileHash['preferences']['width'], $pFileHash['preferences']['height'], $type, $attr) = getimagesize( STORAGE_PKG_PATH.$pFileHash['upload']['dest_path'].$pFileHash['upload']['name'] );
// store width of video
if( !empty( $pFileHash['preferences']['width'] )) {
diff --git a/plugins/mime.image.php b/plugins/mime.image.php
index f6939cd..42e17e9 100644
--- a/plugins/mime.image.php
+++ b/plugins/mime.image.php
@@ -107,8 +107,8 @@ function mime_image_update( &$pStoreRow, $pParams = NULL ) {
}
} elseif( empty( $pParams['preference']['is_panorama'] ) && !empty( $pStoreRow['thumbnail_url']['panorama'] )) {
// we remove the panorama setting in the database and the panorama thumb
- if( LibertyAttachable::validateStoragePath( BIT_ROOT_PATH.$pStoreRow['thumbnail_url']['panorama'] )) {
- @unlink( BIT_ROOT_PATH.$pStoreRow['thumbnail_url']['panorama'] );
+ if( LibertyAttachable::validateStoragePath( STORAGE_PKG_PATH.$pStoreRow['thumbnail_url']['panorama'] )) {
+ @unlink( STORAGE_PKG_PATH.$pStoreRow['thumbnail_url']['panorama'] );
}
}
@@ -161,7 +161,7 @@ function mime_image_load( &$pFileHash, &$pPrefs, $pParams = NULL ) {
}
// check for panorama image
- if( is_file( BIT_ROOT_PATH.dirname( $ret['storage_path'] )."/thumbs/panorama.jpg" )) {
+ if( is_file( STORAGE_PKG_PATH.dirname( $ret['storage_path'] )."/thumbs/panorama.jpg" )) {
// if the panorama doesn't have 180⁰ vertical field of view we will restrict up / down movement
if(( $ret['pano'] = LibertyMime::getMetaData( $ret['attachment_id'], "PANO" )) && !empty( $ret['pano']['aspect'] )) {
// calculation based on logarythmic regression curve
diff --git a/plugins/mime.pdf.php b/plugins/mime.pdf.php
index ad31cf8..8bef342 100644
--- a/plugins/mime.pdf.php
+++ b/plugins/mime.pdf.php
@@ -111,7 +111,7 @@ function mime_pdf_load( &$pFileHash, &$pPrefs, $pParams = NULL ) {
// don't load a mime image if we don't have an image for this file
if( $ret = mime_default_load( $pFileHash, $pPrefs, $pParams )) {
if( !empty( $ret['storage_path'] )) {
- $source_path = BIT_ROOT_PATH.dirname( $ret['storage_path'] ).'/';
+ $source_path = STORAGE_PKG_PATH.dirname( $ret['storage_path'] ).'/';
// if the swf file exists, we pass it back that it can be viewed.
if( is_file( $source_path.'pdf.swf' )) {
$ret['media_url'] = storage_path_to_url( dirname( $ret['storage_path'] ).'/pdf.swf' );
@@ -137,7 +137,7 @@ function mime_pdf_convert_pdf2swf( $pFileHash ) {
$swfcombine = trim( $gBitSystem->getConfig( 'swfcombine_path', shell_exec( 'which swfcombine' )));
if( is_executable( $pdf2swf ) && is_executable( $swfcombine )) {
- $source = BIT_ROOT_PATH.$pFileHash['upload']['dest_path'].$pFileHash['upload']['name'];
+ $source = STORAGE_PKG_PATH.$pFileHash['upload']['dest_path'].$pFileHash['upload']['name'];
$dest_path = dirname( $source );
$tmp_file = "$dest_path/tmp.swf";
diff --git a/plugins/mime.video.php b/plugins/mime.video.php
index 296bf7d..4675eee 100644
--- a/plugins/mime.video.php
+++ b/plugins/mime.video.php
@@ -151,7 +151,7 @@ function mime_video_load( $pFileHash, &$pPrefs, $pParams = NULL ) {
if( $ret = mime_default_load( $pFileHash, $pParams )) {
// check for status of conversion
if( !empty( $ret['storage_path'] )) {
- $source_path = BIT_ROOT_PATH.dirname( $ret['storage_path'] ).'/';
+ $source_path = STORAGE_PKG_PATH.dirname( $ret['storage_path'] ).'/';
if( is_file( $source_path.'error' )) {
$ret['status']['error'] = TRUE;
} elseif( is_file( $source_path.'processing' )) {
@@ -233,7 +233,7 @@ function mime_video_converter( &$pParamHash, $pOnlyGetParameters = FALSE ) {
} else {
// this is the codec we'll use - currently this might be: flv, h264, h264-2pass
$codec = $gBitSystem->getConfig( "mime_video_video_codec", "flv" );
- $source = BIT_ROOT_PATH.$pParamHash['upload']['dest_path'].$pParamHash['upload']['name'];
+ $source = STORAGE_PKG_PATH.$pParamHash['upload']['dest_path'].$pParamHash['upload']['name'];
$dest_path = dirname( $source );
// set some default values if ffpeg-php isn't available or fails
@@ -517,7 +517,7 @@ function mime_video_create_thumbnail( $pFile, $pOffset = 60 ) {
if( is_file( "$dest_path/thumb.jpg" ) && filesize( "$dest_path/thumb.jpg" ) > 1 ) {
$fileHash['type'] = 'image/jpg';
$fileHash['source_file'] = "$dest_path/thumb.jpg";
- $fileHash['dest_path'] = str_replace( BIT_ROOT_PATH, '', "$dest_path/" );
+ $fileHash['dest_path'] = str_replace( STORAGE_PKG_PATH, '', "$dest_path/" );
liberty_generate_thumbnails( $fileHash );
$ret = TRUE;
@@ -530,7 +530,7 @@ function mime_video_create_thumbnail( $pFile, $pOffset = 60 ) {
if( is_file( "$dest_path/preview1.jpg" )) {
$fileHash['type'] = 'image/jpg';
$fileHash['source_file'] = "$dest_path/preview1.jpg";
- $fileHash['dest_path'] = str_replace( BIT_ROOT_PATH, '', "$dest_path/" );
+ $fileHash['dest_path'] = str_replace( STORAGE_PKG_PATH, '', "$dest_path/" );
liberty_generate_thumbnails( $fileHash );
$ret = TRUE;
diff --git a/plugins/processor.gd.php b/plugins/processor.gd.php
index 73445e5..c31baa0 100644
--- a/plugins/processor.gd.php
+++ b/plugins/processor.gd.php
@@ -84,7 +84,7 @@ function liberty_gd_resize_image( &$pFileHash ) {
$destExt = '.jpg';
}
- $destFile = BIT_ROOT_PATH.'/'.$destUrl.$destExt;
+ $destFile = STORAGE_PKG_PATH.'/'.$destUrl.$destExt;
switch( $targetType ) {
case 'png':
diff --git a/plugins/processor.imagick.php b/plugins/processor.imagick.php
index 2141aaa..09d73cb 100644
--- a/plugins/processor.imagick.php
+++ b/plugins/processor.imagick.php
@@ -127,7 +127,7 @@ function liberty_imagick0_resize_image( &$pFileHash ) {
if( !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] ) && ( ($pFileHash['max_width'] < $iwidth || $pFileHash['max_height'] < $iheight ) || $mimeExt != $targetType )) {
// We have to resize. *ALL* resizes are converted to jpeg or png
$destUrl = $pFileHash['dest_path'].$pFileHash['dest_base_name'].$destExt;
- $destFile = BIT_ROOT_PATH.'/'.$destUrl;
+ $destFile = STORAGE_PKG_PATH.'/'.$destUrl;
$pFileHash['name'] = $pFileHash['dest_base_name'].$destExt;
// print " if ( !imagick_resize( $iImg, $pFileHash[max_width], $pFileHash[max_height], IMAGICK_FILTER_LANCZOS, 0.5, $pFileHash[max_width] x $pFileHash[max_height] > ) ) {";
@@ -236,7 +236,7 @@ function liberty_imagick2_resize_image( &$pFileHash ) {
if( !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] ) && (( $pFileHash['max_width'] < $iwidth || $pFileHash['max_height'] < $iheight ) || $mimeExt != $targetType )) {
$destUrl = $pFileHash['dest_path'].$pFileHash['dest_base_name'].$destExt;
- $destFile = BIT_ROOT_PATH.'/'.$destUrl;
+ $destFile = STORAGE_PKG_PATH.'/'.$destUrl;
$pFileHash['name'] = $pFileHash['dest_base_name'].$destExt;
// create thumb and write
diff --git a/plugins/processor.magickwand.php b/plugins/processor.magickwand.php
index bf50bf2..491b8ae 100644
--- a/plugins/processor.magickwand.php
+++ b/plugins/processor.magickwand.php
@@ -99,7 +99,7 @@ function liberty_magickwand_resize_image( &$pFileHash ) {
}
if( !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] ) && ( ($pFileHash['max_width'] < $iwidth || $pFileHash['max_height'] < $iheight ) || $mimeExt != $targetType ) || !empty( $pFileHash['colorspace_conversion'] ) ) {
$destUrl = $pFileHash['dest_path'].$pFileHash['dest_base_name'].$destExt;
- $destFile = BIT_ROOT_PATH.'/'.$destUrl;
+ $destFile = STORAGE_PKG_PATH.'/'.$destUrl;
$pFileHash['name'] = $pFileHash['dest_base_name'].$destExt;
// Alternate Filter settings can seen here http://www.dylanbeattie.net/magick/filters/result.html
if ( $error = liberty_magickwand_check_error( MagickResizeImage( $magickWand, $pFileHash['max_width'], $pFileHash['max_height'], MW_CatromFilter, 1.00 ), $magickWand ) ) {
@@ -213,7 +213,7 @@ function liberty_magickwand_convert_colorspace_image( &$pFileHash, $pColorSpace
} else {
MagickSetImageColorspace( $magickWand, MW_GRAYColorspace );
if( empty( $pFileHash['dest_file'] ) ) {
- $pFileHash['dest_file'] = BIT_ROOT_PATH.'/'.$pFileHash['dest_path'].$pFileHash['name'];
+ $pFileHash['dest_file'] = STORAGE_PKG_PATH.'/'.$pFileHash['dest_path'].$pFileHash['name'];
}
if( $error = liberty_magickwand_check_error( MagickWriteImage( $magickWand, $pFileHash['dest_file'] ), $magickWand ) ) {
bit_log_error( "MagickWriteImage Failed:$error ( $pFileHash[source_file] )" );
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php
index 62e4d2b..e3a7654 100644
--- a/plugins/storage.bitfile.php
+++ b/plugins/storage.bitfile.php
@@ -121,7 +121,7 @@ function bit_files_expunge( $pStorageId ) {
if( $row = $gBitSystem->mDb->getRow( $sql, array( $pStorageId ))) {
$sql = "SELECT * FROM `".BIT_DB_PREFIX."liberty_files` WHERE `file_id` = ?";
if( $fileRow = $gBitSystem->mDb->getRow( $sql, array( $row['foreign_id'] ))) {
- $absolutePath = BIT_ROOT_PATH.'/'.$fileRow['storage_path'];
+ $absolutePath = STORAGE_PKG_PATH.'/'.$fileRow['storage_path'];
if( $gBitUser->isAdmin() || $gBitUser->mUserId == $row['user_id'] ) {
if( file_exists( $absolutePath )) {