mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-11-06 08:52:29 +01:00
issue #2560 person page in the gallery, links from the avatars
This commit is contained in:
1 parent
8e818c9af4
commit
d4c4db36f3
8 files changed
+180
-53
No files matched your search
@@ -357,6 +357,47 @@ else
|
||||
);
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | people section |
|
||||
// +-----------------------------------------------------------------------+
|
||||
else if ($page['section'] == 'people')
|
||||
{
|
||||
$query = '
|
||||
SELECT id
|
||||
FROM '.IMAGES_TABLE.'
|
||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
|
||||
WHERE id IN (
|
||||
SELECT image_id
|
||||
FROM '.IMAGE_PERSON_TABLE.'
|
||||
WHERE person_id = '.$page['person']['id'].'
|
||||
)
|
||||
'.get_sql_condition_FandF(
|
||||
array(
|
||||
'forbidden_categories' => 'category_id',
|
||||
'visible_categories' => 'category_id',
|
||||
'visible_images' => 'id'
|
||||
),
|
||||
' AND'
|
||||
).'
|
||||
GROUP BY id
|
||||
'.$conf['order_by'].'
|
||||
;';
|
||||
$items = query2array($query, null, 'id');
|
||||
|
||||
if (count($items) == 0)
|
||||
{
|
||||
page_not_found(l10n('Requested person does not exist'), get_root_url());
|
||||
}
|
||||
|
||||
$page = array_merge(
|
||||
$page,
|
||||
array(
|
||||
'title' => l10n('People').$conf['level_separator']
|
||||
.'<a href="'.duplicate_index_url(array('start'=>0)).'">'.$page['person']['name'].'</a>',
|
||||
'items' => $items,
|
||||
)
|
||||
);
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | search section |
|
||||
// +-----------------------------------------------------------------------+
|
||||
else if ($page['section'] == 'search')
|
||||
@@ -692,6 +733,11 @@ elseif (isset($page['tags']))
|
||||
}
|
||||
|
||||
}
|
||||
elseif (isset($page['person']))
|
||||
{
|
||||
array_push($page['body_classes'], 'person-'.$page['person']['id']);
|
||||
$page['body_data']['person_id'] = $page['person']['id'];
|
||||
}
|
||||
elseif (isset($page['search']))
|
||||
{
|
||||
array_push($page['body_classes'], 'search-'.$page['search']);
|
||||
|
||||
Reference in new issue
Block a user