I turned on debug and notices today to see what it might turn up and found a couple of niggly problems. One of these is the notice:
/include/themes.inc.php
- Notice line 88: Undefined variable: cpg_show_private_album
which a search turns up on many support messages in this forum and it turned out to be easy to fix. First I noticed that it is used in the
get_meta_album_set function which index.php calls before it sets the variable. This was easy to fix by just moving the line in index.php:
Find this in index.php:
if (isset($cat)) {
get_meta_album_set($cat,$META_ALBUM_SET);
} else {
get_meta_album_set(0,$META_ALBUM_SET);
}
$cpg_show_private_album = ($CONFIG['allow_private_albums'])?($CONFIG['show_private']):(true);
get_cat_list($breadcrumb, $cat_data, $statistics);
and change it to this:
$cpg_show_private_album = ($CONFIG['allow_private_albums'])?($CONFIG['show_private']):(true);
if (isset($cat)) {
get_meta_album_set($cat,$META_ALBUM_SET);
} else {
get_meta_album_set(0,$META_ALBUM_SET);
}
get_cat_list($breadcrumb, $cat_data, $statistics);
While that is probably needed for proper function (I didn't actually test this as I don't use private albums), it didn't silence the notice. To do that you need to add $cpg_show_private_album to the list of globals in get_meta_album_set.
Find this in include/functions.inc.php:
function get_meta_album_set($cat, &$meta_album_set)
{
global $USER_DATA, $FORBIDDEN_SET_DATA, $CONFIG;
and change it to this:
function get_meta_album_set($cat, &$meta_album_set)
{
global $USER_DATA, $FORBIDDEN_SET_DATA, $CONFIG, $cpg_show_private_album;
and the notice disappears.
Please note that I didn't test the proper operation of any of these changes on the use of private albums as I don't use them on my site, but they do fix the notice and they appear to be fairly straightforward and otherwise harmless code fixes from inspection alone so I hope they help someone.