• [MOD] Apply permission to sub-categories from their parent category 5 0 5 1
Currently:  

Author Topic: [MOD] Apply permission to sub-categories from their parent category  (Read 84888 times)

0 Members and 1 Guest are viewing this topic.

Offline kief24

  • Sr. Member
  • ****
  • Posts: 267
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #15 on: February 22, 2006, 03:02:01 PM »
Is it possible to set (change) permissions for all categories (at once) ?

Offline Threnody

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #16 on: February 23, 2006, 06:48:32 PM »
V@no,

This is great MOD, thanks so much for sharing it!  I just know this will be a real time saver!  :)

namaste,
Threnody

Offline wallpapers

  • Full Member
  • ***
  • Posts: 107
    • View Profile
    • Tuned-Cars.Net
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #17 on: February 23, 2006, 07:59:24 PM »
This is a perfect mod  :D
and it work also perfect  :lol:

thx v@no :mrgreen:



Offline lemccoy

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • DrunkIsland
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #18 on: February 23, 2006, 08:39:29 PM »
Is it possible to set (change) permissions for all categories (at once) ?

This is a great mod, easy install and works great.  I also am interested in above. 

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #19 on: February 24, 2006, 12:39:36 AM »
Is it possible to set (change) permissions for all categories (at once) ?
Not with this mod.
If you are interested, I can provide you with MySQL query that you can run in phpmyadmin...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kief24

  • Sr. Member
  • ****
  • Posts: 267
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #20 on: February 24, 2006, 07:57:59 AM »
Is it possible to set (change) permissions for all categories (at once) ?
Not with this mod.
If you are interested, I can provide you with MySQL query that you can run in phpmyadmin...

yes, i am very interested :)

thx

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #21 on: February 25, 2006, 01:11:50 AM »
Ok, here it is:[qcode]UPDATE 4images_categories SET
auth_viewcat = xx,
auth_viewimage = xx,
auth_download = xx,
auth_upload = xx,
auth_directupload = xx,
auth_vote = xx,
auth_sendpostcard = xx,
auth_readcomment = xx,
auth_postcomment = xx[/qcode]
The xx is one of the following:
  • 0 = All
  • 2 = Only registered members
  • 3 = Private
  • 9 = Admins only
These are default settings, but to make sure double check in includes/constants.php:
Code: [Select]
// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);


You can remove auth_xxx from the query if you DON'T want to update that permission.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kief24

  • Sr. Member
  • ****
  • Posts: 267
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #22 on: February 25, 2006, 08:26:48 AM »
that worked just perfect ! thx a lot !!  :D

Offline yerpo

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #23 on: February 25, 2006, 10:47:12 AM »
Works like a charm. Luckily I didn't go changing each directory's permissions before seeing this  :mrgreen:

Offline yerpo

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #24 on: March 11, 2006, 05:46:21 PM »
Does this mod work in version 1.7.2? It was very useful and I don't know why you didn't include it in the new version.

Offline ktwenrick

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #25 on: March 12, 2006, 12:07:15 AM »
doesnt work in 1.7.2 i get an error

Fatal error: Cannot redeclare get_subcategories_id() (previously declared in /gallery/admin/categories.php:333) in /gallery/admin/categories.php on line 645

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #26 on: March 12, 2006, 01:23:44 AM »
From Step 1.1 of this mod remove
Code: [Select]
      function get_subcategories_id($cat_id = 0)
      {
        global $subcat_ids, $cat_parent_cache;
     
        if (!isset($cat_parent_cache[$cat_id]))
        {
          return false;
        }
        foreach ($cat_parent_cache[$cat_id] as $key => $val)
        {
          $subcat_ids[] = $val;
          get_subcategories_id($val);
        }
        return $subcat_ids;
      }
v1.7.2 already has this function.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline wallpapers

  • Full Member
  • ***
  • Posts: 107
    • View Profile
    • Tuned-Cars.Net
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #27 on: April 13, 2006, 06:58:47 AM »
From Step 1.1 of this mod remove
Code: [Select]
      function get_subcategories_id($cat_id = 0)
      {
        global $subcat_ids, $cat_parent_cache;
     
        if (!isset($cat_parent_cache[$cat_id]))
        {
          return false;
        }
        foreach ($cat_parent_cache[$cat_id] as $key => $val)
        {
          $subcat_ids[] = $val;
          get_subcategories_id($val);
        }
        return $subcat_ids;
      }
v1.7.2 already has this function.

Thanks V@no this works perfect :lol:



Offline fitterashes

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #28 on: April 14, 2006, 10:05:09 PM »
Ok, here it is:[qcode]UPDATE 4images_categories SET
auth_viewcat = xx,
auth_viewimage = xx,
auth_download = xx,
auth_upload = xx,
auth_directupload = xx,
auth_vote = xx,
auth_sendpostcard = xx,
auth_readcomment = xx,
auth_postcomment = xx[/qcode]
The xx is one of the following:
  • 0 = All
  • 2 = Only registered members
  • 3 = Private
  • 9 = Admins only

is it possible to define categories to apply the changes ?
ex : UPDATE 4images_categories 200 to 500 SET [...]

(yeah i don't know anything about sql requests)

Offline fitterashes

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #29 on: April 14, 2006, 10:31:11 PM »
Ok, I answer myself  :D

Code: [Select]
UPDATE 4images_categories SET
auth_viewcat = x,
auth_viewimage = x,
auth_download = x,
auth_upload = x,
auth_directupload = x,
auth_vote = x,
auth_sendpostcard = x,
auth_readcomment = x,
auth_postcomment = x

WHERE cat_id=Y

or WHERE cat_id>Y etc...