<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [3082] branches/1.2: Fixes #2264</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>3082</dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2010-06-27 04:29:43 +0000 (Sun, 27 Jun 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixes #2264</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branches12bpforumsphp">branches/1.2/bp-forums.php</a></li>
<li><a href="#branches12bpgroupsphp">branches/1.2/bp-groups.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branches12bpforumsphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-forums.php (3081 => 3082)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-forums.php        2010-06-27 03:20:23 UTC (rev 3081)
+++ branches/1.2/bp-forums.php        2010-06-27 04:29:43 UTC (rev 3082)
</span><span class="lines">@@ -126,6 +126,25 @@
</span><span class="cx">         return bb_new_forum( array( 'forum_name' =&gt; stripslashes( $forum_name ), 'forum_desc' =&gt; stripslashes( $forum_desc ), 'forum_parent' =&gt; $forum_parent_id, 'forum_order' =&gt; $forum_order, 'forum_is_category' =&gt; $forum_is_category ) );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_forums_update_forum( $args = '' ) {
+        do_action( 'bbpress_init' );
+
+        $defaults = array(
+                'forum_id'                        =&gt; '',
+                'forum_name'                =&gt; '',
+                'forum_desc'                =&gt; '',
+                'forum_slug'                =&gt; '',
+                'forum_parent_id'        =&gt; BP_FORUMS_PARENT_FORUM_ID,
+                'forum_order'                =&gt; false,
+                'forum_is_category'        =&gt; 0
+        );
+
+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
+
+        return bb_update_forum( array( 'forum_id' =&gt; (int)$forum_id, 'forum_name' =&gt; stripslashes( $forum_name ), 'forum_desc' =&gt; stripslashes( $forum_desc ), 'forum_slug' =&gt; stripslashes( $forum_slug ), 'forum_parent' =&gt; $forum_parent_id, 'forum_order' =&gt; $forum_order, 'forum_is_category' =&gt; $forum_is_category ) );
+}
+
</ins><span class="cx"> /* Topic Functions */
</span><span class="cx"> 
</span><span class="cx"> function bp_forums_get_forum_topics( $args = '' ) {
</span></span></pre></div>
<a id="branches12bpgroupsphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-groups.php (3081 => 3082)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-groups.php        2010-06-27 03:20:23 UTC (rev 3081)
+++ branches/1.2/bp-groups.php        2010-06-27 04:29:43 UTC (rev 3082)
</span><span class="lines">@@ -1954,6 +1954,24 @@
</span><span class="cx">         do_action( 'groups_new_group_forum', $forum_id, $group_id );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function groups_update_group_forum( $group_id ) {
+
+        $group = new BP_Groups_Group( $group_id );
+
+        if ( !$group-&gt;enable_forum )
+                return false;
+
+        $args = array(
+                'forum_id'                =&gt; groups_get_groupmeta( $group, 'forum_id' ),
+                'forum_name'        =&gt; $group-&gt;name,
+                'forum_desc'        =&gt; $group-&gt;desc,
+                'forum_slug'        =&gt; $group-&gt;slug
+        );
+
+        bp_forums_update_forum( apply_filters( 'groups_update_group_forum', $args ) );
+}
+add_action( 'groups_details_updated', 'groups_update_group_forum' );
+
</ins><span class="cx"> function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>