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
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$_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