Sorry for late reply !
if(!in_array('albumname_to_exclude', $_zp_current_search->album_list)) {
$paramstr = 'excludealbums=orientation';
$_zp_current_search->setSearchParams($paramstr);
}
gives me a blank page.
I understand the principle, but even after correcting the code, the album I'm searching for isn't being taken into account. It's as if the parameter isn't being retrieved on the search.php page.
As mentioned the code above was quickly off hand and not tested as I had never to try this. Best you review the log to see what the error is.
Did you actually also modify the search form function paramater on the specific album that is otherwise exclude? If not it is of course not passed to check at all, too.
I will see if I get the chance to try myself the next days.
Here's my solution:
Index.php:
// 1. First, we manage the session
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// 2. We store the session variable
$_SESSION['provenance_album'] = 'fromIndex';
// 3. Finally, we include the header
include_once('header.php');
And search.php:
if (session_status() == PHP_SESSION_NONE) { session_start(); }
$albumencours = isset($_SESSION['provenance_album']) ? $_SESSION['provenance_album'] : 'Default';
include_once('header.php');
// Definition of exclusion according to the current album
if ($current album == "fromVR") {
$_REQUEST['excludealbums'] = 'Themes,Animus,Backend-Audio,BP,Demos,Simalateur-A1,Tests,illusions,Grand-Piano';
} else {
$_REQUEST['excludealbums'] = 'VR,Animus,Backend-Audio,BP,Demos,Simalateur-A1,Tests,illusions,Grand-Piano';
}
$_zp_current_search = new SearchEngine();
Finally, album-vr.php:
if (session_status() == PHP_SESSION_NONE) { session_start(); }
// force UTF-8 Ø
if (!defined('WEBPATH')) {
die();
}
// We store the name of the current album folder
$_SESSION['provenance_album'] = 'depuisVR';
?>
This way, I can perform as many searches as there are use cases across different areas of my site, including individual pages!