Mini Back-end Gallery - API
Gallery module created by Arlind Nushi
Defined functions:
Album Functions
Image Functions
function : getAllAlbums($order = 'ASC') - top
Get all images on the database.
Function parameters
$order - Set the order of fetched albums. Accepted values: ASC or DESC.
Return type
Array
function : albumExists($album_id) - top
Checks whether album exists or not.
Function parameters
$album_id - Album ID
Return type
Boolean
function : getAlbum($album_id) - top
Get album information as an array or null value if album id doesn't exists.
Function parameters
$album_id - Album ID
Return type
Array (AlbumID, AlbumName, Description, DateCreated, Thumbnail1Size, Thumbnail2Size, Thumbnail3Size, OrderID)
function : totalAlbums() - top
Get total number of albums created.
Function parameters
No parameters
Return type
Integer
function : moveAlbumUP($album_id) - top
Change the order of albums. Move $album_id upper from the nearest album.
Function parameters
$album_id - Album ID
Return type
Void
function : moveAlbumDOWN($album_id) - top
Change the order of albums. Move $album_id under the nearest album.
Function parameters
$album_id - Album ID
Return type
Void
function : deleteAlbum($album_id) - top
Delete an album and all of its images (if there is any on it). Returns true if the action is done successfully or false if album doesn't exists!
Function parameters
$album_id - Album ID
Return type
Boolean
function : getAlbumImages($album_id, $order = ASC) - top
Get all album images from $album_id in the ASCENDING order by default.
Function parameters
$album_id - Album ID
$order - Order of images you get from album. Accepted values: ASC or DESC
Return type
Array
function : editAlbum($album_id, $album_name, $description = '', $thumbnail1 = null, $thumbnail2 = null, $thumbnail3 = null) - top
This functions changes album properties such as name, description and thumbnail sizes.
Function parameters
$album_id - Album ID
$album_name - New album name
$description - New album description
$thumbnail1 - Size of first thumbnail that will be generated after upload (empty value will not create thumbnail)
$thumbnail2 - Size of second thumbnail (accepted format numberxnumber i.e. 100x125)
$thumbnail3 - Size of third thumbnail
Return type
Void
function : imageExists($image_id) - top
Check whether given image id exists or not.
Function parameters
$image_id - Album ID
Return type
Boolean
function : getImage($image_id) - top
Get specific image based on ID.
Function parameters
$image_id - Album ID
Return type
Array (ImageID, AlbumID, ImagePath, Name, UploadDate, OrderID, DefaultThumbnail, Thumbnail1, Thumbnail2, Thumbnail3)
function : deleteImage($image_id) - top
Delete an image. True value will be returned if it has been deleted, otherwise false value will indicate that image doesn't exists.
Function parameters
$image_id - Album ID
Return type
Boolean
function : setImageName($image_id, $name) - top
Set the name of an image.
Function parameters
$image_id - Album ID
$name - New image name
Return type
Void
function : getAllImages($order = 'ASC') - top
Get all images on the database.
Function parameters
$order - Set the order of images. Accepted values: ASC or DESC.
Return type
Array
An example how you can use some of these functions can be found on
this file.