• [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 62823 times)

0 Members and 1 Guest are viewing this topic.

Offline ivan

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.279
    • View Profile
    • Bilder Gallery
[MOD] Apply permission to sub-categories from their parent category 1.7.4-1.7.6
« Reply #45 on: February 05, 2008, 08:30:18 PM »
Dieser MOD kann die Rechte einer Kategorie mit allen Unterkategorien aktualisieren.

Läuft mit 4images 1.7.4-1.7.6
Work with 4images 1.7.4-1.7.6


Step 1
Open admin/categories.php

Find:
Code: [Select]
  $auth_sendpostcard = $HTTP_POST_VARS['auth_sendpostcard'];
  $auth_readcomment = $HTTP_POST_VARS['auth_readcomment'];
  $auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];

Insert below:
Code: [Select]
// MOD SUBCAT PERM FROM PARENT START
  $subcats = (isset($HTTP_POST_VARS['subcats']) && $HTTP_POST_VARS['subcats']) ? 1 : 0;
// MOD SUBCAT PERM FROM PARENT END


Step 1.1
Find:
Code: [Select]
    $msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];
Insert above:
Code: [Select]
// MOD SUBCAT PERM FROM PARENT START
    if ($subcats)
    {
      $subcat_ids = array();
      $subcat_ids = get_subcategories_id($cat_id);
      if (!empty($subcat_ids))
      {
        $sql = "UPDATE ".CATEGORIES_TABLE."
                SET auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
                WHERE cat_id IN (".implode($subcat_ids, ",").")";
        $result = $site_db->query($sql);
      }
    }
// MOD SUBCAT PERM FROM PARENT END


Step 1.2
Find:
Code: [Select]
  show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
Insert above:
Code: [Select]
// MOD SUBCAT PERM FROM PARENT START
  show_radio_row($lang['sub_categories_permission'], "subcats", $subcats);
// MOD SUBCAT PERM FROM PARENT END

Step 1.3
Open lang/admin.php
Find:
Code: [Select]
$lang['save_changes'] = "Save changes";
Replace:
Code: [Select]
$lang['save_changes'] = "Save changes";
$lang['sub_categories_permission'] = "Apply To All Subcategories";
« Last Edit: June 26, 2008, 06:20:11 PM by ivan »
greetings / grüsse
ivan

Facebook Fan Page | Follow Twitter

Blog: Reisen Blog
Bilder Gallery: Bilder Gallery

Offline ivan

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.279
    • View Profile
    • Bilder Gallery
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #46 on: February 05, 2008, 08:36:18 PM »
@ XxJakeBluesxX
bitte lösche deinen letzten post!

habe dir dies auf 1.7.4-1.7.6 angepasst

p.s above heisst oben below unten  :wink:
greetings / grüsse
ivan

Facebook Fan Page | Follow Twitter

Blog: Reisen Blog
Bilder Gallery: Bilder Gallery

Offline silentg

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • WallpaperJoint
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #47 on: June 26, 2008, 04:26:06 PM »
Add this to your language file: admin.php

Find:
Quote
$lang['save_changes'] = "Save changes";

Insert it below:
Quote
$lang['sub_categories_permission'] = "Apply To All Subcategories";

Offline ivan

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.279
    • View Profile
    • Bilder Gallery
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #48 on: June 26, 2008, 04:50:30 PM »
hi,
thanks for bug report ;)
code update...
greetings / grüsse
ivan

Facebook Fan Page | Follow Twitter

Blog: Reisen Blog
Bilder Gallery: Bilder Gallery

Offline silentg

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • WallpaperJoint
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #49 on: June 26, 2008, 05:57:37 PM »
You forgot to mention where to edit for the language code. Please fix that also.

Offline Hagen-Roderich

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • Hof Jokers
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #50 on: July 30, 2009, 12:47:30 PM »
@Ivan:
Vielleicht könntest Du noch bei Punkt 1 vermerken das man die zweite Stelle der gefundenen Zeilen (ca. 610 -612 Zeile) in der "categories.php" darunter ergänzen muss. Steht zwar schon mal weiter vorn im Thread, aber so wäre die Installation leichter.

Thanks for your work V@no and Ivan.

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #51 on: January 06, 2010, 06:46:44 PM »
Great MOD!

Just one more thing I would like to do. How I go to edit some categorie, the button "NO" related to "Aplly to all subcategories" is selectect by default. How can I turn into default the button "YES" to be selected?

Offline XxJakeBluesxX

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://www.digiclaudio.com
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #52 on: March 30, 2010, 10:14:57 AM »
Funktioniert das auch mit Version 1.7.7?
:) Ciao, Claudio :)

Offline Hagen-Roderich

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • Hof Jokers
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #53 on: March 30, 2010, 02:40:54 PM »
Funktioniert das auch mit Version 1.7.7?

Ich habs unter 1.7.6, entsprechend der Anleitung für 1.7.4 - 1.7.6 installiert. Danach einen manuellen Update auf 1.7.7 gemacht und der MOD läuft heut noch.
Daher gehe ich davon aus das er auch in einem "reinen" 1.7.7 läuft.
Du kannst den MOD ja vorher mit der Mobilserver Version 1.7.7 testen.

Offline XxJakeBluesxX

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://www.digiclaudio.com
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #54 on: March 30, 2010, 06:20:14 PM »
Habe die beiden Dateien geändert. Hat prima funktioniert...  :D

Nun ist endlich Schluss mit dem schei** Spam... :mrgreen:
:) Ciao, Claudio :)

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Original Code from: V@no and Ivan

Changelog / Änderungen:
  • Beim Kategorie erstellen ist die Funktion auch vorhanden / Support the function by add categorie
  • Mehrsprachig / Multilingual

Dieser MOD kann die Rechte einer Kategorie mit allen Unterkategorien aktualisieren.

Läuft mit 4images 1.7.7
Work with 4images 1.7.7


Step 1
Open / Öffne: admin/categories.php

Find / Finde:
  $auth_sendpostcard $HTTP_POST_VARS['auth_sendpostcard'];
  
$auth_readcomment $HTTP_POST_VARS['auth_readcomment'];
  
$auth_postcomment $HTTP_POST_VARS['auth_postcomment'];


Insert / Füge below / darunter:
// MOD SUBCAT PERM FROM PARENT START
  
$subcats = (isset($HTTP_POST_VARS['subcats']) && $HTTP_POST_VARS['subcats']) ? 0;
// MOD SUBCAT PERM FROM PARENT END



Step 1.1
Find / Finde:
  show_table_separator($permission_headline2);
  foreach (
$access_field_array as $key => $val) {
    
show_access_select($lang[$key], $key$val);
  }

Insert / Füge below / danach:
  // MOD SUBCAT PERM FROM PARENT START
  
show_radio_row($lang['sub_categories_permission'], "subcats"$subcats);
// MOD SUBCAT PERM FROM PARENT END;


Step 1.2
Find / Finde:
    $msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];

Insert / Füge above / davor:
// MOD SUBCAT PERM FROM PARENT START
    
if ($subcats)
    {
      
$subcat_ids = array();
      
$subcat_ids get_subcategories_id($cat_id);
      if (!empty(
$subcat_ids))
      {
        
$sql "UPDATE ".CATEGORIES_TABLE."
                SET auth_viewcat = 
$auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
                WHERE cat_id IN ("
.implode($subcat_ids",").")";
        
$result $site_db->query($sql);
      }
    }
// MOD SUBCAT PERM FROM PARENT END



Step 1.3
Find / Finde:
  show_form_footer($lang['save_changes'], $lang['reset'], 2$lang['back']);

Insert / Füge above / darüber:
Code: [Select]
// MOD SUBCAT PERM FROM PARENT START
  show_radio_row($lang['sub_categories_permission'], "subcats", $subcats);
// MOD SUBCAT PERM FROM PARENT END

Step 1.4
Open / Öffne lang/admin.php
Find / Finde:
* English
$lang['save_changes'] = "Save changes";
* Deutsch
$lang['save_changes'] = "Änderungen speichern";

Replace / Ersetze mit:
* English
$lang['save_changes'] = "Save changes";
$lang['sub_categories_permission'] = "Apply To All Subcategories";

* Deutsch
$lang['save_changes'] = "Änderungen speichern";
$lang['sub_categories_permission'] = "Für alle Unterkategorien übernehmen";
Beste Grüße
Benny

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Apply permission to sub-categories from their parent category
« Reply #56 on: September 11, 2010, 01:45:04 AM »
Has this mod been tested?

I installed it checked my add categories inside my admin control panel and there was duplicates. Gave me errors.

Thanks any way man