Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Hiding albums from category/album list view  (Read 3966 times)

0 Members and 1 Guest are viewing this topic.

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Hiding albums from category/album list view
« 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?

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hiding albums from category/album list view
« Reply #1 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).
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Hiding albums from category/album list view
« Reply #2 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hiding albums from category/album list view
« Reply #3 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).
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Hiding albums from category/album list view
« Reply #4 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)'

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hiding albums from category/album list view
« Reply #5 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)';
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Hiding albums from category/album list view
« Reply #6 on: November 20, 2013, 02:35:35 pm »

Works fine, thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 21 queries.