Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+7 -7
View File
@@ -12,7 +12,7 @@
namespace IPS\gallery\api;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -39,7 +39,7 @@ class _images extends \IPS\Content\Api\ItemController
* @apiparam int locked If 1, only images which are locked are returned, if 0 only unlocked
* @apiparam int hidden If 1, only images which are hidden are returned, if 0 only not hidden
* @apiparam int featured If 1, only images which are featured are returned, if 0 only not featured
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title' or leave unspecified for ID
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title', 'updated' or leave unspecified for ID
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
* @apiparam int page Page number
* @apiparam int perPage Number of results per page - defaults to 25
@@ -84,7 +84,7 @@ class _images extends \IPS\Content\Api\ItemController
* POST /gallery/images
* Upload an image
*
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock images).
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock images).
* @reqapiparam int album The ID number of the album the image should be created in - not required if category is provided (only provide one or the other)
* @reqapiparam int category The ID number of the category the image should be created in - not required if album is provided (only provide one or the other)
* @reqapiparam int author The ID number of the member uploading the image (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
@@ -113,7 +113,7 @@ class _images extends \IPS\Content\Api\ItemController
* @return \IPS\gallery\Image
*/
public function POSTindex()
{
{
/* Get category or album */
if ( isset( \IPS\Request::i()->album ) )
{
@@ -210,7 +210,7 @@ class _images extends \IPS\Content\Api\ItemController
if( \IPS\Image::exifSupported() )
{
$image->metadata = $imageObject->parseExif();
if( count( $image->metadata ) )
if( \count( $image->metadata ) )
{
$image->parseGeolocation();
$image->gps_show = isset( \IPS\Request::i()->gpsShow ) ? \IPS\Request::i()->gpsShow : 1;
@@ -233,7 +233,7 @@ class _images extends \IPS\Content\Api\ItemController
* POST /gallery/images/{id}
* Edit an image
*
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock topics).
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock topics).
* @apiparam int album The ID number of the album (only provide this or category to move image)
* @apiparam int category The ID number of the category (only provide this or category to move image)
* @apiparam int author The ID number of the member uploading the image (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
@@ -244,12 +244,12 @@ class _images extends \IPS\Content\Api\ItemController
* @apiparam int gpsShow If the image contains the location in it's EXIF data, 1/0 indicating if a map should be shown (defaults to 1)
* @apiparam string prefix Prefix tag
* @apiparam string tags Comma-separated list of tags (do not include prefix)
* @apiparam datetime date The date/time that should be used for the image post date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member.
* @apiparam string ip_address The IP address that should be stored for the image. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member.
* @apiparam int locked 1/0 indicating if the image should be locked
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
* @apiparam int pinned 1/0 indicating if the image should be locked
* @apiparam int featured 1/0 indicating if the image should be featured
* @param int $id ID Number
* @throws 2G316/7 INVALID_ID The image ID is invalid or the authorized user does not have permission to view it
* @throws 1G316/8 NO_CATEGORY_OR_ALBUM The category or album does not exist or the authorized user does not have permission to post in it
* @throws 1G316/9 NO_AUTHOR The author ID does not exist