<!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] [2460] trunk: Fixed forum post activity tracking,
now links directly to the forum post.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2460</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-26 17:49:48 +0000 (Tue, 26 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixed forum post activity tracking, now links directly to the forum post. Only show post form on the last page of posts.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssdefaultcss">trunk/bp-themes/bp-default/_inc/css/default.css</a></li>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
<li><a href="#trunkbpthemesbpdefaultgroupssingleforumtopicphp">trunk/bp-themes/bp-default/groups/single/forum/topic.php</a></li>
<li><a href="#trunkbpthemesbpdefaultgroupssingleforumphp">trunk/bp-themes/bp-default/groups/single/forum.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-blogs.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -252,6 +252,7 @@
</span><span class="cx">                 'type' => false,
</span><span class="cx">                 'item_id' => false,
</span><span class="cx">                 'secondary_item_id' => false,
</span><ins>+                'recorded_time' => gmdate( "Y-m-d H:i:s" ),
</ins><span class="cx">                 'hide_sitewide' => false
</span><span class="cx">         );
</span><span class="cx">
</span><span class="lines">@@ -277,7 +278,7 @@
</span><span class="cx">                 'secondary_item_id' => $secondary_item_id
</span><span class="cx">         ) );
</span><span class="cx">
</span><del>-        return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) );
</del><ins>+        return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function bp_blogs_delete_activity( $args = true ) {
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-core/bp-core-templatetags.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">         function bp_get_member_last_active() {
</span><span class="cx">                 global $members_template;
</span><span class="cx">
</span><del>-                $last_activity = attribute_escape( bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s ago', 'buddypress' ) ) );
</del><ins>+                $last_activity = bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s ago', 'buddypress' ) );
</ins><span class="cx">
</span><span class="cx">                 return apply_filters( 'bp_member_last_active', $last_activity );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-core.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -1462,13 +1462,7 @@
</span><span class="cx">         if ( !$last_activity_date || empty( $last_activity_date ) ) {
</span><span class="cx">                 $last_active = __( 'not recently active', 'buddypress' );
</span><span class="cx">         } else {
</span><del>-                if ( strstr( $last_activity_date, '-' ) ) {
-                        $last_active = bp_core_time_since( strtotime( $last_activity_date ) );
-                } else {
-                        $last_active = bp_core_time_since( $last_activity_date );
-                }
-
-                $last_active = sprintf( $string, $last_active );
</del><ins>+                $last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-forums/bp-forums-templatetags.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -737,6 +737,7 @@
</span><span class="cx">                         'next_text' => '&rarr;',
</span><span class="cx">                         'mid_size' => 1
</span><span class="cx">                 ));
</span><ins>+                $this->pag->total_pages = ceil($this->total_post_count / $this->pag_num);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function has_posts() {
</span><span class="lines">@@ -913,9 +914,12 @@
</span><span class="cx">                 $r = wp_parse_args( $args, $defaults );
</span><span class="cx">                 extract( $r, EXTR_SKIP );
</span><span class="cx">
</span><del>-                $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id, 'bp_forums_edit_post' ) . '">' . __( 'Edit Post', 'buddypress' ) . '</a> ' . $seperator . ' ';
-                $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete Post', 'buddypress' ) . '</a>';
</del><ins>+                if ( $_SERVER['QUERY_STRING'] )
+                        $query_vars = '?' . $_SERVER['QUERY_STRING'];
</ins><span class="cx">
</span><ins>+                $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' ';
+                $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a> | ';
+
</ins><span class="cx">                 return $links;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -950,6 +954,15 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_the_topic_is_last_page() {
+        echo bp_get_the_topic_is_last_page();
+}
+        function bp_get_the_topic_is_last_page() {
+                global $topic_template;
+
+                return apply_filters( 'bp_get_the_topic_is_last_page', $topic_template->pag_page == $topic_template->pag->total_pages );
+        }
+
</ins><span class="cx"> function bp_directory_forums_search_form() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-friends.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -275,13 +275,14 @@
</span><span class="cx">                 'type' => false,
</span><span class="cx">                 'item_id' => false,
</span><span class="cx">                 'secondary_item_id' => false,
</span><ins>+                'recorded_time' => gmdate( "Y-m-d H:i:s" ),
</ins><span class="cx">                 'hide_sitewide' => false
</span><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx">
</span><del>-        return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) );
</del><ins>+        return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function friends_delete_activity( $args ) {
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-groups.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx">                                 if ( !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
</span><span class="cx">                                         groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
</span><span class="cx">
</span><del>-                                if ( !groups_new_group_forum_post( $_POST['reply_text'], $topic_id ) )
</del><ins>+                                if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $_GET['topic_page'] ) )
</ins><span class="cx">                                         bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
</span><span class="cx">                                 else
</span><span class="cx">                                         bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') );
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx">                                 if ( $_SERVER['QUERY_STRING'] )
</span><span class="cx">                                         $query_vars = '?' . $_SERVER['QUERY_STRING'];
</span><span class="cx">
</span><del>-                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars );
</del><ins>+                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         /* Sticky a topic */
</span><span class="lines">@@ -521,13 +521,16 @@
</span><span class="cx">                                         /* Check the nonce */
</span><span class="cx">                                         check_admin_referer( 'bp_forums_edit_post' );
</span><span class="cx">
</span><del>-                                        if ( !groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id ) )
</del><ins>+                                        if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $_GET['topic_page'] ) )
</ins><span class="cx">                                                 bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' );
</span><span class="cx">                                         else
</span><span class="cx">                                                 bp_core_add_message( __( 'The post was edited successfully', 'buddypress') );
</span><span class="cx">
</span><ins>+                                        if ( $_SERVER['QUERY_STRING'] )
+                                                $query_vars = '?' . $_SERVER['QUERY_STRING'];
+
</ins><span class="cx">                                         do_action( 'groups_edit_forum_post', $post_id );
</span><del>-                                        bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' );
</del><ins>+                                        bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
</ins><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
</span><span class="lines">@@ -1317,6 +1320,7 @@
</span><span class="cx">                 $hide_sitewide = true;
</span><span class="cx">
</span><span class="cx">         $defaults = array(
</span><ins>+                'id' => false,
</ins><span class="cx">                 'user_id' => $bp->loggedin_user->id,
</span><span class="cx">                 'action' => '',
</span><span class="cx">                 'content' => '',
</span><span class="lines">@@ -1325,13 +1329,14 @@
</span><span class="cx">                 'type' => false,
</span><span class="cx">                 'item_id' => false,
</span><span class="cx">                 'secondary_item_id' => false,
</span><ins>+                'recorded_time' => gmdate( "Y-m-d H:i:s" ),
</ins><span class="cx">                 'hide_sitewide' => $hide_sitewide
</span><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx">
</span><del>-        return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) );
</del><ins>+        return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function groups_update_last_activity( $group_id ) {
</span><span class="lines">@@ -1928,7 +1933,7 @@
</span><span class="cx">         do_action( 'groups_new_group_forum', $forum, $group_id );
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function groups_new_group_forum_post( $post_text, $topic_id ) {
</del><ins>+function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
</ins><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         if ( empty( $post_text ) )
</span><span class="lines">@@ -1937,25 +1942,29 @@
</span><span class="cx">         $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
</span><span class="cx">         $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
</span><span class="cx">
</span><del>-        if ( $forum_post = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
</del><ins>+        if ( $post_id = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
</ins><span class="cx">                 $topic = bp_forums_get_topic_details( $topic_id );
</span><span class="cx">
</span><span class="cx">                 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
</span><span class="cx">                 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';
</span><ins>+                $primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
</ins><span class="cx">
</span><ins>+                if ( $page )
+                        $primary_link .= "?topic_page=" . $page;
+
</ins><span class="cx">                 /* Record this in activity streams */
</span><span class="cx">                 groups_record_activity( array(
</span><del>-                        'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ),
-                        'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ),
-                        'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
</del><ins>+                        'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_id, $post_text, &$topic ),
+                        'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_id, $post_text, &$topic ),
+                        'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ),
</ins><span class="cx">                         'type' => 'new_forum_post',
</span><span class="cx">                         'item_id' => $bp->groups->current_group->id,
</span><del>-                        'secondary_item_id' => $forum_post
</del><ins>+                        'secondary_item_id' => $post_id
</ins><span class="cx">                 ) );
</span><span class="cx">
</span><del>-                do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $forum_post );
</del><ins>+                do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $post_id );
</ins><span class="cx">
</span><del>-                return $forum_post;
</del><ins>+                return $post_id;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -2019,18 +2028,18 @@
</span><span class="cx">                         'item_id' => (int)$bp->groups->current_group->id,
</span><span class="cx">                         'user_id' => (int)$topic->topic_poster,
</span><span class="cx">                         'secondary_item_id' => $topic->topic_id,
</span><del>-                        'recorded_time' => strtotime( $topic->topic_time )
</del><ins>+                        'recorded_time' => $topic->topic_time
</ins><span class="cx">                 ) );
</span><span class="cx">
</span><span class="cx">                 do_action( 'groups_update_group_forum_topic', &$topic );
</span><span class="cx">
</span><del>-                return true;
</del><ins>+                return $topic;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function groups_update_group_forum_post( $post_id, $post_text, $topic_id ) {
</del><ins>+function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
</ins><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
</span><span class="lines">@@ -2041,28 +2050,33 @@
</span><span class="cx">         if ( $post_id = bp_forums_insert_post( array( 'post_id' => $post_id, 'post_text' => $post_text, 'post_time' => $post->post_time, 'topic_id' => $topic_id, 'poster_id' => $post->poster_id ) ) ) {
</span><span class="cx">                 $topic = bp_forums_get_topic_details( $topic_id );
</span><span class="cx">
</span><del>-                /* Update the activity stream item */
-                if ( function_exists( 'bp_activity_delete_by_item_id' ) )
-                        bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );
-
</del><span class="cx">                 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
</span><span class="cx">                 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';
</span><ins>+                $primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
</ins><span class="cx">
</span><del>-                /* Record this in activity streams */
</del><ins>+                if ( $page )
+                        $primary_link .= "?topic_page=" . $page;
+
+                /* Fetch an existing entry and update if one exists. */
+                if ( function_exists( 'bp_activity_get_activity_id' ) )
+                        $id = bp_activity_get_activity_id( array( 'user_id' => $post->poster_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post', 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id ) );
+
+                /* Update the entry in activity streams */
</ins><span class="cx">                 groups_record_activity( array(
</span><ins>+                        'id' => $id,
</ins><span class="cx">                         'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ),
</span><span class="cx">                         'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ),
</span><del>-                        'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ),
</del><ins>+                        'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ),
</ins><span class="cx">                         'type' => 'new_forum_post',
</span><span class="cx">                         'item_id' => (int)$bp->groups->current_group->id,
</span><span class="cx">                         'user_id' => (int)$post->poster_id,
</span><span class="cx">                         'secondary_item_id' => $post_id,
</span><del>-                        'recorded_time' => strtotime( $post->post_time )
</del><ins>+                        'recorded_time' => $post->post_time
</ins><span class="cx">                 ) );
</span><span class="cx">
</span><span class="cx">                 do_action( 'groups_update_group_forum_post', &$post, &$topic );
</span><span class="cx">
</span><del>-                return true;
</del><ins>+                return $post_id;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssdefaultcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/default.css (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default.css        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-themes/bp-default/_inc/css/default.css        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -1529,12 +1529,14 @@
</span><span class="cx">                 padding: 5px 0;
</span><span class="cx">                 margin: 5px 0 25px 0;
</span><span class="cx">         }
</span><del>-                div.navigation .alignright {
</del><ins>+                .alignright {
</ins><span class="cx">                         float: right;
</span><ins>+                        margin-left: 15px;
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                div.navigation .alignleft {
</del><ins>+                .alignleft {
</ins><span class="cx">                         float: left;
</span><ins>+                        margin-right: 15px;
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">         div.post p { margin: 0 0 20px 0; }
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -670,6 +670,8 @@
</span><span class="cx">                         else
</span><span class="cx">                                 var el = j('li.filter select');
</span><span class="cx">
</span><ins>+                        alert(el.attr('id'));
+
</ins><span class="cx">                         var page_number = 1;
</span><span class="cx">                         var css_id = el.attr('id').split( '-' );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultgroupssingleforumtopicphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/groups/single/forum/topic.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/groups/single/forum/topic.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-themes/bp-default/groups/single/forum/topic.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">
</span><span class="cx">         <form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
</span><span class="cx">
</span><del>-                <div class="pagination">
</del><ins>+                <div class="pagination no-ajax">
</ins><span class="cx">
</span><span class="cx">                         <div id="post-count" class="pag-count">
</span><span class="cx">                                 <?php bp_the_topic_pagination_count() ?>
</span><span class="lines">@@ -36,46 +36,65 @@
</span><span class="cx">                                                 <?php bp_the_topic_post_content() ?>
</span><span class="cx">                                         </div>
</span><span class="cx">
</span><del>-                                        <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
-                                                <div class="admin-links"><?php bp_the_topic_post_admin_links() ?></div>
-                                        <?php endif; ?>
</del><ins>+                                        <div class="admin-links">
+                                                <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
+                                                        <?php bp_the_topic_post_admin_links() ?>
+                                                <?php endif; ?>
+                                                <a href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ) ?>">#</a>
+                                        </div>
</ins><span class="cx">                                 </li>
</span><span class="cx">
</span><span class="cx">                         <?php endwhile; ?>
</span><span class="cx">                 </ul>
</span><span class="cx">
</span><ins>+                <div class="pagination no-ajax">
+
+                        <div id="post-count" class="pag-count">
+                                <?php bp_the_topic_pagination_count() ?>
+                        </div>
+
+                        <div class="pagination-links" id="topic-pag">
+                                <?php bp_the_topic_pagination() ?>
+                        </div>
+
+                </div>
+
</ins><span class="cx">                 <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
</span><span class="cx">
</span><del>-                        <?php if ( bp_get_the_topic_is_topic_open() ) : ?>
</del><ins>+                        <?php if ( bp_get_the_topic_is_last_page() ) : ?>
</ins><span class="cx">
</span><del>-                                <div id="post-topic-reply">
-                                        <a name="post-reply"></a>
</del><ins>+                                <?php if ( bp_get_the_topic_is_topic_open() ) : ?>
</ins><span class="cx">
</span><del>-                                        <?php if ( !bp_group_is_member() ) : ?>
-                                                <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
-                                        <?php endif; ?>
</del><ins>+                                        <div id="post-topic-reply">
+                                                <p id="post-reply"></p>
</ins><span class="cx">
</span><del>-                                        <?php do_action( 'groups_forum_new_reply_before' ) ?>
</del><ins>+                                                <?php if ( !bp_group_is_member() ) : ?>
+                                                        <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
+                                                <?php endif; ?>
</ins><span class="cx">
</span><del>-                                        <p><strong><?php _e( 'Add a reply:', 'buddypress' ) ?></strong></p>
</del><ins>+                                                <?php do_action( 'groups_forum_new_reply_before' ) ?>
</ins><span class="cx">
</span><del>-                                        <textarea name="reply_text" id="reply_text"></textarea>
</del><ins>+                                                <h4><?php _e( 'Add a reply:', 'buddypress' ) ?></h4>
</ins><span class="cx">
</span><del>-                                        <div class="submit">
-                                                <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ) ?>" />
</del><ins>+                                                <textarea name="reply_text" id="reply_text"></textarea>
+
+                                                <div class="submit">
+                                                        <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ) ?>" />
+                                                </div>
+
+                                                <?php do_action( 'groups_forum_new_reply_after' ) ?>
+
+                                                <?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
</ins><span class="cx">                                         </div>
</span><span class="cx">
</span><del>-                                        <?php do_action( 'groups_forum_new_reply_after' ) ?>
</del><ins>+                                <?php else : ?>
</ins><span class="cx">
</span><del>-                                        <?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
-                                </div>
</del><ins>+                                        <div id="message" class="info">
+                                                <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ) ?></p>
+                                        </div>
</ins><span class="cx">
</span><del>-                        <?php else : ?>
</del><ins>+                                <?php endif; ?>
</ins><span class="cx">
</span><del>-                                <div id="message" class="info">
-                                        <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ) ?></p>
-                                </div>
-
</del><span class="cx">                         <?php endif; ?>
</span><span class="cx">
</span><span class="cx">                 <?php endif; ?>
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultgroupssingleforumphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/groups/single/forum.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/groups/single/forum.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-themes/bp-default/groups/single/forum.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx">                                         <p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ) ?></p>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                <a name="post-new"></a>
-                                <h3><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h3>
</del><ins>+                                <p id="post-new"></p>
+                                <h4><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h4>
</ins><span class="cx">
</span><span class="cx">                                 <label><?php _e( 'Title:', 'buddypress' ) ?></label>
</span><span class="cx">                                 <input type="text" name="topic_title" id="topic_title" value="" />
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (2459 => 2460)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2010-01-26 15:45:05 UTC (rev 2459)
+++ trunk/bp-xprofile.php        2010-01-26 17:49:48 UTC (rev 2460)
</span><span class="lines">@@ -489,13 +489,14 @@
</span><span class="cx">                 'type' => false,
</span><span class="cx">                 'item_id' => false,
</span><span class="cx">                 'secondary_item_id' => false,
</span><ins>+                'recorded_time' => gmdate( "Y-m-d H:i:s" ),
</ins><span class="cx">                 'hide_sitewide' => false
</span><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx">
</span><del>-        return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) );
</del><ins>+        return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>
</body>
</html>