mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
issue #2016 save search in history
This commit is contained in:
@@ -494,7 +494,7 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
$section = $page['section'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = '
|
||||
INSERT INTO '.HISTORY_TABLE.'
|
||||
(
|
||||
@@ -504,6 +504,7 @@ INSERT INTO '.HISTORY_TABLE.'
|
||||
IP,
|
||||
section,
|
||||
category_id,
|
||||
search_id,
|
||||
image_id,
|
||||
image_type,
|
||||
format_id,
|
||||
@@ -518,6 +519,7 @@ INSERT INTO '.HISTORY_TABLE.'
|
||||
\''.$ip.'\',
|
||||
'.(isset($section) ? "'".$section."'" : 'NULL').',
|
||||
'.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').',
|
||||
'.(isset($page['search_id']) ? $page['search_id'] : 'NULL').',
|
||||
'.(isset($image_id) ? $image_id : 'NULL').',
|
||||
'.(isset($image_type) ? "'".$image_type."'" : 'NULL').',
|
||||
'.(isset($format_id) ? $format_id : 'NULL').',
|
||||
|
||||
@@ -27,6 +27,8 @@ function get_search_id_pattern($candidate)
|
||||
|
||||
function get_search_info($candidate)
|
||||
{
|
||||
global $page;
|
||||
|
||||
// $candidate might be a search.id or a search_uuid
|
||||
$clause_pattern = get_search_id_pattern($candidate);
|
||||
|
||||
@@ -57,6 +59,12 @@ SELECT *
|
||||
fatal_error('this search is not reachable with its id, need the search_uuid instead');
|
||||
}
|
||||
|
||||
if (isset($page['section']) and 'search' == $page['section'])
|
||||
{
|
||||
// to be used later in pwg_log
|
||||
$page['search_id'] = $searches[0]['id'];
|
||||
}
|
||||
|
||||
return $searches[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -1023,6 +1023,7 @@ SELECT
|
||||
'SECTION' => $line['section'],
|
||||
'FULL_CATEGORY_PATH' => isset($full_cat_path[$line['category_id']]) ? strip_tags($full_cat_path[$line['category_id']]) : l10n('Root').$line['category_id'],
|
||||
'CATEGORY' => isset($name_of_category[$line['category_id']]) ? $name_of_category[$line['category_id']] : l10n('Root').$line['category_id'],
|
||||
'SEARCH_ID' => $line['search_id'] ?? null,
|
||||
'TAGS' => explode(",",$tag_names),
|
||||
'TAGIDS' => explode(",",$tag_ids),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user