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: Independent Categories Permission  (Read 3920 times)

0 Members and 1 Guest are viewing this topic.

khoking

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Independent Categories Permission
« on: March 03, 2007, 06:26:09 pm »

Is it possible to have independent categories permission?

There are categories (eg. Contest Category) that I don't want to show member's name and info in the albums and photos there, but for General Photography Category, I still want to have info shown.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Independent Categories Permission
« Reply #1 on: March 05, 2007, 07:44:40 am »

Permissions by category has been requested often already.
Logged

youngan

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Independent Categories Permission
« Reply #2 on: June 10, 2007, 05:36:35 am »

I made a mod to address this problem.

1. Add column called visibility to cpg_categories (int 11 not null default 0).  I made it just like the column in the album table.

2. On the index.php page around line 137.

Replace
    $result = cpg_db_query("SELECT cid, name, description, thumb FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '$parent'  ORDER BY $cat_sort_order");


With
   If (!USER_ID) {
         $result = cpg_db_query("SELECT cid, name, description, thumb FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '$parent' and visibility = 0 ORDER BY $cat_sort_order");
   }
   else {
       $result = cpg_db_query("SELECT cid, name, description, thumb FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '$parent' ORDER BY $cat_sort_order");
   }

3. You can either manually make changes to the category table for the visibility column or you can modify the catmgr.php page.

1 = not visible
0 = visible

Cheers,

Angie
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.