I am sorry to trouble you with this but I tried adding `if (!is_object($_zp_gallery)) $_zp_gallery = new Gallery();` before the $context line. This generates errors:
`
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php:1) in /home/content/n/a/t/naturalenq/html/testgalleries/index.php on line 24
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php:1) in /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php on line 1553
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php:1) in /home/content/n/a/t/naturalenq/html/testgalleries/index.php on line 111
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php:1) in /home/content/n/a/t/naturalenq/html/testgalleries/index.php on line 112
Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/a/t/naturalenq/html/testgalleries/zp-core/functions.php:1) in /home/content/n/a/t/naturalenq/html/testgalleries/index.php on line 113
`
I expect I'm placing it incorrectly or leaving out something? Wasn't sure if I needed to include {}, e.g.
In functions.php, beginning of function is
`
function handleSearchParms($what, $album=NULL, $image=NULL) {
global $_zp_current_search, $zp_request, $_zp_last_album, $_zp_search_album_list, $_zp_current_album,
$_zp_current_zenpage_news, $_zp_current_zenpage_page;;
$_zp_last_album = zp_getCookie('zenphoto_last_album');
if (is_null($album)) {
if (is_object($zp_request)) {
$reset = get_class($zp_request) != 'SearchEngine';
} else {
$reset = $zp_request;
}
if ($reset) { // clear the cookie if no album and not a search
if (!isset($_REQUEST['preserve_serch_params'])) {
zp_setcookie("zenphoto_search_params", "", time()-368000);
}
return;
}
}
if (!is_object($_zp_gallery)) $_zp_gallery = new Gallery();
$context = get_context();
$params = zp_getCookie('zenphoto_search_params');
`