Pages (2):    1 2
Member
Member
ctdlg   27-01-2026, 18:40
#11

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.

Administrator
Administrator
acrylian   27-01-2026, 19:25
#12

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.

Member
Member
ctdlg   14-03-2026, 17:54
#13

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!

Administrator
Administrator
acrylian   14-03-2026, 18:50
#14

Sorry, I didn't get around to test the code above I suggested at all…

If I see right, you are "mis-using" the $_SESSION superglobal like to a cookie to know where the search request came from? Interesting!As usual whatever fits works ;-)

Member
Member
ctdlg   15-03-2026, 08:32
#15

Yes, I'm repurposing the session's primary function!
I have added other values to get different search answers depending on the context of the displayed page!

Pages (2):    1 2
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.