Search Results for 'bbpress'
-
Search Results
-
It’s not the first time and it won’t be the last. I’m confused.
I’m trying to add forum moderator capabilities to the currently logged in user in a specific forum only. I don’t want to give them the moderator role. I just need to give them additional caps in a specific forum. When the user is tooling ’round in the forum I want to give mod rights to, assign them dynamicly. When they are no longer in that forum, take ’em away on the fly.
If found a couple of things to guide me. One was forum-moderators.php by Aditya Naik. This give specific users a forum moderator role thru the bbpress backend. That stores the rights to those caps as a meta value and assigns them when the user is on the forums. Great. There’s a fn in there that determines what forum the user is in and responds to a filter called ‘bb_user_has_cap’. I can’t find neither hide nor hair of using this filter anywhere except in a couple of plugins by sambauers. http-authentication and ldap-authentication.
So, I found the filter ‘bb_current_user_can’. It looks to me like everyone on the planet is using this filter. The comment in the fn bb_currrent_user_can() says use ‘bb_user_has_cap’. Well, nothing is using that as far as I can determine.
Anyway, my confusion comes in when I try to implement my filter. I’m gonna give the user the following caps:
$forum_mod_caps = array(
'manage_topics' ,
'edit_closed' ,
'edit_deleted' ,
'browse_deleted' ,
'edit_others_tags' ,
'edit_others_topics' ,
'manage_posts' ,
'ignore_edit_lock' ,
'edit_others_posts'
);For me, reading the code for bb_current_user_can() is like the time I got curious about implementing tcp/ip for the Atari ST. I got a headache. My skill level is not up to understanding what is going on down there. Some guidance would be appreciated.
We have 3 args to this filter:
$retvalue, $capability, $args
Looks like $retvalue is being passed up the filter chain. If I don’t want to touch the call I just pass $retvalue back.
I was digging ’round and looks like $capabilities is the cap being queried. $args is specific to each call and may vary depending on what cap is queried.
These are questions in case you haven’t noticed. My understanding breaks down when I get to what I’m being passed and what I’m supposed to do with them other than return ‘true’ if it’s a cap I want to let the user have.
I should just return true if it’s a cap I want the user to have. It’s up to me to determine if it’s appropriate at their location in the universe. Yes?
All integration guides appear to have the userbase in WP. I was in the situation where my userbase was in bbPress, so I needed to get all my bb_users into wp_users.
The following refers to WP2.7 and bbPress 1.06a.
The process is actually quite straight forward but do make backups of your database beforehand!
- First delete ‘wp_usermeta’ and ‘wp_users’ tables (having made that backup!)
- Change the name of ‘bb_usermeta’ to ‘wp_usermeta’ and ‘bb_users’ to ‘wp_users’.
- The tables structures from bbP are the same as WP apart from one field in the ‘_users’ table. So we need to add FIELD: user_activation_key TYPE: varchar(60) NULL: NO after the ‘user_registered’ field.
- The problem now is that none of these users have their WP roles defined.
- To do this we need to insert the ‘meta_key’ and ‘meta_value’ to ‘wp_capabilities’ and ‘a:1:{s:10:”subscriber”;b:1;}’ for each user.
- wordpress_capabilites.sql contains an SQL insert statement for 5000 users. If your userbase is less than that you only need to run it for your number of users (although we deal with overruns in a minute).
- Once this has run each user will have ‘subscriber’ status within wordpress. You need to manually change your bbPress key holder (most likely user_id 1) ‘wp_capabilities’ to ‘a:1:{s:13:”administrator”;b:1;}’. This gives that account administrator status within WP.
- It’s highly likely that you’ll have deleted some users in the past, or run too many INSERTs from the wordpress_cabalilities file, so we need to delete all those ‘wp_capabilities’ that aren’t mapped to an exisiting user.
- SQL: ‘select * from wp_usermeta where user_id not in (select ID from wp_users)’ will list all these non-existent users.
- It probably a good idea to do a full backup of your tables right now just in case.
- Now run this SQL: ”delete from wp_usermeta where user_id not in (select ID from wp_users)” – this will delete all those stray entries.
- Done.
All worked out with the help of someone I work with, so I can’t take all the credit
Good luck.
Topic: WordPress Functions
Functions (optional)
…In order to do it, you need to put require_once(‘path/to/wp-blog-header.php’); in bbPress’ bb-config.php (wp-blog-header is in the same directory as WordPress’ wp-config.php file).
Doing this will add quite a lot of weight to your bbPress installation as it will cause WordPress to load in it’s entirety. Your best option is to try to emulate the functionality you require inside a bbPress plugin.
Adding wp-blog-header.php to my bb-config causes lots of functionality issues.
Therefore has anyone made any of these plugins? I’m mostly looking to get wp_list_pages working.
Lets say in theory I was going to try and integrate bbPress’s functions into WordPress.
Theoretically, where would I look if I didn’t want bbPress to clear out the wp_head function?
Hello, I seem to have lost ability to login to bbpress. The only changes i did this afternoon where to add bbsync to wp and it seems possible i lost access after the first post went through. I had set bbsync to a forum that had a space in the name and that was not working so changed it to another and that worked but now when i go to the forums i am logged out and when i try and login it just takes me back to the main page, no error message. not quite sure what to do.
Thanks in advance for any help.
Hi all,
we have launch the new version of ours blog with added integration with bbpress (alpha 1-6). We would appeal to us to have some opionions about this and others opionions to improve bbpress and even to make it better
thanks!
Hi!
I installed wp 2.7 and bbpress 1.0 (alpha 6) and all seem to work.
I have only a little problem: when a user changes his website in his profile editor, bbPress doesn’t show the website link but the profile link!
Anyone can help me?
Thank you,
Giovanni
Italy
I tried to link the comment author’s name on my wordpress to the wordpress profile page (or “author” page), yet I have not yet found a solution for this. I posted my issue in the wordpress forum as well: http://wordpress.org/support/topic/235251?replies=1
A wonderful alternative would be to just link a commenter’s name to the bbpress profile page instead.
I have no knowledge of php, yet even I can imagine that fetching data from one platform to another can be quite complicated.
Any thoughts?