Changeset 15339
- Timestamp:
- 07/13/11 05:48:55 (11 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 10 edited
-
inc/admin.inc.php (modified) (1 diff)
-
inc/classes/BxDolConfig.php (modified) (1 diff)
-
inc/classes/BxDolCronCmd.php (modified) (2 diffs)
-
inc/classes/BxDolJoinProcessor.php (modified) (4 diffs)
-
inc/classes/BxDolProfileFields.php (modified) (2 diffs)
-
inc/design.inc.php (modified) (1 diff)
-
inc/images.inc.php (modified) (7 diffs)
-
inc/utils.inc.php (modified) (2 diffs)
-
media/images/profile/simg_error.gif (deleted)
-
simg/images/error.gif (added)
-
simg/simg.php (modified) (2 diffs)
-
studio/classes/BxDolStudioSettings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/admin.inc.php
r15211 r15339 47 47 48 48 function profile_delete($ID) { 49 global $dir;50 51 49 $oDb = BxDolDb::getInstance(); 52 50 -
trunk/inc/classes/BxDolConfig.php
r15338 r15339 61 61 $this->aUrlDynamic = array( 62 62 'tmp' => BX_DOL_URL_ROOT . 'tmp/', 63 'media_images' => BX_DOL_URL_ROOT . 'media/images/', 64 'media_images_promo' => BX_DOL_URL_ROOT . 'media/images/promo/' 63 'simg' => BX_DOL_URL_ROOT . 'simg/', 64 'rpr_images_main' => '', //--- For Site's main images like logo, etc 65 'rpr_images_promo' => '', //--- For Promo images 66 'rpr_images_watermark' => '' //--- For Watermarks 65 67 ); 66 68 67 69 $this->aPathDynamic = array( 68 70 'tmp' => BX_DIRECTORY_PATH_ROOT . 'tmp/', 69 'media_images' => BX_DIRECTORY_PATH_ROOT . 'media/images/', 70 'media_images_promo' => BX_DIRECTORY_PATH_ROOT . 'media/images/promo/' 71 'simg' => BX_DIRECTORY_PATH_ROOT . 'simg/', 72 'rpr_images_main' => '', //--- For Site's main images like logo, etc 73 'rpr_images_promo' => '', //--- For Promo images 74 'rpr_images_watermark' => '' //--- For Watermarks 71 75 ); 72 76 -
trunk/inc/classes/BxDolCronCmd.php
r15338 r15339 130 130 } 131 131 132 function del_old_all_files() 133 { 134 global $dir; 135 132 function del_old_all_files() { 136 133 $num_tmp = 0; 137 134 $num_del = 0; … … 139 136 $file_life = 86400; // one day 140 137 $dirToClean = array(); 141 $dirToClean[] = $dir['tmp'];142 $dirToClean[] = $dir['cache'];138 $dirToClean[] = BxDolConfig::getInstance()->get('path_dynamic', 'tmp'); 139 $dirToClean[] = BX_DIRECTORY_PATH_CACHE; 143 140 144 141 foreach( $dirToClean as $value ) -
trunk/inc/classes/BxDolJoinProcessor.php
r15211 r15339 184 184 185 185 function registerMember() { 186 $sTmpPath = BxDolConfig::getInstance()->get('path_dynamic', 'tmp'); 186 187 187 188 bx_import('BxDolProfilesController'); … … 197 198 if(!$iId1) { 198 199 if(isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) 199 @unlink($ GLOBALS['dir']['tmp']. $aProfile1['ProfilePhoto']);200 @unlink($sTmpPath . $aProfile1['ProfilePhoto']); 200 201 201 202 return array(false, 'Fail'); … … 209 210 check_logged(); 210 211 211 BxDolService::call('avatar', 'set_image_for_cropping', array ($iId1, $ GLOBALS['dir']['tmp']. $aProfile1['ProfilePhoto']));212 BxDolService::call('avatar', 'set_image_for_cropping', array ($iId1, $sTmpPath . $aProfile1['ProfilePhoto'])); 212 213 213 214 if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) { … … 219 220 'album' => str_replace('{nickname}', getNickName($iId1), getParam('bx_photos_profile_album_name')), 220 221 ); 221 BxDolService::call('photos', 'perform_photo_upload', array($ GLOBALS['dir']['tmp']. $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader');222 BxDolService::call('photos', 'perform_photo_upload', array($sTmpPath . $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader'); 222 223 } 223 224 } -
trunk/inc/classes/BxDolProfileFields.php
r15338 r15339 167 167 if (isset($_FILES['ProfilePhoto'])) { 168 168 if ($_FILES['ProfilePhoto']['error'] == UPLOAD_ERR_OK) { 169 $sTmpName = tempnam( $GLOBALS['dir']['tmp'], 'pphot');169 $sTmpName = tempnam(BxDolConfig::getInstance()->get('path_dynamic', 'tmp'), 'pphot'); 170 170 if (move_uploaded_file($_FILES['ProfilePhoto']['tmp_name'], $sTmpName)) 171 171 $mValue = basename($sTmpName); … … 470 470 return true; 471 471 472 $sFileName = $GLOBALS['dir']['tmp']. $mValue;472 $sFileName = BxDolConfig::getInstance()->get('path_dynamic', 'tmp') . $mValue; 473 473 474 474 if ($mValue && !file_exists($sFileName)) // hack attempt -
trunk/inc/design.inc.php
r15338 r15339 184 184 return BxTemplFunctions::getInstance()->msgBox($sText, $iTimer); 185 185 } 186 186 187 function LoadingBox($sName) { 187 188 bx_import('BxTemplFunctions'); 188 189 return BxTemplFunctions::getInstance()->loadingBox($sName); 189 190 } 191 190 192 function PopupBox($sName, $sTitle, $sContent, $aActions = array(), $isHiddenByDefault = false) { 191 193 bx_import('BxTemplFunctions'); 192 194 return BxTemplFunctions::getInstance()->popupBox($sName, $sTitle, $sContent, $aActions, $isHiddenByDefault); 193 195 } 196 194 197 function getMainLogo() { 195 $ oSysConfig = BxDolConfig::getInstance();198 $sRprMain = BxDolConfig::getInstance()->get('path_dynamic', 'rpr_images_main'); 196 199 197 200 $sFileName = getParam('sys_main_logo'); 198 if(!file_exists($ oSysConfig->get('path_dynamic', 'media_images'). $sFileName))201 if(!file_exists($sRprMain . $sFileName)) 199 202 return ''; 200 203 201 return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $ oSysConfig->get('url_dynamic', 'media_images'). $sFileName . '" class="mainLogo" alt="logo" /></a>';204 return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $sRprMain . $sFileName . '" class="mainLogo" alt="logo" /></a>'; 202 205 } 203 206 204 207 function getPromoImagesArray() { 205 global $dir;208 $sPromoPath = BxDolConfig::getInstance()->get('path_dynamic', 'rpr_images_promo'); 206 209 207 210 $aAllowedExt = array('jpg' => 1, 'png' => 1, 'gif' => 1, 'jpeg' => 1); 208 211 $aFiles = array(); 209 $rDir = opendir( $dir['imagesPromo']);212 $rDir = opendir($sPromoPath); 210 213 if( $rDir ) { 211 while( $sFile = readdir( $rDir )) {212 if( $sFile == '.' or $sFile == '..' or !is_file( $dir['imagesPromo'] . $sFile ))214 while(($sFile = readdir($rDir)) !== false) { 215 if($sFile == '.' or $sFile == '..' or !is_file($sPromoPath . $sFile)) 213 216 continue; 214 217 $aPathInfo = pathinfo($sFile); -
trunk/inc/images.inc.php
r15338 r15339 53 53 { 54 54 $use_gd = false; 55 global $CONVERT;56 55 global $gdInstalled; 57 global $dir; 56 57 $sTmpPath = BxDolConfig::getInstance()->get('path_dynamic', 'tmp'); 58 58 59 59 // constant values … … 135 135 { 136 136 // create image with background 137 $workFilename = "{$ dir['tmp']}bg{$hash}.png";138 $cmd = "$CONVERT" . BX_DIRECTORY_PATH_ROOT . "simg/images/bg{$backgroundIndex}.png -crop {$sizeX}x{$sizeY}+{$backgroundOffsetX}+{$backgroundOffsetY} $workFilename";137 $workFilename = "{$sTmpPath}bg{$hash}.png"; 138 $cmd = BX_SYSTEM_CONVERT . " " . BX_DIRECTORY_PATH_ROOT . "simg/images/bg{$backgroundIndex}.png -crop {$sizeX}x{$sizeY}+{$backgroundOffsetX}+{$backgroundOffsetY} $workFilename"; 139 139 @exec( $cmd ); 140 140 if ( !file_exists( $workFilename ) ) … … 142 142 143 143 // write text on image 144 $workFilename = "{$ dir['tmp']}{$hash}.png";144 $workFilename = "{$sTmpPath}{$hash}.png"; 145 145 $color = '#' . sprintf( '%02x', $fontColorR ) . sprintf( '%02x', $fontColorG ) . sprintf( '%02x', $fontColorB ); 146 146 $textX += $backgroundOffsetX; 147 147 $textY += $backgroundOffsetY; 148 $cmd = "$CONVERT {$dir['tmp']}bg{$hash}.png -font $fontFile -fill \"{$color}\" -pointsize $fontSize -gravity NorthWest -draw \"translate {$textX},{$textY} rotate {$angle} text 0,0 '{$text}'\" $workFilename";148 $cmd = BX_SYSTEM_CONVERT . " {$sTmpPath}bg{$hash}.png -font $fontFile -fill \"{$color}\" -pointsize $fontSize -gravity NorthWest -draw \"translate {$textX},{$textY} rotate {$angle} text 0,0 '{$text}'\" $workFilename"; 149 149 @exec( $cmd ); 150 150 if ( !file_exists( $workFilename ) ) … … 163 163 164 164 // unlink temporary files 165 unlink( "{$ dir['tmp']}bg{$hash}.png" );166 unlink( "{$ dir['tmp']}{$hash}.png" );165 unlink( "{$sTmpPath}bg{$hash}.png" ); 166 unlink( "{$sTmpPath}{$hash}.png" ); 167 167 168 168 return IMAGE_ERROR_SUCCESS; … … 263 263 264 264 function ResizeAllPromos() { 265 global $dir;265 $sRprPromoPath = BxDolConfig::getInstance()->get('path_dynamic', 'rpr_images_promo'); 266 266 267 267 //cleaning old 268 $sDestFold = BxDolConfig::getInstance()->get('path_dynamic', 'media_images_promo');268 $sDestFold = $sRprPromoPath; 269 269 $rDir = opendir($sDestFold); 270 270 if($rDir) { … … 279 279 //inserting new 280 280 $iImgCnt = 1; 281 $sDestFold = $ dir['imagesPromo'] . 'original/';281 $sDestFold = $sRprPromoPath; 282 282 $rDir = opendir($sDestFold); 283 283 if($rDir) { … … 285 285 if($sFile == '.' || $sFile == '..' || !is_file($sDestFold . $sFile)) 286 286 continue; 287 ResizeAnyPromo($sDestFold . $sFile, $ dir['imagesPromo']. $sFile);287 ResizeAnyPromo($sDestFold . $sFile, $sRprPromoPath . $sFile); 288 288 $iImgCnt++; 289 289 } -
trunk/inc/utils.inc.php
r15338 r15339 586 586 587 587 function echoDbgLog($mWhat, $sDesc = '', $sFileName = 'debug.log') { 588 global $dir;589 590 588 $sCont = 591 589 '--- ' . date('r') . ' (' . BX_DOL_START_TIME . ") ---\n" . … … 593 591 print_r($mWhat, true) . "\n\n\n"; 594 592 595 $rFile = fopen( $dir['tmp']. $sFileName, 'a');593 $rFile = fopen(BxDolConfig::getInstance()->get('path_dynamic', 'tmp') . $sFileName, 'a'); 596 594 fwrite($rFile, $sCont); 597 595 fclose($rFile); -
trunk/simg/simg.php
r15211 r15339 29 29 $oSession->setValue('strSec', $hashtext); 30 30 31 if ( produceSecurityImage( $textstr, $hashtext ) != IMAGE_ERROR_SUCCESS ) 32 { 31 if ( produceSecurityImage( $textstr, $hashtext ) != IMAGE_ERROR_SUCCESS ) { 33 32 // output header 34 33 //header( "Content-Type: image/gif" ); … … 41 40 42 41 // output error image 43 @readfile( $dir['profileImage'] . 'simg_error.gif');42 @readfile(BxDolConfig::getInstance()->get('path_dynamic', 'simg') . 'simg_error.gif'); 44 43 } 45 44 46 45 ob_end_flush(); 47 ?> -
trunk/studio/classes/BxDolStudioSettings.php
r15228 r15339 369 369 370 370 function _saveCatWatermark(&$aData){ 371 global $dir;372 371 $bResult = false; 372 $sRprPath = BxDolConfig::getInstance()->get('path_dynamic', 'rpr_images_watermark'); 373 373 374 374 if(!empty($aData['transparent1'])) { … … 386 386 if ($_FILES['Water_Mark'] && $_FILES['Water_Mark']['error'] == UPLOAD_ERR_OK) { 387 387 388 if (BxDolImageResize ->getInstance()->isAllowedImage($_FILES['Water_Mark']['tmp_name'])) {389 $sPath = $ dir['profileImage']. $_FILES['Water_Mark']['name'];388 if (BxDolImageResize::getInstance()->isAllowedImage($_FILES['Water_Mark']['tmp_name'])) { 389 $sPath = $sRprPath . $_FILES['Water_Mark']['name']; 390 390 if (move_uploaded_file($_FILES['Water_Mark']['tmp_name'], $sPath)) { 391 391 $sOldImage = getParam('Water_Mark'); 392 if (!empty($sOldImage) && ($ dir['profileImage']. $sOldImage) != $sPath)393 @unlink($ dir['profileImage']. $sOldImage);392 if (!empty($sOldImage) && ($sRprPath . $sOldImage) != $sPath) 393 @unlink($sRprPath . $sOldImage); 394 394 395 395 @chmod($sPath, 0666);
Note: See TracChangeset
for help on using the changeset viewer.