Hiding albums from category/album list view Hiding albums from category/album list view
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Hiding albums from category/album list view

Started by jaus, November 14, 2013, 04:48:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jaus

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?


Αndré

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).

jaus

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.

Αndré

I suggest to create/move that "hidden" album to the root category of Coppermine (* no category *). Then, open index.php, find
    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
$album_filter = ' AND a.aid != 123';
(don't forget to replace the album ID with your album's ID).

jaus

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)'


Αndré

Quote from: jaus on November 20, 2013, 01:02:57 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
$album_filter = ' AND a.aid NOT IN (123, 456, 789)';

jaus