The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
photos.php File Reference

Functions related to photo handling. More...

Functions

 photo_upload ($channel, $observer, $args)
 Upload a photo. More...
 
 photo_calculate_scale ($arr)
 
 photos_albums_list ($channel, $observer, $sort_key= 'display_path', $direction= 'asc')
 Returns a list with all photo albums observer is allowed to see. More...
 
 photos_album_widget ($channelx, $observer, $sortkey= 'display_path', $direction= 'asc')
 
 photos_list_photos ($channel, $observer, $album= '')
 Return an array of photos. More...
 
 photos_album_exists ($channel_id, $observer_hash, $album)
 Check if given photo album exists in channel. More...
 
 photos_album_rename ($channel_id, $oldname, $newname)
 Renames a photo album in a channel. More...
 
 photos_album_get_db_idstr ($channel_id, $album, $remote_xchan= '')
 
 photos_create_item ($channel, $creator_hash, $photo, $visible=false)
 Creates a new photo item. More...
 
 getGps ($exifCoord, $hemi)
 
 getGpstimestamp ($exifCoord)
 
 gps2Num ($coordPart)
 
 photo_profile_setperms ($channel_id, $resource_id, $profile_id)
 
 profile_photo_set_profile_perms ($uid, $profileid=0)
 

Detailed Description

Functions related to photo handling.

Function Documentation

getGps (   $exifCoord,
  $hemi 
)

Referenced by photo_upload().

getGpstimestamp (   $exifCoord)
gps2Num (   $coordPart)

Referenced by getGps(), and getGpstimestamp().

photo_calculate_scale (   $arr)

Referenced by photo_upload().

photo_profile_setperms (   $channel_id,
  $resource_id,
  $profile_id 
)
photo_upload (   $channel,
  $observer,
  $args 
)

Upload a photo.

Parameters
array$channel
array$observer
array$args
Returns
array
Hooks:
photo_upload_end Called when a photo upload has been processed.
Hooks:
photo_post_end Called after uploading a photo.
Hooks:
photo_post_end Called after uploading a photo.
Hooks:
photo_upload_end Called when a photo upload has been processed.
Hooks:
photo_upload_end Called when a photo upload has been processed.
Hooks:
photo_upload_end Called when a photo upload has been processed.

Referenced by attach_store(), Zotlabs\Module\Wall_upload\post(), and reflect_photo_callback().

photos_album_exists (   $channel_id,
  $observer_hash,
  $album 
)

Check if given photo album exists in channel.

Parameters
int$channel_idid of the channel
string$observer_hash
string$albumname of the album
Returns
boolean

Referenced by Zotlabs\Module\Photos\get(), and Zotlabs\Module\Photos\post().

photos_album_get_db_idstr (   $channel_id,
  $album,
  $remote_xchan = '' 
)
Parameters
int$channel_id
string$album
string$remote_xchan(optional) default empty
Returns
string|boolean

Referenced by Zotlabs\Module\Photos\post().

photos_album_rename (   $channel_id,
  $oldname,
  $newname 
)

Renames a photo album in a channel.

Todo:
Do we need to check if new album name already exists?
Parameters
int$channel_idid of the channel
string$oldnameThe name of the album to rename
string$newnameThe new name of the album
Returns
bool|array
photos_album_widget (   $channelx,
  $observer,
  $sortkey = 'display_path',
  $direction = 'asc' 
)
photos_albums_list (   $channel,
  $observer,
  $sort_key = 'display_path',
  $direction = 'asc' 
)

Returns a list with all photo albums observer is allowed to see.

Returns an associative array with all albums where observer has permissions.

Parameters
array$channel
array$observer
array$sort_key(optional) default album
array$direction(optional) default asc
Returns
bool|array false if no view_storage permission or an array
  • boolean success
  • array albums

Referenced by api_albums(), Zotlabs\Module\Embedphotos\embedphotos_album_list(), Zotlabs\Module\Photos\get(), and photos_album_widget().

photos_create_item (   $channel,
  $creator_hash,
  $photo,
  $visible = false 
)

Creates a new photo item.

Parameters
array$channel
string$creator_hash
array$photo
boolean$visible(optional) default false
Returns
int item_id

Referenced by Zotlabs\Module\Photos\post().

photos_list_photos (   $channel,
  $observer,
  $album = '' 
)

Return an array of photos.

Parameters
array$channel
array$observer
string$album(optional) default empty
Returns
boolean|array

Referenced by api_photos(), and Zotlabs\Widget\Photo_rand\widget().

profile_photo_set_profile_perms (   $uid,
  $profileid = 0 
)
Parameters
int$uid
int | string$profileid