Try this code as codebase.php. It suppresses the filters when viewing the albums directly and is coded more simply.
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2005 Coppermine Dev Team
v1.1 originaly written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.2
**********************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
$thisplugin->add_filter('plugin_block','remove_meta_albs'); //index.php
if (!$_GET['cat']) {
$thisplugin->add_filter('post_breadcrumb','remove_meta_albs'); //thumbnails.php
if (!is_numeric($_GET['album'])) $thisplugin->add_filter('displayimage_init','remove_meta_albs'); //displayimage.php (MODDED PLUGIN HOOK)
}
function filter_meta_album() {
global $META_ALBUM_SET,$ALBUM_SET;
$unwanted_albs=array(4, 5);
$META_ALBUM_SET.= ' AND aid NOT IN ('.implode(',',$unwanted_albs).')';
if (defined('DISPLAYIMAGE_PHP')) $ALBUM_SET = $META_ALBUM_SET;
}
function remove_meta_albs($return) {
static $run_once;
if (!$run_once) {
filter_meta_album();
$run_once=true;
}
return $return;
}