issue #1615 include favorite status in image list API calls

This commit is contained in:
Dave Anderson
2022-07-23 06:43:02 -04:00
committed by GitHub
parent 3239296bf3
commit 231d36613c
4 changed files with 30 additions and 0 deletions
+24
View File
@@ -880,4 +880,28 @@ function url_is_remote($url)
return false;
}
/**
* List favorite image_ids of the current user.
* @since 13
*/
function get_user_favorites()
{
global $user;
if (is_a_guest())
{
return array();
}
$query = '
SELECT
image_id,
1 as fake_value
FROM '.FAVORITES_TABLE.'
WHERE user_id = '.$user['id'].'
';
return query2array($query, 'image_id', 'fake_value');
}
?>