mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-14 22:25:57 +03:00
issue #1615 include favorite status in image list API calls
This commit is contained in:
parent
3239296bf3
commit
231d36613c
4 changed files with 30 additions and 0 deletions
|
@ -77,6 +77,7 @@ SELECT id, name, permalink, image_order
|
|||
$order_by = $cats[ $params['cat_id'][0] ]['image_order'];
|
||||
}
|
||||
$order_by = empty($order_by) ? $conf['order_by'] : 'ORDER BY '.$order_by;
|
||||
$favorite_ids = get_user_favorites();
|
||||
|
||||
$query = '
|
||||
SELECT SQL_CALC_FOUND_ROWS i.*, GROUP_CONCAT(category_id) AS cat_ids
|
||||
|
@ -93,6 +94,7 @@ SELECT SQL_CALC_FOUND_ROWS i.*, GROUP_CONCAT(category_id) AS cat_ids
|
|||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
$image = array();
|
||||
$image['is_favorite'] = isset($favorite_ids[ $row['id'] ]);
|
||||
foreach (array('id', 'width', 'height', 'hit') as $k)
|
||||
{
|
||||
if (isset($row[$k]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue