PHP 클래스 BxAvaModule, dolphin.pro

This module allow user to crop avatar image from any photo. This is default module and Dolphin can not work properly without this module. 'Avatar' field in Profiles table is used to store current user avatar id. Avatar id is used to store avatar image, so it is easy to get avarat image if you know avatar id. You can get avatar image directly, using defines in include.php file. Refer to include.php file for all defines descriptions. Example of using this module to get avatar images: include_once (BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php') echo BX_AVA_URL_USER_AVATARS . $aProfile['Avatar'] . BX_AVA_EXT; // avatar image echo BX_AVA_URL_USER_AVATARS . $aProfile['Avatar'] . 'i'. BX_AVA_EXT; // avatar icon Profile's Wall: 'add avatar' and 'change avatar' events are displayed on profile's wall Spy: no spy activity Memberships/ACL: avatar upload - BX_AVATAR_UPLOAD avatar edit any - BX_AVATAR_EDIT_ANY avatar delete any - BX_AVATAR_DELETE_ANY Service methods: Set image for cropping.
또한 보기: BxAvaModule::serviceSetImageForCropping BxDolService::call('avatar', 'set_image_for_cropping', array($iProfileId, $sOrigPath)); Crop image html
또한 보기: BxAvaModule::serviceCropTool BxDolService::call('avatar', 'crop_tool', array($aParams)); Delete all profile's avatars
또한 보기: BxAvaModule::serviceDeleteProfileAvatars BxDolService::call('avatar', 'delete_profile_avatars', array($iProfileId)); After join redirection
또한 보기: BxAvaModule::serviceJoin BxDolService::call('avatar', 'join', array($iMemID, $sStatusText)); Site avatars html
또한 보기: BxAvaModule::serviceGetSiteAvatars BxDolService::call('avatar', 'get_site_avatars', array($iPage)); My avatars html
또한 보기: BxAvaModule::serviceGetMyAvatars BxDolService::call('avatar', 'get_my_avatars', array($iProfileId)); make avatar from particular image, also it makes the image square
또한 보기: BxAvaModule::serviceMakeAvatarFromImage BxDolService::call ('avatar', 'make_avatar_from_image', array ('/tmp/abc.jpg')); make avatar from image url, also it makes the image square
또한 보기: BxAvaModule::serviceMakeAvatarFromImageUrl BxDolService::call ('avatar', 'make_avatar_from_image_url', array ('http://abc.com/123.jpg')); Get image from photos module and make avbatar from it, also it makes it square
또한 보기: BxAvaModule::serviceMakeAvatarFromSharedPhotoAuto BxDolService::call ('avatar', 'make_avatar_from_shared_photo_auto', array (80)); Alerts: Alerts type/unit - 'bx_avatar' The following alerts are rised add - new avatar is added $iObjectId - avatar id $iSenderId - avatar's owner change - avatar was changed $iObjectId - avatar id $iSenderId - avatar's owner delete - avatar was deleted $iObjectId - avatar id $iSenderId - avatar's owner
상속: extends BxDolModule
파일 보기 프로젝트 열기: boonex/dolphin.pro

공개 프로퍼티들

프로퍼티 타입 설명
$_aAllowedExt
$_iProfileId

공개 메소드들

메소드 설명
__construct ( &$aModule )
_addAvatar ( $sFullPath, $isMove = false, $isUpdateProfile = true )
_cropAvatar ( )
_defineActions ( )
_makeAvatarFromSharedPhoto ( $iSharedPhotoId )
_removeAvatar ( $iProfileId, $iAvatar ) ================================== other function
_resizeImage ( $sImageSrc, $sImageDst, $iWidth, $iHeight, $bSquareResize = false, $bJpegOutput = true )
_setAvatar ( $iProfileId, $sImg, $isSetAvatarForCouple = false )
_uploadImage ( $iProfileId )
actionAdministration ( )
actionGetSiteAvatars ( $iPage )
actionHome ( )
actionMemberThumb ( $iProfileId )
actionRemoveAvatar ( $iProfileId, $sImg )
actionSetAvatar ( $iProfileId, $sImg )
actionSetAvatarCouple ( $iProfileId, $sImg )
actionSetSiteAvatar ( $sImg )
isAdmin ( )
isAllowedAdd ( $isPerformAction = false ) ================================== permissions
isAllowedDelete ( &$aDataEntry, $isPerformAction = false )
isAllowedEdit ( $aDataEntry, $isPerformAction = false )
onEventChanged ( $iProfileId, $iEntryId, $iCoupleProfileId, $isTryToSuspend = true )
onEventCreate ( $iEntryId ) ================================== events
onEventDeleted ( $iEntryId, $aDataEntry = [] )
serviceCropTool ( $aParams ) Returns crop image html, it consists of image for cropping, cropping preview and descriptions
serviceDeleteProfileAvatars ( $iProfileId ) : true Delete all profile's avatars
serviceGetMyAvatars ( $iProfileId ) : html My avatars html
serviceGetSiteAvatars ( $iPage ) : html Site avatars html
serviceGetWallData ( ) Register 'add avatar' and 'change avatar' events for wall
serviceGetWallPost ( $aEvent ) : html Html to display on profile wall, when user uploads new avatar
serviceJoin ( $iMemID, $sStatusText ) : false After join redirection This serice automatically log in joined user and redirects him to avatar copping page
serviceMakeAvatarFromImage ( $sImg ) : true make avatar from particular image, also it makes it square
serviceMakeAvatarFromImageUrl ( $sImgUrl ) : true make avatar from image url, also it makes it square
serviceMakeAvatarFromSharedPhotoAuto ( $iSharedPhotoId ) : true get image from photos module and make avatar from it also it makes it square
serviceManageAvatars ( $iProfileId, $isAddJsCss = false )
serviceSetImageForCropping ( $iProfileId, $sOrigPath ) : true Set image for cropping.

메소드 상세

__construct() 공개 메소드

public __construct ( &$aModule )

_addAvatar() 공개 메소드

public _addAvatar ( $sFullPath, $isMove = false, $isUpdateProfile = true )

_cropAvatar() 공개 메소드

public _cropAvatar ( )

_defineActions() 공개 메소드

public _defineActions ( )

_makeAvatarFromSharedPhoto() 공개 메소드

public _makeAvatarFromSharedPhoto ( $iSharedPhotoId )

_removeAvatar() 공개 메소드

================================== other function
public _removeAvatar ( $iProfileId, $iAvatar )

_resizeImage() 공개 메소드

public _resizeImage ( $sImageSrc, $sImageDst, $iWidth, $iHeight, $bSquareResize = false, $bJpegOutput = true )

_setAvatar() 공개 메소드

public _setAvatar ( $iProfileId, $sImg, $isSetAvatarForCouple = false )

_uploadImage() 공개 메소드

public _uploadImage ( $iProfileId )

actionAdministration() 공개 메소드

actionGetSiteAvatars() 공개 메소드

public actionGetSiteAvatars ( $iPage )

actionHome() 공개 메소드

public actionHome ( )

actionMemberThumb() 공개 메소드

public actionMemberThumb ( $iProfileId )

actionRemoveAvatar() 공개 메소드

public actionRemoveAvatar ( $iProfileId, $sImg )

actionSetAvatar() 공개 메소드

public actionSetAvatar ( $iProfileId, $sImg )

actionSetAvatarCouple() 공개 메소드

public actionSetAvatarCouple ( $iProfileId, $sImg )

actionSetSiteAvatar() 공개 메소드

public actionSetSiteAvatar ( $sImg )

isAdmin() 공개 메소드

public isAdmin ( )

isAllowedAdd() 공개 메소드

================================== permissions
public isAllowedAdd ( $isPerformAction = false )

isAllowedDelete() 공개 메소드

public isAllowedDelete ( &$aDataEntry, $isPerformAction = false )

isAllowedEdit() 공개 메소드

public isAllowedEdit ( $aDataEntry, $isPerformAction = false )

onEventChanged() 공개 메소드

public onEventChanged ( $iProfileId, $iEntryId, $iCoupleProfileId, $isTryToSuspend = true )

onEventCreate() 공개 메소드

================================== events
public onEventCreate ( $iEntryId )

onEventDeleted() 공개 메소드

public onEventDeleted ( $iEntryId, $aDataEntry = [] )

serviceCropTool() 공개 메소드

Returns crop image html, it consists of image for cropping, cropping preview and descriptions
public serviceCropTool ( $aParams )
$aParams dir_image - image path url_image - image url

serviceDeleteProfileAvatars() 공개 메소드

Delete all profile's avatars
public serviceDeleteProfileAvatars ( $iProfileId ) : true
$iProfileId - profile ID to delete avatar for
리턴 true on success, false on error

serviceGetMyAvatars() 공개 메소드

My avatars html
public serviceGetMyAvatars ( $iProfileId ) : html
$iProfileId - profile's ID to display avatars for
리턴 html with my avatars

serviceGetSiteAvatars() 공개 메소드

Site avatars html
public serviceGetSiteAvatars ( $iPage ) : html
$iPage - current page in site avatars
리턴 html with site avatars

serviceGetWallData() 공개 메소드

Register 'add avatar' and 'change avatar' events for wall
public serviceGetWallData ( )

serviceGetWallPost() 공개 메소드

Html to display on profile wall, when user uploads new avatar
public serviceGetWallPost ( $aEvent ) : html
$aEvent - wall event parameters
리턴 html to post on profile's wall

serviceJoin() 공개 메소드

After join redirection This serice automatically log in joined user and redirects him to avatar copping page
public serviceJoin ( $iMemID, $sStatusText ) : false
$iMemID - joined profile ID
$sStatusText - status text to display at the top of page, like 'join success'
리턴 false on error, 'EXIT' string on success

serviceMakeAvatarFromImage() 공개 메소드

make avatar from particular image, also it makes it square
public serviceMakeAvatarFromImage ( $sImg ) : true
$sImg path to the image
리턴 true on success or false on error

serviceMakeAvatarFromImageUrl() 공개 메소드

make avatar from image url, also it makes it square
public serviceMakeAvatarFromImageUrl ( $sImgUrl ) : true
리턴 true on success or false on error

serviceMakeAvatarFromSharedPhotoAuto() 공개 메소드

get image from photos module and make avatar from it also it makes it square
public serviceMakeAvatarFromSharedPhotoAuto ( $iSharedPhotoId ) : true
$iSharedPhotoId photo id from photos module
리턴 true on success or false on error

serviceManageAvatars() 공개 메소드

public serviceManageAvatars ( $iProfileId, $isAddJsCss = false )

serviceSetImageForCropping() 공개 메소드

You can point image for cropping and then redirect to avatar module page, your image will be ready for cropping. You can use it in your module, if you want allow users to set any image from your module as avatar.
public serviceSetImageForCropping ( $iProfileId, $sOrigPath ) : true
$iProfileId - profile id to set avatar for
$sOrigPath - image path
리턴 true on succrss, false on error

프로퍼티 상세

$_aAllowedExt 공개적으로 프로퍼티

public $_aAllowedExt

$_iProfileId 공개적으로 프로퍼티

public $_iProfileId