forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: jaus on November 14, 2013, 04:48:07 pm

Title: Hiding albums from category/album list view
Post by: jaus on November 14, 2013, 04:48:07 pm
I would like to create some albums that would contain images that can be viewed as a result of a search, but would not appear on the index page as albums that can be selected for browsing.   I don't see a configuration that would hide such albums from view (yet still allow guests to see the images within as a result of a search).  Is there a plug-in, or hack, available that could do this?

Title: Re: Hiding albums from category/album list view
Post by: Αndré on November 14, 2013, 04:59:29 pm
If the images in those albums can only be found as a result of a search, wouldn't it be enough to upload them all in one album and hide just that album?

However, there's no plugin that does what you ask for as far as I know, but it should be quite easy to create a mod (maybe it even already exists).
Title: Re: Hiding albums from category/album list view
Post by: jaus on November 14, 2013, 09:59:07 pm
Yes, one album would work.  More  than one might facilitate recordkeeping and upkeep of the gallery.

If anyone has an idea please post.  The only thought I had was to create the album(s),  find ithe album numbers by browsing the table, and then hack the category display to skip those album numbers. But I'm not a php coder so that might be problematic.
Title: Re: Hiding albums from category/album list view
Post by: Αndré on November 20, 2013, 12:39:21 pm
I suggest to create/move that "hidden" album to the root category of Coppermine (* no category *). Then, open index.php, find
Code: [Select]
    if (!empty($FORBIDDEN_SET) && !$cpg_show_private_album) {
        $album_filter = ' ' . str_replace('p.', 'a.', $FORBIDDEN_SET);
        //unused code {SaWey}
        //$pic_filter = ' ' . $FORBIDDEN_SET;
    }
and below, add
Code: [Select]
$album_filter = ' AND a.aid != 123';(don't forget to replace the album ID with your album's ID).
Title: Re: Hiding albums from category/album list view
Post by: jaus on November 20, 2013, 01:02:57 pm
Like this?

    if (!empty($FORBIDDEN_SET) && !$cpg_show_private_album) {
        $album_filter = ' ' . str_replace('p.', 'a.', $FORBIDDEN_SET);
        //unused code {SaWey}
        //$pic_filter = ' ' . $FORBIDDEN_SET;
    }
   
    $album_filter = ' AND a.aid != 123'



If I used more than one such album, would the last line work like this:?

    $album_filter = ' AND a.aid != (123||456||789)'

Title: Re: Hiding albums from category/album list view
Post by: Αndré on November 20, 2013, 01:58:47 pm
If I used more than one such album, would the last line work like this:?

    $album_filter = ' AND a.aid != (123||456||789)'

Use
Code: [Select]
$album_filter = ' AND a.aid NOT IN (123, 456, 789)';
Title: Re: Hiding albums from category/album list view
Post by: jaus on November 20, 2013, 02:35:35 pm
Works fine, thanks.