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: Hide Categories  (Read 5479 times)

0 Members and 1 Guest are viewing this topic.

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Hide Categories
« on: August 05, 2014, 10:27:54 am »

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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #1 on: August 05, 2014, 10:58:08 am »

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

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #2 on: August 05, 2014, 11:22:57 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #3 on: August 05, 2014, 11:24:52 am »

Remove "catlist" from The content of the main page
Logged

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #4 on: August 05, 2014, 11:27:09 am »

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

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #5 on: August 05, 2014, 11:30:35 am »

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.

Logged

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #6 on: August 05, 2014, 11:33:55 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #7 on: August 05, 2014, 11:42:32 am »

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?
Logged

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #8 on: August 05, 2014, 11:50:23 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #9 on: August 05, 2014, 12:01:44 pm »

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

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #10 on: August 05, 2014, 12:08:53 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #11 on: August 05, 2014, 12:30:46 pm »

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
Code: [Select]
foreach($cat_data as $category) {and below, add
Code: [Select]
        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").
Logged

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #12 on: August 05, 2014, 12:45:54 pm »

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. :/
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #13 on: August 05, 2014, 01:04:48 pm »

Just follow my guide.
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4659
    • Windsurf.me
Re: Hide Categories
« Reply #14 on: August 05, 2014, 01:06:22 pm »

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.
« Last Edit: August 05, 2014, 03:03:58 pm by Phill Luckhurst »
Logged
It is a mistake to think you can solve any major problems just with potatoes.

haters

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Hide Categories
« Reply #15 on: August 05, 2014, 01:18:34 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Hide Categories
« Reply #16 on: August 05, 2014, 01:25:12 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.