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

level2categories.gif

50 responses to “Level2Categories”

15 06 2007
i read more jug (03:26:00) :

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

15 06 2007
i read more jug (03:27:31) :

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 \

5 11 2007
henry kraemer (11:37:02) :

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

7 11 2007
leogermani (17:58:04) :

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,,

9 11 2007
henry kraemer (07:07:33) :

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

9 11 2007
henry kraemer (10:14:24) :

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

15 11 2007
leogermani (10:58:31) :

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,,

17 11 2007
henry kraemer (12:15:38) :

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

8 12 2007
Red (15:18:24) :

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.

10 12 2007
leogermani (11:55:49) :

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,,

22 02 2008
Dan Blackburn (02:16:42) :

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.

22 02 2008
leogermani (03:22:40) :

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,,

5 03 2008
Debbie (16:17:58) :

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?

5 03 2008
Debbie (16:35:42) :

Oh, I’ve just realised that it includes tags. Is it possible to exclude tags?

5 03 2008
Debbie (17:30:44) :

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?

6 03 2008
leogermani (09:55:58) :

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,,

6 03 2008
Debbie (11:41:02) :

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

10 03 2008
Bill (17:59:31) :

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 “

10 03 2008
leogermani (18:04:38) :

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,,

10 03 2008
Bill (22:01:06) :

Regarding my earlier post re the actual php code appearing on the screen.

I replaced all the

11 03 2008
Debbie (16:17:58) :

Yes, thank you very much Leo :) Been looking for a plugin to do this for a long, long time.

22 04 2008
Mehdi (04:26:54) :

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 ?

22 04 2008
leogermani (10:38:13) :

Hi Mehdi,

no, thats not possible with this plugin

Leo,,

14 05 2008
nicks (19:22:26) :

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

15 05 2008
leogermani (08:59:16) :

Hi nicks,

I cant reproduce this error.. For me it just works fine with worpdress 2.3.x … What version are you using?

Leo,,

15 05 2008
nicks (12:01:40) :

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

16 05 2008
Thomas (07:34:57) :

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.

16 05 2008
leogermani (11:40:49) :

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,,

16 05 2008
nicks (11:44:43) :

Freakin sweet Thomas!

Thanks for the tip!

Thanks to the author of the plugin!

16 05 2008
leogermani (11:46:52) :

ok, version 2.2 released. Can someone who was having the problem test it please?

cheers

Leo,,

29 05 2008
Ronnie (00:45:45) :

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.

29 05 2008
Ronnie (01:10:33) :

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?

29 05 2008
leogermani (10:05:39) :

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,,

29 05 2008
Ronnie (10:49:50) :

Do I have to download it again from above?

29 05 2008
Ronnie (11:00:37) :

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 ?

29 05 2008
Ronnie (11:12:22) :

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…

29 05 2008
leogermani (20:30:00) :

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,,

29 05 2008
Ronnie (22:41:04) :

Sorry…it doesn’t work out for me! Wanna contact in private?

30 05 2008
Ronnie (08:44:30) :

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

2 06 2008
Brandon (01:57:57) :

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

17 06 2008
Captain Tremens (19:36:20) :

Excellent plugin. Worked great for me right of the bat. Exactly what I’ve been looking for.

Thanks!

17 06 2008
charled (21:09:23) :

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.

23 06 2008
Ronnie (23:03:59) :

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.

30 06 2008
Terrormaster (17:23:20) :

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

30 06 2008
leogermani (20:15:48) :

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,,

12 08 2008
Ce blog est mort, vive le blogging ! | erablog (08:30:07) :

[…] 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. […]

25 08 2008
Justice (18:10:13) :

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.

8 10 2008
Jason (09:42:33) :

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…

8 10 2008
Jason (09:59:59) :

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.

8 10 2008
leogermani (15:09:33) :

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,,

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>