Private Categories / Sub Albums Private Categories / Sub Albums
 

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

Private Categories / Sub Albums

Started by Cyrolancer, May 09, 2012, 02:27:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cyrolancer

Hello,

I am working on CPG 1.5.20. I am trying to make private categories or sub albums. It seems it is not possible right now (or possible?).

I have thought that if creating private categories or sub albums is not possible, maybe somehow it is possible to set visibility of some categories only to the users that are logged in (Guests should see some of the categories).

Can you please guide me how to do such addition to CPG? I couldn't find where to start, what file to look for this addition.

Thanks a lot.

Αndré

It's not that easy. If you hide categories and/or albums, pictures can still be accessed through the meta albums or by directly visiting the album's thumbnail page or the picture's intermediate-sized pages.

Cyrolancer

Let me explain a little bit.

I have 2 different categories and several sub categories inside them. In one category, Cat A, I made hidden all albums to guests. In the other one, Cat B, everything is visible.

The thing is I am working on a solution that the category Cat A will become invisible to guests, just invisible. In any way you enter the category as guest, you won't see any of the albums or the images inside the albums because they are already set invisible to guests by CPG permission settings.

It is like; if category_id = 5 (Cat A), don't show to guests. Just don't show. If the guest can find the way to enter that category, he won't be seeing anything due to CPG permissions.

I am not trying to add any category permissions right now. Just want to remove one category from the main page lists. But  category permissions can be a good feature for the next releases. :)

Αndré

Quote from: Cyrolancer on May 09, 2012, 10:36:57 PM
In one category, Cat A, I made hidden all albums to guests.
If everything is hidden, it is empty for guests, right? If so, use this plugin: http://forum.coppermine-gallery.net/index.php/topic,69444.0.html

Cyrolancer

Quote from: Αndré on May 10, 2012, 09:13:03 AM
If everything is hidden, it is empty for guests, right?

That is correct. I will try the plugin and then share the results. Hope it works in CPG 1.5.20.

Cyrolancer

The plugin works perfectly in CPG 1.5.20. Thanks Αndré.

Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.

Cyrolancer

Thanks for the tip André.

I have very small question to ask. Is it possible to determine which category is hidden by using the code? Tried some changes but I couldn't manage to handle it. Any tips or suggestions about this topic also appreciated.

Cyrolancer

I have managed to find empty categories. In the function theme_display_cat_list(), there is a $cat_data array. This returns the categories in its first dimension and the category information in its second dimension. If the second dimension of the array returns 3 elements, it means that category is empty. Sample code is below. You can add it anywhere you like in theme_display_cat_list() function.


foreach ($cat_data as $cd) {
    if(count($cd) == 3)
        // Category is empty.
    else
        // Category is not empty.
}