<!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] [2158] trunk: Adding activity item permalink support</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2158</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-11-30 12:27:52 +0000 (Mon, 30 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adding activity item permalink support</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityclassesphp">trunk/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivitybpactivitywidgetsphp">trunk/bp-activity/bp-activity-widgets.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssscreencss">trunk/bp-themes/bp-default/_inc/css/screen.css</a></li>
<li><a href="#trunkbpthemesbpsnparentactivityentryphp">trunk/bp-themes/bp-sn-parent/activity/entry.php</a></li>
<li><a href="#trunkbpthemesbpsnparentactivityjustmephp">trunk/bp-themes/bp-sn-parent/activity/just-me.php</a></li>
<li><a href="#trunkbpthemesbpsnparentgroupssinglehomephp">trunk/bp-themes/bp-sn-parent/groups/single/home.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-classes.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-activity/bp-activity-classes.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -187,24 +187,28 @@
</span><span class="cx">                 if ( $sort != 'ASC' &amp;&amp; $sort != 'DESC' )
</span><span class="cx">                         $sort = 'DESC';
</span><span class="cx"> 
</span><ins>+                /* Hide Hidden Items? */
+                if ( !$show_hidden )
+                        $hidden_sql = &quot;AND hide_sitewide = 0&quot;;
+
</ins><span class="cx">                 /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */
</span><span class="cx">                 if ( !$display_comments || 'threaded' == $display_comments ) {
</span><span class="cx">                         if ( $per_page &amp;&amp; $page &amp;&amp; $max )
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql}&quot;, $user_id ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql}&quot;, $user_id ) );
</ins><span class="cx">                         else
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot;, $user_id ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot;, $user_id ) );
</ins><span class="cx"> 
</span><del>-                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$max_sql}&quot;, $user_id ) );
</del><ins>+                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$max_sql}&quot;, $user_id ) );
</ins><span class="cx"> 
</span><span class="cx">                         if ( $activities &amp;&amp; $display_comments )
</span><span class="cx">                                 $activities = BP_Activity_Activity::append_comments( &amp;$activities );
</span><span class="cx">                 } else {
</span><span class="cx">                         if ( $per_page &amp;&amp; $page &amp;&amp; $max )
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} ORDER BY date_recorded {$sort} {$pag_sql}&quot;, $user_id ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} ORDER BY date_recorded {$sort} {$pag_sql}&quot;, $user_id ) );
</ins><span class="cx">                         else
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot;, $user_id ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot;, $user_id ) );
</ins><span class="cx"> 
</span><del>-                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} ORDER BY date_recorded {$sort} {$max_sql}&quot;, $user_id ) );
</del><ins>+                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE user_id = %d {$search_sql} {$filter_sql} {$hidden_sql} ORDER BY date_recorded {$sort} {$max_sql}&quot;, $user_id ) );
</ins><span class="cx"> 
</span><span class="cx">                         if ( $activities )
</span><span class="cx">                                 $activities = BP_Activity_Activity::append_comments( &amp;$activities );
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-activity/bp-activity-templatetags.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">                                 $this-&gt;activities = bp_activity_get_sitewide( array( 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter, 'show_hidden' =&gt; $show_hidden ) );
</span><span class="cx"> 
</span><span class="cx">                         if ( $type == 'personal' )
</span><del>-                                $this-&gt;activities = bp_activity_get_for_user( array( 'user_id' =&gt; $user_id, 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter ) );
</del><ins>+                                $this-&gt;activities = bp_activity_get_for_user( array( 'user_id' =&gt; $user_id, 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter, 'show_hidden' =&gt; $show_hidden ) );
</ins><span class="cx"> 
</span><span class="cx">                         if ( $type == 'friends' &amp;&amp; ( bp_is_home() || is_site_admin() || $bp-&gt;loggedin_user-&gt;id == $user_id ) )
</span><span class="cx">                                 $this-&gt;activities = bp_activity_get_friends_activity( $user_id, $max, false, $this-&gt;pag_num, $this-&gt;pag_page, $filter );
</span><span class="lines">@@ -152,6 +152,10 @@
</span><span class="cx">                         $per_page = $max;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        /* Support for permalinks on single item pages: /groups/my-group/activity/124/ */
+        if ( $bp-&gt;current_action == $bp-&gt;activity-&gt;slug )
+                $include = $bp-&gt;action_variables[0];
+
</ins><span class="cx">         if ( isset( $_GET['afilter'] ) )
</span><span class="cx">                 $filter = array( 'object' =&gt; $_GET['afilter'] );
</span><span class="cx">         else
</span><span class="lines">@@ -347,10 +351,16 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if ( 'activity_comment' == $activities_template-&gt;activity-&gt;component_action )
+                $meta = '&lt;/span&gt; &lt;span class=&quot;activity-header-meta&quot;&gt; &amp;middot; &lt;a href=&quot;' . $bp-&gt;root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template-&gt;activity-&gt;item_id . '&quot;&gt;' . __( 'View Thread', 'buddypress' ) . '&lt;/a&gt;';
+        else
+                $meta = '&lt;/span&gt; &lt;span class=&quot;activity-header-meta&quot;&gt; &amp;middot; &lt;a href=&quot;' . $bp-&gt;root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template-&gt;activity-&gt;id . '&quot;&gt;' . __( 'Permalink', 'buddypress' ) . '&lt;/a&gt;';
+
</ins><span class="cx">         /* Add the delete link if the user has permission on this item */
</span><span class="cx">         if ( ( $activities_template-&gt;activity-&gt;user_id == $bp-&gt;loggedin_user-&gt;id ) || $bp-&gt;is_item_admin || is_site_admin() )
</span><del>-                $content[1] = '&lt;/span&gt; &lt;span class=&quot;activity-delete-link&quot;&gt;' . bp_get_activity_delete_link() . '&lt;/span&gt;' . $content[1];
</del><ins>+                 $meta .= ' &amp;middot;' . bp_get_activity_delete_link();
</ins><span class="cx"> 
</span><ins>+        $content[1] = $meta . '&lt;/span&gt;' . $content[1];
</ins><span class="cx">         $content_new = '';
</span><span class="cx"> 
</span><span class="cx">         for ( $i = 0; $i &lt; count($content); $i++ )
</span><span class="lines">@@ -486,6 +496,15 @@
</span><span class="cx">         return apply_filters( 'bp_activity_insert_time_since', @sprintf( $content, @sprintf( __( '&amp;nbsp; %s ago', 'buddypress' ), bp_core_time_since( strtotime( $date ) ) ) ) );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_activity_permalink_id() {
+        echo bp_get_activity_permalink_id();
+}
+        function bp_get_activity_permalink_id() {
+                global $bp;
+
+                return apply_filters( 'bp_get_activity_permalink_id', $bp-&gt;current_action );
+        }
+
</ins><span class="cx"> function bp_activity_css_class() {
</span><span class="cx">         echo bp_get_activity_css_class();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpactivitybpactivitywidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-widgets.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-widgets.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-activity/bp-activity-widgets.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">                                 &lt;div id=&quot;whats-new-options&quot;&gt;
</span><span class="cx">                                         &lt;div id=&quot;whats-new-submit&quot;&gt;
</span><span class="cx">                                                 &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt; &amp;nbsp;
</span><del>-                                                &lt;input type=&quot;submit&quot; name=&quot;aw-whats-new-submit&quot; id=&quot;aw-whats-new-submit&quot; value=&quot;&lt;?php _e( 'Update', 'callisto' ) ?&gt;&quot; /&gt;
</del><ins>+                                                &lt;input type=&quot;submit&quot; name=&quot;aw-whats-new-submit&quot; id=&quot;aw-whats-new-submit&quot; value=&quot;&lt;?php _e( 'Post Update', 'callisto' ) ?&gt;&quot; /&gt;
</ins><span class="cx">                                         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                                         &lt;div id=&quot;whats-new-post-in-box&quot;&gt;
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-activity.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">         /* Register 'activity' as a root component (for RSS feed use) */
</span><span class="cx">         bp_core_add_root_component( BP_ACTIVITY_SLUG );
</span><span class="cx"> }
</span><del>-add_action( 'plugins_loaded', 'bp_activity_setup_root_component' );
</del><ins>+add_action( 'plugins_loaded', 'bp_activity_setup_root_component', 2 );
</ins><span class="cx"> 
</span><span class="cx"> function bp_activity_setup_nav() {
</span><span class="cx">         global $bp;
</span><span class="lines">@@ -135,7 +135,48 @@
</span><span class="cx">         bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'activity/my-friends' ) );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_activity_screen_single_activity_permalink() {
+        global $bp;
</ins><span class="cx"> 
</span><ins>+        if ( !$bp-&gt;displayed_user-&gt;id || $bp-&gt;current_component != $bp-&gt;activity-&gt;slug )
+                return false;
+
+        if ( empty( $bp-&gt;current_action ) || !is_numeric( $bp-&gt;current_action ) )
+                return false;
+
+        /* Get the activity details */
+        $activity = bp_activity_get_specific( array( 'activity_ids' =&gt; $bp-&gt;current_action ) );
+
+        if ( !$activity = $activity['activities'][0] )
+                bp_core_redirect( $bp-&gt;root_domain );
+
+        $has_access = true;
+        /* Redirect based on the type of activity */
+        if ( $activity-&gt;component_name == $bp-&gt;groups-&gt;id ) {
+                if ( !function_exists( 'groups_get_group' ) )
+                        bp_core_redirect( $bp-&gt;root_domain );
+
+                if ( $group = groups_get_group( array( 'group_id' =&gt; $activity-&gt;item_id ) ) ) {
+                        /* Check to see if the group is not public, if so, check the user has access to see this activity */
+                        if ( 'public' != $group-&gt;status ) {
+                                if ( !groups_is_user_member( $bp-&gt;loggedin_user-&gt;id, $group-&gt;id ) )
+                                        $has_access = false;
+                        }
+                }
+        }
+
+        $has_access = apply_filters( 'bp_activity_permalink_access', $has_access, &amp;$activity );
+
+        if ( !$has_access ) {
+                bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' );
+                bp_core_redirect( $bp-&gt;loggedin_user-&gt;domain );
+        }
+
+        bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'activity/single' ) );
+}
+/* This screen is not attached to a nav item, so we need to add an action for it. */
+add_action( 'wp', 'bp_activity_screen_single_activity_permalink', 3 );
+
</ins><span class="cx"> /********************************************************************************
</span><span class="cx">  * Action Functions
</span><span class="cx">  *
</span><span class="lines">@@ -144,6 +185,41 @@
</span><span class="cx">  * back to the default screen after execution.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+function bp_activity_action_permalink_router() {
+        global $bp;
+
+        if ( $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || $bp-&gt;current_action != 'p' )
+                return false;
+
+        if ( empty( $bp-&gt;action_variables[0] ) || !is_numeric( $bp-&gt;action_variables[0] ) )
+                return false;
+
+        /* Get the activity details */
+        $activity = bp_activity_get_specific( array( 'activity_ids' =&gt; $bp-&gt;action_variables[0] ) );
+
+        if ( !$activity = $activity['activities'][0] )
+                bp_core_redirect( $bp-&gt;root_domain );
+
+        $redirect = false;
+        /* Redirect based on the type of activity */
+        if ( $activity-&gt;component_name == $bp-&gt;groups-&gt;id ) {
+                if ( $activity-&gt;user_id )
+                        $redirect = bp_core_get_userurl( $activity-&gt;user_id ) . $bp-&gt;activity-&gt;slug . '/' . $activity-&gt;id;
+                else {
+                        if ( $group = groups_get_group( array( 'group_id' =&gt; $activity-&gt;item_id ) ) )
+                                $redirect = bp_get_group_permalink( $group ) . $bp-&gt;activity-&gt;slug . '/' . $activity-&gt;id;
+                }
+        } else
+                $redirect = bp_core_get_userurl( $activity-&gt;user_id ) . $bp-&gt;activity-&gt;slug . '/' . $activity-&gt;id;
+
+        if ( !$redirect )
+                bp_core_redirect( $bp-&gt;root_domain );
+
+        /* Redirect to the actual activity permalink page */
+        bp_core_redirect( apply_filters( 'bp_activity_action_permalink_url', $redirect . '/', &amp;$activity ) );
+}
+add_action( 'wp', 'bp_activity_action_permalink_router', 3 );
+
</ins><span class="cx"> function bp_activity_action_delete_activity() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -178,7 +254,6 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'bp_activity_action_delete_activity', 3 );
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> function bp_activity_action_sitewide_feed() {
</span><span class="cx">         global $bp, $wp_query;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-groups/bp-groups-templatetags.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -483,7 +483,7 @@
</span><span class="cx">                 if ( !$group )
</span><span class="cx">                         $group =&amp; $groups_template-&gt;group;
</span><span class="cx"> 
</span><del>-                return apply_filters( 'bp_get_group_permalink', $bp-&gt;root_domain . '/' . $bp-&gt;groups-&gt;slug . '/' . $group-&gt;slug );
</del><ins>+                return apply_filters( 'bp_get_group_permalink', $bp-&gt;root_domain . '/' . $bp-&gt;groups-&gt;slug . '/' . $group-&gt;slug . '/' );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_group_admin_permalink( $deprecated = true, $deprecated2 = false ) {
</span><span class="lines">@@ -738,6 +738,15 @@
</span><span class="cx">         return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_group_is_activity_permalink() {
+        global $bp;
+
+        if ( !$bp-&gt;is_single_item || $bp-&gt;current_component != $bp-&gt;groups-&gt;slug || $bp-&gt;current_action != $bp-&gt;activity-&gt;slug )
+                return false;
+
+        return true;
+}
+
</ins><span class="cx"> function bp_group_pagination() {
</span><span class="cx">         echo bp_get_group_pagination();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-groups.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -574,12 +574,10 @@
</span><span class="cx">          bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> function groups_screen_group_home() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="cx">         if ( $bp-&gt;is_single_item ) {
</span><del>-
</del><span class="cx">                 if ( isset($_GET['new']) ) {
</span><span class="cx">                         // Delete group request notifications for the user
</span><span class="cx">                         bp_core_delete_notifications_for_user_by_type( $bp-&gt;loggedin_user-&gt;id, $bp-&gt;groups-&gt;slug, 'membership_request_accepted' );
</span><span class="lines">@@ -975,6 +973,19 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function groups_screen_group_activity_permalink() {
+        global $bp;
+
+        if ( !$bp-&gt;is_single_item || $bp-&gt;current_component != $bp-&gt;groups-&gt;slug || $bp-&gt;current_action != $bp-&gt;activity-&gt;slug )
+                return false;
+
+        if ( '' != locate_template( array( 'groups/single/home.php' ), false ) )
+                bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
+        else
+                bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/group-home' ) );
+}
+add_action( 'wp', 'groups_screen_group_activity_permalink', 3 );
+
</ins><span class="cx"> function groups_screen_group_admin() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -1606,6 +1617,18 @@
</span><span class="cx">  * true or false on success or failure.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+function groups_get_group( $args = '' ) {
+        $defaults = array(
+                'group_id' =&gt; false,
+                'load_users' =&gt; false
+        );
+
+        $args = wp_parse_args( $args, $defaults );
+        extract( $args, EXTR_SKIP );
+
+        return apply_filters( 'groups_get_group', new BP_Groups_Group( $group_id, true, $load_users ) );
+}
+
</ins><span class="cx"> /*** Group Creation, Editing &amp; Deletion *****************************************/
</span><span class="cx"> 
</span><span class="cx"> function groups_create_group( $args = '' ) {
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssscreencss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/screen.css (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/screen.css        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-themes/bp-default/_inc/css/screen.css        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -1341,6 +1341,13 @@
</span><span class="cx">                         margin-bottom: 18px;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+.activity-list li span.activity-header-meta {
+        font-size: 0.95em;
+}
+        .activity-list li span.activity-header-meta a {
+                color: #888;
+        }
+
</ins><span class="cx"> .activity-list li span.time-since {
</span><span class="cx">         font-size: 0.85em;
</span><span class="cx">         color: #999;
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentactivityentryphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/activity/entry.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/activity/entry.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-themes/bp-sn-parent/activity/entry.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -21,7 +21,10 @@
</span><span class="cx">                 &lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;activity-comment-form&quot; id=&quot;ac-form-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-form&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;ac-reply-avatar&quot;&gt;&lt;?php bp_loggedin_user_avatar( 'width=25&amp;height=25' ) ?&gt;&lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;ac-reply-content&quot;&gt;
</span><del>-                                &lt;textarea id=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-input&quot; name=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;/textarea&gt;
</del><ins>+                                &lt;div class=&quot;ac-textarea&quot;&gt;
+                                        &lt;textarea id=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-input&quot; name=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;/textarea&gt;
+                                &lt;/div&gt;
+
</ins><span class="cx">                                 &lt;input type=&quot;submit&quot; name=&quot;ac-form-submit&quot; value=&quot;&lt;?php _e( 'Post', 'buddypress' ) ?&gt; &amp;rarr;&quot; /&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentactivityjustmephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/activity/just-me.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/activity/just-me.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-themes/bp-sn-parent/activity/just-me.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> 
</span><span class="cx">                                         &lt;div class=&quot;activity&quot;&gt;
</span><span class="cx"> 
</span><del>-                                        &lt;?php if ( bp_has_activities( 'type=personal&amp;max=20&amp;per_page=20&amp;display_comments=stream' ) ) : ?&gt;
</del><ins>+                                        &lt;?php if ( bp_has_activities( 'type=personal&amp;max=20&amp;per_page=20&amp;display_comments=stream&amp;show_hidden=' . bp_is_home() ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                                                 &lt;ul id=&quot;activity-list&quot; class=&quot;activity-list item-list&quot;&gt;
</span><span class="cx">                                                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentgroupssinglehomephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/groups/single/home.php (2157 => 2158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/groups/single/home.php        2009-11-30 00:25:30 UTC (rev 2157)
+++ trunk/bp-themes/bp-sn-parent/groups/single/home.php        2009-11-30 12:27:52 UTC (rev 2158)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">                                                 &lt;div class=&quot;bp-widget&quot;&gt;
</span><span class="cx">                                                         &lt;h4&gt;&lt;?php _e( 'Group Activity', 'buddypress' ); ?&gt;&lt;/h4&gt;
</span><span class="cx"> 
</span><del>-                                                        &lt;?php if ( is_user_logged_in() &amp;&amp; bp_group_is_member() ) : ?&gt;
</del><ins>+                                                        &lt;?php if ( is_user_logged_in() &amp;&amp; bp_group_is_member() &amp;&amp; !bp_group_is_activity_permalink() ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                                                         &lt;form action=&quot;&quot; method=&quot;post&quot; id=&quot;whats-new-form&quot; name=&quot;whats-new-form&quot;&gt;
</span><span class="cx">                                                                 &lt;div id=&quot;whats-new-avatar&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>