Hide Categories Hide Categories
 

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]

Main Menu

Hide Categories

Started by haters, August 05, 2014, 10:27:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

haters

Hiya,

I have files uploaded, and albums in categories like so

Example
2001 - album 1, 2, 3
2003

etc.

Can I hide the categories without deleting them?

Αndré

Do you want to hide all categories or just some of them?

haters

There is the main category (no albums, just other categories aka years)

I want to hide them all - I'm guessing just by hiding the category that holds the other categories.

Αndré


haters

That'll remove all categories?  I just want to remove the one.

Example I have

WANT TO REMOVE vvvv without deleting it all.
(category)Edited Photos
(category)-2001
(category)-2002


(category)Non Edited Photos
(category)-2001
(category)-2002


Αndré

Erm... :o

Please post a link to your gallery and explain exactly what you want to do, i.e. which category you want to hide and which not.


haters

It's just local host at the moment.

Hopefully this explains it:

I don't want to *DELETE* the files/albums - I just want to hide the category from all of the gallery.

There is just ONE category that I want to hide

Αndré

Please attach a screenshot of your main page, so I can get an idea how your gallery is structured.

Keep in mind that hiding a category doesn't restricts the access to that category, its sub-categories and all albums. Additionally, pictures of albums in that categories will also be displayed in the meta albums (lastup, lastcom, etc.). Before I start to create custom code, is this what you're looking for?

haters

I only have latest updated album and last viewed - so just hiding them is fine, as no one will really be able to find them (though possible)

Main page + inside the category
http://share.pho.to/6cPwp

Αndré

Unfortunately you cropped your image too much, as I don't see if you display sub-categories or not. I assume you don't, but I can't be sure.

haters

I just display the main category, no sub categories on the main page :)

Αndré

Copy the function theme_display_cat_list from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.

Find
foreach($cat_data as $category) {
and below, add
        if (strpos($category[0], '<a href="index.php?cat=11">') !== FALSE) {
            continue;
        }


Don't forget to update the "cat" parameter with your actual category ID (in this example "11").

haters

I wasn't the one who created my themes but it appears they are all in html files, and the .php is an empty files.

I'm guessing the gallery part of the theme runs off of the "{GALLERY}" in the .html file. :/

Αndré


phill104

#14
If you read the little bit at the top of Andre's post you will see what to do. The theme.php contains overrides of any function in the core code. We use it there so updates to the core do not affect your custom themes. If there are no functions that need custom code then the theme.php file can be almost empty. In your case we need to modify the function "theme_display_list" so frist that block of code needs copying into your theme.php file where we can safely apply the modifications. You will find the block in the location Andre mentioned below. Copy the complete block (not the whole file). There are very obvious markers showing where each function begins and ends. Once you have the file in your custom theme.php you can apply the modification.

** Andre beat me to it.
It is a mistake to think you can solve any major problems just with potatoes.

haters

Ahh, my bad I must have made something completely wrong out of your post, Andre. Thank you for that, that helped. Much appreciated.

Just one more thing, is it possible to disable images from that category showing in the 'most viewed pictures' - I completely forgot about that being a page in the gallery.

Αndré

Quote from: Αndré on August 05, 2014, 11:42:32 AM
pictures of albums in that categories will also be displayed in the meta albums (lastup, lastcom, etc.)


If you want to hide pictures of your hidden categories from meta albums, you either need to modify each meta albums SQL queries, or even simpler: set the permissions of all affected albums accordingly. This way, you don't need any further custom code and don't need to modify core files.