Patch for Level2Categories Wordpress Plug-in
Here is a dumb patch for Overlap.org to add post_tags to the list of categories which allows you to control what level of user can use certain tags:
--- level2categories.php 2007-12-12 00:16:22.000000000 -0800
+++ level2categories.php.new 2007-12-13 00:59:14.000000000 -0800
@@ -95,7 +95,7 @@
< ?
$l2c_category_table=$table_prefix."term_taxonomy";
$l2c_category_table_name=$table_prefix."terms";
- $query=mysql_query("SELECT $l2c_category_table.term_taxonomy_id, $l2c_category_table_name.name FROM $l2c_category_table INNER JOIN $l2c_category_table_name ON term_taxonomy_id = $l2c_category_table_name.term_id WHERE $l2c_category_table.taxonomy = 'category' ");
+ $query=mysql_query("SELECT $l2c_category_table.term_taxonomy_id, $l2c_category_table_name.name FROM $l2c_category_table INNER JOIN $l2c_category_table_name ON term_taxonomy_id = $l2c_category_table_name.term_id WHERE $l2c_category_table.taxonomy = 'category' or wp_term_taxonomy.taxonomy = 'post_tag' ");
$cat_total=mysql_num_rows($query);
if ($cat_total > 0) {
the text file with the patch is here: Patch to add post_tags



a interesting lib for Inscape
http://libshiva.sourceforge.net/index.html
=:-))
Comment by ciriaco — December 14, 2007 @ 7:33 am
Hi Jon,
Nice you are using the plugin and made this patch.
But I am afraid it is not going to work. It will show the tags on the selected box, but it will not prevent any user from using this tag.
This is because all the plugin does is to hide a category from that box “Categories” on the right side of your edit page. Since post tags wont appear there, it will have no effect.
So… If you want to have support for post tags this would take a bit more of work, I can help you out if you want.
It would be nice as well to leave this as an option wether you want to use post tags or not, because I beleive the select box will get very big if it lists all the post tags.. and this will be annoying for those who only want to control categories…
cheers!
Leo,,
Comment by Leo Germani — December 14, 2007 @ 7:56 am
Leo, actually I tested my patch and it fully works in the interface and throughout wordpress. It hid the category, but also won’t allow its creation by a user with a role < the value allowed for a category.
Please advise if I’ve not been clear.
If that works as advised, will you accept?
It would be great for you to put this into the new wordpress dev repository / SVN…you know about that, right?
Comment by jon — December 14, 2007 @ 1:49 pm
Really?
What you call post tags? I was thinking it was that text box bellow the text editor… where you can wirte as many comma separated tags as you like… isnt it? I dont see how my plugin can have any affect on that!
I think Im not understanding it right… sorry
Comment by Leo Germani — December 14, 2007 @ 2:13 pm
Right, I thought so too…well, it appears that those are another type of taxonomy, because in 2.3.1, the right-hand categories are of type ‘post_tag’
Apply my patch and test it out…amazing!
Comment by jon — December 15, 2007 @ 1:17 am