<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress support forums Topic: bbpress + wpmu user registration default role</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: bbpress + wpmu user registration default role</description>
<language>en</language>
<pubDate>Mon, 06 Oct 2008 23:34:30 +0000</pubDate>

<item>
<title>joetwostep on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-14436</link>
<pubDate>Wed, 12 Mar 2008 21:55:44 +0000</pubDate>
<dc:creator>joetwostep</dc:creator>
<guid isPermaLink="false">14436@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;causes a fatal error and then lots of errors when i go to log out
&#60;/p&#62;</description>
</item>
<item>
<title>neyoung on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10205</link>
<pubDate>Thu, 16 Aug 2007 06:49:12 +0000</pubDate>
<dc:creator>neyoung</dc:creator>
<guid isPermaLink="false">10205@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Well, it turns out I shouldn't play with bbpress/wpmu when I'm tired at 2am.  I never ended up activating the plugin o.O .  Anyways, I got the code that Detective wrote to work once I pulled my head outta my butt!&#60;/p&#62;
&#60;p&#62;Here's for anyone else that has this problem...&#60;/p&#62;
&#60;p&#62;toss this into a file called default-role.php and put it in your my-plugins directory within your bbpress install folder.&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
/*&#60;br /&#62;
Plugin Name: bbpress wpmu default role&#60;br /&#62;
Plugin URI: &#60;a href=&#34;http://bbpress.org/forums/topic/yet-another-integration-bug-no-role-set-on-registration?replies=5&#34; rel=&#34;nofollow&#34;&#62;http://bbpress.org/forums/topic/yet-another-integration-bug-no-role-set-on-registration?replies=5&#60;/a&#62;&#60;br /&#62;
Description: Sets a default WPMU role for all new bbpress users.&#60;br /&#62;
Author: Detective&#60;br /&#62;
Author URI: &#60;a href=&#34;http://www.ryuuko.cl/&#34; rel=&#34;nofollow&#34;&#62;http://www.ryuuko.cl/&#60;/a&#62;&#60;br /&#62;
*/&#60;/p&#62;
&#60;p&#62;function wpbb_add_user_role_rk($user_id) {&#60;br /&#62;
$user = new WP_User($user_id);&#60;br /&#62;
$user-&#38;gt;set_role(get_option('default_role'));&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;add_action( 'bb_new_user', 'wpbb_add_user_role_rk');&#60;/p&#62;
&#60;p&#62;?&#38;gt;
&#60;/p&#62;</description>
</item>
<item>
<title>neyoung on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10189</link>
<pubDate>Wed, 15 Aug 2007 12:12:56 +0000</pubDate>
<dc:creator>neyoung</dc:creator>
<guid isPermaLink="false">10189@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I've got μ loaded through the config.php file.  I'll look into some of the μ functions and see what I can do.&#60;/p&#62;
&#60;p&#62;I don't think that trk_addDefaultRole function is being called from bb_new_user at all.  Is there a way I can test to see if it is?
&#60;/p&#62;</description>
</item>
<item>
<title>fel64 on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10187</link>
<pubDate>Wed, 15 Aug 2007 11:31:09 +0000</pubDate>
<dc:creator>fel64</dc:creator>
<guid isPermaLink="false">10187@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I don't know why nothing would happen, but I'd advise you to use the API instead of a db query. If  &#38;mu; isn't already loaded when you load bb, it might be good to load it when someone registers and use a &#38;mu; function to set their role instead.
&#60;/p&#62;</description>
</item>
<item>
<title>neyoung on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10186</link>
<pubDate>Wed, 15 Aug 2007 10:29:26 +0000</pubDate>
<dc:creator>neyoung</dc:creator>
<guid isPermaLink="false">10186@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sorry for the duplicate post, I think I was tired when I posted the other one and I'd sort of forgot about it.  &#60;/p&#62;
&#60;p&#62;Anyways, I've been playing with the two bits of code and I think I've 'almost' got it working.  If I execute Detectives query manually from the terminal it works, but for some reason when I put it all in a little plugin nothing happens.  Is there a type-o or a noob error somewhere?&#60;/p&#62;
&#60;p&#62;`&#38;lt;?php&#60;br /&#62;
/*&#60;br /&#62;
Plugin Name: bbpress wpmu default role&#60;br /&#62;
*/&#60;/p&#62;
&#60;p&#62;function trk_addDefaultRole($user_id) {&#60;br /&#62;
    global $bbdb;&#60;br /&#62;
    $bbdb-&#38;gt;query(&#34;INSERT INTO wp_usermeta ( user_id, meta_key, meta_value ) VALUES ( '$user_id', 'wp_1_capabilities', 'a:1:{s:10:&#34;subscriber&#34;;b:1;}' )&#34;);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;add_action('bb_new_user', 'trk_addDefaultRole');&#60;/p&#62;
&#60;p&#62;?&#38;gt;
&#60;/p&#62;</description>
</item>
<item>
<title>Trent on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10181</link>
<pubDate>Wed, 15 Aug 2007 00:13:51 +0000</pubDate>
<dc:creator>Trent</dc:creator>
<guid isPermaLink="false">10181@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I would imagine that since no one answered the &#60;a href=&#34;http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-role-problem?replies=1&#34;&#62;first time&#60;/a&#62;, you won't get much more on a duplicate type thread.....&#60;/p&#62;
&#60;p&#62;Trent
&#60;/p&#62;</description>
</item>
<item>
<title>neyoung on "bbpress + wpmu user registration default role"</title>
<link>http://bbpress.org/forums/topic/bbpress-wpmu-user-registration-default-role#post-10179</link>
<pubDate>Tue, 14 Aug 2007 22:13:12 +0000</pubDate>
<dc:creator>neyoung</dc:creator>
<guid isPermaLink="false">10179@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;As everyone knows, if a user registers in bbpress instead of through wordpress(mu) that user doesn't get a default role set.  &#60;/p&#62;
&#60;p&#62;I've dug and dug on both the bbpress and wpmu forums and haven't found a fix for this.  I did find a &#60;a href=&#34;http://bbpress.org/forums/topic/yet-another-integration-bug-no-role-set-on-registration?replies=5&#34;&#62;fix &#60;/a&#62; that apparently works for wordpress, but I tried it for wordpress mu with no luck.&#60;/p&#62;
&#60;p&#62;The 4th post in &#60;a href=&#34;http://mu.wordpress.org/forums/topic.php?id=2292&#38;#38;page#post-13962&#34;&#62;this thread&#60;/a&#62; explains a way to set roles in wordpress mu.  &#60;/p&#62;
&#60;p&#62;I imagine that a plugin with the combination of the two solutions would allow users to register through bbpress and get a default role on the main wordpress mu blog.  But, unfortunately I have no clue what I'm doing.  If anyone has a free minute or two to look at the bits of code and maybe hack something together that would be awesome.&#60;/p&#62;
&#60;p&#62;Oh, and I'm using the latest versions of both bbpress and wpmu.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
