Level2Categories
Meu primeiro plugin. Permite que você relacione Níveis de Usuários a Categorias, fazendo com que somente usuários com um nível mínimo possam publicar posts em determinada categoria. É útil para quem quer reservar uma categoria onde somente Editores ou Administradores (ou qualquer um que você escolher) poderem publicar.
My first plugin. Allows you to create a relationship between User Levels and Categories, so only users with a defined level will be able to post on a chosen category. Its useful if you want to reserve a category only for Editors or Administrators (or whoever you choose) to be able to post on.
Download
Level2Categories for wordpress up to 2.2 (before native taxonomy)
Level2Categories 2 for wordpress 2.3 and newer (after native taxonomy)
Instalação / Installing
. Faça o download do arquivo
. Descompacte ó conteúdo do pacote no diretório “plugins” do seu wordpress
. Acesse o Painel de Administração > Plugins e ative o plugin
. (testado em wordpress 2.1, mas deve funcionar em outras versões, por favor me avisem)
. Download the package
. Extract it to the “plugins” folder of your wordpress
. In the Admin Panes go to “Plugins” and activate it
. (tested with wordpress 2.1, but should work with other versions, please let me know)
Modo de usar / Usage
. Go to Manage > Level2Categories
. Select the Category and choose the minimum level a user must have to post on this category
Se você não sabe como usar os Níveis de Usuário (User Levels), dê uma olhada nessas páginas. A partir do wordpress 2.0, você pode usar este plugin para administrar facilmente esses níveis.
. Acesse Manage > Level2Categories
. Selecione a Categoria e o Nível Mínimo que um usuário deve ter para postar naquela categoria
If you dont know how to use User Leves, check these pages out. From wordpress 2.0 on, you can use this plugin to easily manage User Levels.
ScreenShot







hello
the feature is really nice and super effective - it seems that my php (5) is sricter than yours and i had to replace two or three
re
hello
the feature is really nice and super effective - it seems that my php (5) is sricter than yours and i had to replace two or three \
hello,
i have one problem with your plugin. it does not works under wordpress 2.3.1 (german version). so, please, solve the problem. i think, your plugin is that what i have looking for. give me an answer, please. i hope you understand me, i am not a native speaker.
best regards,
henry kraemer
Hi Henry
The way wordpress deals with categories was completly changed for 2.3 due to native taxonomy support. I decided to release antoher version of this plugin, wich is now available for download on this page.
Let me know if it works
cheers
Leo,,
Hi Leo,
at first, thanks for the new version.
But the problem is now, User with Level Author can’t wright articles in the predetermined cathegorie. Instead of the Option “Write”, the User see the Option “Plugin”. I have not activate in the Roles this Option for the User. The settings for the User are: read, publish posts and edit published posts in level 1. But it shows the Option “Plugin”. I think, it can’t be right !? Please, help me to find the error. I have a Testaccount configured: member “test” and the password is “test2007″.
cheers
Henry
Hi Leo,
the first error was a plugin calls wp-ticker. This plugin diverted the Mainmenu. After the uninstall the new User only can see the Daschboard and his own Profile. But the same Problem is, where is the menu “write”? could it be, the plugin “Role-Manager” troubles the configurations? So, i hope not, because it is is a really good Plugin and it works very well.
Henry
Hi henry,
Level2Categories plugin acts only in the Write page, hiding the categories that the user can not post in.
The issue of the user beeing able to Write a post or not is not related to this plugin for sure. You should re-check your settings and maybe find some help for the role-manager plugin.
cheers
Leo,,
Hi Leo,
i have solved the Problem now. I have delete my webspace and also my database. Now it works perfect and i must thank you for your help. Your plug-in runs very well.
Henry
I have a weird problem - the plugin does work, but only the default category shows in the dropdown box. So I can only set that one up.
Running WP 2.3.1 and Level2Categories 2.
Hi Red,
I can not reproduce this problem here… Works fine for me.
It should list only the categories listed under Manage > Categories… and not all the Tags you can put in posts….
please let me know if you find out something
Leo,,
Ok, I must be really dumb but what does this mean exactly?
. Select the Category and choose the minimum level a user must have to post on this category
You have levels 1 - 10
I have levels admin, editor, author, contributor, subscriber
All I want to do is restrict posting of articles to one category… incidentally, only half of my categories appear under “Level2Categories 2″ and the one I want to restrict isn’t listed. But I would not be able to anyway because numbers 1 - 10 do not relate in any way to my user levels.
Please help, I am really confused.
Dan,
quoting the text on this page:
If you dont know how to use User Leves, check these pages out. From wordpress 2.0 on, you can use this plugin to easily manage User Levels.
Leo,,
Thank you! I have been looking for a plugin to do this for a VERY long time! Thank you so much for releasing a version that works with 2.3+
One question: Do you have any plans to EITHER update the interface OR provide a way to set a default minimum level? My blog has 50+ categories and counting. I want the majority of my users to only be able to post into 3 of them with only the admins and editors to post into the other 47+. It will be time consuming to set the high minimum level for every new category with the current interface.
I would very much appreciate an option to set a default minimum for all unspecified/new categories. Can you do that?
Oh, I’ve just realised that it includes tags. Is it possible to exclude tags?
Hi, me again.
I had a look through the plugin code for version 2.0 and found out that it wasn’t supposed to be returning post tags. I think that on line 98 you’re joining the tables with term_taxonomy_id to term_id when it should be term_id to term_id. This was incorrectly looking up the wrong taxonomy for some of my tags.
Can you please confirm and let me know if changing the line 98 query will break anything else?
Hi Debbie,
Where did you download it from? It should not include tags. Im replacing the zip file here, but I beleive the download from the wordpress site is right.
Anyways you can delete the last part of the query safely. Here is what you should remove:
or wp_term_taxonomy.taxonomy = ‘post_tag’
About the interface, I dont have such plans for now… But you never know what a boring saturday morning can do….
cheers
Leo,,
Hi Leo,
I downloaded it from WordPress. There was no WHERE clause for post_tag.
Can you please email me on the address given in this comment? I think I’ve found a problem in the way you link the tables and I’d rather explain it in detail through an email. It’s probably easily fixed but my php/MySQL experience is limited so it will take me ages to get the correct syntax.
- Debbie
I am attempting to use Level2Categories 2 on WP 2.3.3 and get garbled code output on the admin’s Manage screen.
This is a porton of the code being shown on the screen:
“; } $querystring=”SELECT “.$l2c_table.”.cat_ID, “.$l2c_table.”.level, “.$l2c_category_table_name.”.name as cat_name FROM “.$l2c_table.” INNER JOIN “.$l2c_category_table_name.” ON “.$l2c_table.”.cat_ID = “.$l2c_category_table_name.”.term_id”; $query=mysql_query($querystring); $cat_total=mysql_num_rows($query); if ($cat_total > 0) { echo “
Thanks to Debbie there is a new version of Level2Categories 2 available.
This version fixes an ugly bug that was actually making a wrong relationship between tables causing a lot of trouble… Everybody should upgrade (just replace the php file) and then re-check the relationships you have setted.
Leo,,
Regarding my earlier post re the actual php code appearing on the screen.
I replaced all the
Yes, thank you very much Leo
Been looking for a plugin to do this for a long, long time.
just 1 question !
I can assign a category to a user Level .
Now I have like 20 cats and I want to assign users to cats(to post/edit) but each user should only have access to his own cat .
is this possible with this plugin ? or do you know a way to do this ?
Hi Mehdi,
no, thats not possible with this plugin
Leo,,
I’m hoping my question has already bee resolved. It’s the same issue Bill from above was having. The portion of the php code is showing up on the page. Is there any way to resolve this?
Thanks
-Nick
Hi nicks,
I cant reproduce this error.. For me it just works fine with worpdress 2.3.x … What version are you using?
Leo,,
I’m using 2.5.1
Here’s a screen shot of what I’m getting.
http://img127.imageshack.us/img127/8647/errordd7.jpg
-Nick
nicks I had the same problem, and to solve it I edited the plugin:
look for “<?” and just add after it “php” so that it becomes “<?php”. I think there were 2 or 3 that I had to change.
hi Thomas,
Thanks for the help, I was suspecting to be something like this since some servers complain about these kind of thing and others dont.
Im fixing it right now and publishing a new version,
cheers
Leo,,
Freakin sweet Thomas!
Thanks for the tip!
Thanks to the author of the plugin!
ok, version 2.2 released. Can someone who was having the problem test it please?
cheers
Leo,,
Hi there,
I have the WP 2.5.1 fresh install and today installed your plugin. Everything went fine til swithing into administrator again. For instance, I sected let’s name it Category-1 to level 10 minimum (which is me). Now when switching to a author level, that category does not appear anymore in my posts category selection, and I suppose it’s ok til here. But if i switch back to administrator (level 10), neither I can see anymore that category when i try to move that post to that category back!
Did I miss anything?
Thanks.
Well, after posting this I went back to my site…when posting or editing a post, you have the list of categories, and on it’s left, 2 links: View all and Most used.
Now, on view all, i couldn’t see the category i had given th 10 level, when logging as author, but i COULD see it and post/edit a post on it, because I COULD see and select it on the Most used link! Is that working at all?
Hi Ronnie,
Most Used categories is a new feature since WP 2.5 and this plugin simply forgot to look at it. Its now fixed and the category wont show there anymore.
About you not be able to see the category as admin, I cant reproduce this error, I tested and everything is fine… maybe if you send more details..
cheers
Leo,,
Do I have to download it again from above?
I supposed yes, and now even as admin I cannot see the category…How is that? Am I as admin supposed to see ALL categories as a level 10 user ?
I have these plugins installed, if that might help you out:
Akismet 2.1.5
AskApache Password Protect 4.2.2
Breadcrumb Navigation XT 1.8.0
Category Icons 2.0.5
Category Icons Widget 2.0.5
cforms 8.5
Comment Inbox 0.1
com_resize 0.1
Dashboard Editor 1.1
DCoda Widgets 3.3.0
Flickr Manager 2.0.2
flickrRSS 4.0
Force User Field Registration 0.6
Fotobook 3.0.7
Get Recent Comments 2.0.2
Google XML Sitemaps 3.1.0.1
Level2Categories 2 2.2.1
Lighter Menus 2.7
Limit Posts 1.1
Mail From 1.0
Optimize DB 1.2
pageMash 1.1.2
Polaroid on the Fly 0.6
Post-Plugin Library 2.5.0.6
Presentation Toolkit 0.0.9
Psychic Search 2.0
Recent Comments 2.5.0.1
Role Manager 2.2.2
Secure and Accessible PHP Contact Form v.2.0WP B20070213
Smart Youtube 1.6
Video widget 1.1.3
Widget Logic 0.43
wordTube 1.60
WP Super Cache 0.6.4
WP_Censor 1.0.0
I cannot find the way on how to make it show me the categories at level 10 to the admin…
Ronnie,
Im sorry but I dont know what this can be. As I told you it works fine here…
If I were you I would just set the minimum level of these categories to 9 instead of 10… nobody but the administrator has a level higher than 8…
cheers
Leo,,
Sorry…it doesn’t work out for me! Wanna contact in private?
I tried even with 1 level, but still as administrator cannot see that category…You should test it on 2.5.1 WP version…
If i want it to work, I have to delete that category level before posting, and than activate it again…but this’s odd
Hello, I am having the same problem. No matter what level I set a category at (1 or 10) the administrator can’t see it when I try to write to that category (I don’t have other users setup at this point. Also, Is there a reason the categories are assigned levels one to ten now when Wordpress now seems to use, Editor, Author, etc? Just curious if the plugin will be updated to use this layout or stick with 1 to 10 for premissions. Using Godaddy for the wordpress site. Thanks
Excellent plugin. Worked great for me right of the bat. Exactly what I’ve been looking for.
Thanks!
Hello,
thanks for this great plug-in but I have two suggestions :
- the ability to specify mini and maxi level
- and/or the ability (or another plug-in) to assign to a user and not only a level.
Thanks again.
Hi,
I managed to fix it. It simply needs to re-asign the role to the administrator itself. For some strange reason, after installing Role plugin, it you need to re-asign administrator to administrator user again, otherwise it will not work…and everything goes ok now.
Hiya, running your mod under WP 2.5 and for the most part it works great. The only problems I seem have are:
1. When the user with restricted categories attempts to write they only see the categories they have rights to correctly. However they can freely add their own categories still (which I’m sure is out of the scope of this mod). However if they want to add a child category they get the full list of categories in the drop-list instead of the restricted-to list.
2. My list of categories I have the user restricted to does NOT include the default category. However if the user leaves all the categories unchecked and the post gets published then the post ends up in the default category. While that it is the standard default behaviour of Wordpress, wouldn’t it make more sense to force it into the first visible category the user has access to?
Thanks,
TM
Hi Terrormaster,
You are right about point 1. I have to look at this
about point 2, if a category is restricted to some users, it should not be default… at least if I was the admin. hehe. but you have a point there.
The thing is this plugin only hides the checkbox of the category. I does not check anything when you save the post (if you use firebug with firefox and manage to display the hidden checkbox you will be able to post on that category)
So point 2 will need major changes. But would definetly make the plugin better.
Im not having much time to work on this lately, but will have a look as soon as I can. Meanwhile its open for anyone who is willing to improve it. No authorization required… mess the code as you like
cheers
Leo,,
[…] Notes et référencesLes traces des précédents blogs ont toutes disparues, à la fois suite à des pogroms volontaires, ou à des erreurs de manipulation.Avec une bonne quarantaine de billets depuis le début de l’annéeIl se chuchote même que j’aurais défendu Ségolène Royal, mais ce sont des mauvaises languesGrâce à un bon pâté de plugins Wordpress, pour le transformer en véritable solution CMS : Advanced Category Excluder, WP Sentry, Level2Categories. […]
Well I downloaded the most recent version of this plugin for 2.3 and newer and it doesn’t work. I use 2.6. I have several categories but only want to allow posting into one category. So I set all of the category levels in this plugin to 10 instead of the one I want users to post in which I set to 1. I set it to 1 because that is the user level assigned to all users (contributor). But when logged in as a contributor none of the categories are listed. I tried a few things to see if I could figure it out and the categories just aren’t showing up for the different user levels using this plugin. I also still get the “most used” link as well.
I am with “justice” on this one - on wp 2.6 this plugin does not work properly.
If you limit any user group to a certain category, it actually does the opposite and it doesn’t list that category on that user’s post forms…
And yes, that Most Used Categories is still visible.
Might have some fixing up to do, son…
specifically, the error is at the end of the file where the user_level check occurs.
right now, in 2.6.2 version, $user_level you get out of that plugin is 0 for all users.
hi Jason,
Thanks for pointing these issues. I didnt test this plugin with WP 2.6 yet, thats why it is market as “compatible up to 2.5″.
unfortunately I cant work on this right now. If you have the ability to fix it please do so, you will be helping a lot of people!
thanks son,
cheers
Leo,,