Not logged in. · Lost password · Registration disabled
Forum: Overview Suggestions and Wishes / Anregungen und Wünsche RSS
Feature Request / Show only limited number of cats
shazahm1 (Guest) #1
No profile available.
Link to this post
Subject: Feature Request
Thanks for adding the feature to show emty cats. Now I'd like to request to be able to hide/prevent users from subscribing to cats that I define in the settings.

Thanks, Steve --
mogway (Guest) #2
No profile available.
Link to this post
let me vote to this request ;)
Morty (Administrator) #3
User title: Author
Member since Jun 2007 · 928 posts
Group memberships: Administratoren, Mitglieder
Show profile · Link to this post
It's already possible with a bit of hacking. :-) At the moment development is stalled. Mainly because I don't need any more features and got some other interesting Projects running. But having a look at http://pn.xn--strbe-mva.de/forum.php?req=thread&id=4 might help. ;-)
mogway (Guest) #4
No profile available.
Link to this post
i made a short hack:

New option "Show categories childs of"


  • only display categories that are children of the category identified by its ID.
  • after saving and reload the settings page, you can see the effekt.
  • disable the "all" checkbox in the frontend (see problems) :(
  • To disable, leave it blank.

The patch is against the version 1.2.14

Problems:
If you enter an parrent category, this patch will disalbe the "all" checkbox in the frontend. I don`t figure out how to prevent sending mails when a user check this option. Maybe someone can help me here.

cu
mogway
The author has attached one file to this post:
post_notification.diff | Save   5.7 kBytes, downloaded 987 times
Lionel Chollet (Guest) #5
No profile available.
Link to this post
To prevent users from selecting categories that the site admin doesn't want them to subscribe to:

- In 'post-notification' folder, open file 'functions.php'

- Find line #294:
        $cats = get_categories(array('hide_empty' => false));

- Replace by:
        $cats = get_categories(array('exclude' => 'X,Y', 'hide_empty' => false));

- Then find line #296:
        $cats = get_categories();

- Replace by:
        $cats = get_categories(array('exclude' => 'X,Y'));

where 'X' and 'Y' represent the ID numbers of the categories you want to exclude, separated by a comma -- check your categories' ID# at http://your_domain/your_wordpress_folder/wp-admin/categori… --; sort your excluded categories' ID# in ascending order.
wimmera #6
Member since Feb 2009 · 2 posts
Group memberships: Mitglieder
Show profile · Link to this post
Subject: Remove the 'All' checkbox?
I've hacked 'functions.php' as mentioned by Lionel to 'include' only those categories that I want to make available for subscription.  I still have the 'all' checkbox showing on the subscription page, however.  How can I remove this checkbox?  Thanks for any pointers.
Morty (Administrator) #7
User title: Author
Member since Jun 2007 · 928 posts
Group memberships: Administratoren, Mitglieder
Show profile · Link to this post
The all is added in the actual funktion. I never thought of not providing the option "all".

Anyway: You must patch the functions.php:post_notification_get_catselect ans remove lines 320,321 and 322.
  1.     $cats_str .=  '<ul class="children"><li><input type="checkbox" name="pn_cats[]" value="0" id="cat.0" onclick="post_notification_cats_init()" ';
  2.     if ( in_array(0, $subcats)) $cats_str .= ' checked="checked"';
  3.     $cats_str .= '>' . $all_str .'</li>';
wimmera #8
Member since Feb 2009 · 2 posts
Group memberships: Mitglieder
Show profile · Link to this post
Thanks very much for this patch. 

You might consider incorporating this as an option.  I, for example, make extensive use of categories to structure a complex site.  I was able to easily edit the plugin to 'include' only those categories that are content-related, but the ALL checkbox gives users the abilitiy to subscribe to dozens of structural categories that I had excluded from the list.

In any case, thanks for your work on the plugin and the helpful forum!
Morty (Administrator) #9
User title: Author
Member since Jun 2007 · 928 posts
Group memberships: Administratoren, Mitglieder
Show profile · Link to this post
Hmm you're right there. Maybe in 2.0. :-)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum