Forums

Bind User to Category incompatible with WP 2.3 (22 posts)

  1. jessibird
    Member
    Posted 2 years ago #

    The Bind User to Category plugin is incompatible with WordPress 2.3. It requires the wp_categories table, which no longer exists in WordPress 2.3.

  2. Cla-ude
    Member
    Posted 1 year ago #

    Hi, I'm using this plugin too and I've noticed the same error.
    I've just pointed the code to the new tables in the database and it seems to work.
    If you want to try, here is a link to the php file you must replace in the plugin folder.

    Hope it will help :-)

  3. YuBe
    Member
    Posted 1 year ago #

    For 2.3 patch to show categories but not tags

    $cats = $wpdb->get_results("SELECT * FROM $wpdb->terms JOIN $wpdb->term_taxonomy USING (term_id) WHERE taxonomy='category' ORDER BY name");
  4. flowlocke
    Member
    Posted 1 year ago #

    hi!
    thanks for the update php-file. i wonder if its possible to have the categories hidden the user cant post in.
    so that the users aren't confused by all the different categories...?

  5. jaldrich
    Member
    Posted 1 year ago #

    flowlocke,

    the name of the page that you post on changed so you need to change the page address in the php file for the plug in.

    function butc_adminHead($in) {
    	global $user_level;
    	get_currentuserinfo();
    	$cat = butc_getCategory();
    	if ($cat && $user_level < 10) {
    		if(preg_match('#/wp-admin/post-new\.php#',
    		   $_SERVER['REQUEST_URI'])) {
    			ob_start(butc_removeCategorySelection);
    		}
    	}
    	return $in;
    }
  6. charliestout
    Member
    Posted 1 year ago #

    I'm having a little bit of trouble understanding the discussion here. Are the above snippets of code supposed to re-establish this plugin in WP 2.3? Thanks!

  7. flowlocke
    Member
    Posted 1 year ago #

    jaldrich: thanks a lot! thats great. works now

    charliestout: yes, actually if you modify these few lines the plugin works in wp 2.3.

    i got one more thing i dont know how to accomplish: can i somehow bind a user to multiple categories? didnt work out for me yet.

  8. Ziyphr
    Member
    Posted 1 year ago #

    This plugin is now up to date with the fixes and I can confirm it works.

    Regarding multiple categories, you'd have to write your own function to hide part of the category list rather than all of it. This really needs to be in the WP core.

  9. jaldrich
    Member
    Posted 1 year ago #

    Make this plugin compatible with 2.5 ....

    Replace

    function butc_removeCategorySelection($page) {
    	return preg_replace('#<fieldset id="categorydiv".*?</fieldset>#sim', '', $page);
    }

    WITH

    function butc_removeCategorySelection($page) {
    
    	return preg_replace('#<div id="categorydiv".*?<h2>Advanced Options</h2>
    #sim', '<h2>Advanced Options</h2>
    ', $page);
    }

    This should allow for the categories box to disappear while being logged in as a user that is bound.

  10. vodkacoca
    Member
    Posted 1 year ago #

    Hello all,

    I updated the php file with the one Cla-ude changed.
    I therefore made the two updates that jaldrich posted to have the plugin compatible with 2.5 but it seems it's still not working.
    May someone put the updated plugin somewhere so we may download it?

    Thanks a lot for your help with the upgrade of the plugin.

  11. summerrainrecordings
    Member
    Posted 1 year ago #

    Hi,

    I installed, and all works fine in 2.5, except when hiding the category box following jaldrich's instruction, it hides the category box, but also hides the format tools on top of the text editor box. any ideas how to reshow the format tools etc whilst still hiding the categories?

  12. vodkacoca
    Member
    Posted 1 year ago #

    I can't figure out why it's not working when i've done all the changes.
    summerrainrecordings, mya you zip the bind-user-to-cat.php file and post it somewhere so i may download it.
    I'll then have a look at the probleme with the format tools.
    Anyone with an idea why this format tools disapear?

    thanks

  13. summerrainrecordings
    Member
    Posted 1 year ago #

    Here you go:

    http://download.yousendit.com/1A20C65C7E5131E2

    Hve you created a user, assigned them to a cat, and then logged in and tested it under their name?

  14. vodkacoca
    Member
    Posted 1 year ago #

    Thanks a lot summerrainrecordings.
    That's working now.

    I have no problems with the format tools on top of the text editor box.
    It appear as before.
    Are you sure you don't have an other plugin that interact with this one and could explain why you don't have the format tools?

  15. summerrainrecordings
    Member
    Posted 1 year ago #

    Hmm, that's interesting. What browser are you using? I tried deactivating all other plugins and still a problem.

    If I remove the edit suggested by jaldrich, then the text format tools appear, but then the categories aren't hidden.

    I'm using OSX with Safari and Firefox 3.

  16. vodkacoca
    Member
    Posted 1 year ago #

    I'm using FF2 on windows XP but it's also working on Explorer 7.
    May be do I mis-understand what disappeared on your panel.

    I put a screenshot of the pannel i got for a binded user (author status) here:
    http://www.vodkacoca.com/summerrainrecordings/

  17. cameron_penn
    Member
    Posted 1 year ago #

    This is just straight up not working for me. I'm running WP 2.5. Even with the replacement code, the editor has the category selection visible (for a bound user) and doesn't have their bound category checked.

  18. ile
    Member
    Posted 1 year ago #

    I created test user and assinged him category "test".
    When logged in as test, i can see all categories and none os checked. After posting, posts are being publish in default category and test category. Is this how is plugin suppose to work?
    I need user "test" not to see other categories except test.

  19. epr1977
    Member
    Posted 1 year ago #

    This is a great plug-in. I'm using it with 2.5 without any problems. I've tried the work around, to remove the categories for the 'binded' users. But also removes the 'editor toolbar' NOTE: I'm using DEAN's FCK editor

    http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/

    It would be great if it would be possible to add multiple categories to one user.

  20. ile
    Member
    Posted 1 year ago #

    Category Access works with WP 2.5.1
    http://www.coppit.org/code/
    There are few problems...
    When uesr logs in, he sees only categories that he has access to, but if he doesn't chech any of them then his post is published in default category. So i combine it with plugin Bind User To A Cat to set default category for that user.
    Another problem is that when logged user access homepage, he can see only posts from his category. After loging in (FROM ADMIN PANEL) he can see all posts
    Any solution?

  21. byzantine78
    Member
    Posted 1 year ago #

    I would also like to make the categories div not show for a user that is binded to a category and followed jaldrich's instructions.

    I viewed the source HTML on the wp-admin/post-new.php page (where the categories div should be hidden) for wordpress 2.6.1:

    <div id="categorydiv" class="postbox ">
    <h3>Categories</h3>
    ...[more HTML code here]...
    <h2>Advanced Options</h2>

    and not sure if the code supplied by jaldrich will work, in particular the preg_replace function:

    return preg_replace('#<div id="categorydiv".*?<h2>Advanced Options</h2>
    #sim', '<h2>Advanced Options</h2>

    Any advice appreciated as I'm not too good with regular expressions!

  22. byzantine78
    Member
    Posted 1 year ago #

    Oops, take that back - seems to be working now!

    Can confirm:
    return preg_replace('#<div id="categorydiv".*?<h2>Advanced Options</h2>#sim', '<h2>Advanced Options</h2>', $page);

    works for wordpress 2.6.1

Topic Closed

This topic has been closed to new replies.

About this Topic