<!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] [2626] trunk: Fixes #1816</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2626</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-08 13:26:48 +0000 (Mon, 08 Feb 2010)</dd>
</dl>

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpforumsphp">trunk/bp-forums.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpthemesbpdefaultgroupssingleforumtopicphp">trunk/bp-themes/bp-default/groups/single/forum/topic.php</a></li>
<li><a href="#trunkbpthemesbpdefaultgroupssinglegroupheaderphp">trunk/bp-themes/bp-default/groups/single/group-header.php</a></li>
<li><a href="#trunkbpthemesbpdefaultgroupssinglemembersphp">trunk/bp-themes/bp-default/groups/single/members.php</a></li>
<li><a href="#trunkbpthemesbpdefaultmemberssinglememberheaderphp">trunk/bp-themes/bp-default/members/single/member-header.php</a></li>
<li><a href="#trunkbpthemesbpdefaultregistrationregisterphp">trunk/bp-themes/bp-default/registration/register.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-forums/bp-forums-templatetags.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -522,13 +522,10 @@
</span><span class="cx">                 return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-function bp_the_topic_time_since_last_post( $deprecated = true ) {
</del><ins>+function bp_the_topic_time_since_last_post() {
</ins><span class="cx">         global $forum_template;
</span><span class="cx"> 
</span><del>-        if ( !$deprecated )
-                return bp_get_the_topic_time_since_last_post();
-        else
-                echo bp_get_the_topic_time_since_last_post();
</del><ins>+        echo bp_get_the_topic_time_since_last_post();
</ins><span class="cx"> }
</span><span class="cx">         function bp_get_the_topic_time_since_last_post() {
</span><span class="cx">                 global $forum_template;
</span><span class="lines">@@ -878,27 +875,30 @@
</span><span class="cx">                 return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_fetch_avatar( array( 'item_id' =&gt; $topic_template-&gt;post-&gt;poster_id, 'type' =&gt; $type, 'width' =&gt; $width, 'height' =&gt; $height ) ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-function bp_the_topic_post_poster_name( $deprecated = true ) {
-        if ( !$deprecated )
-                return bp_get_the_topic_post_poster_name();
-        else
-                echo bp_get_the_topic_post_poster_name();
</del><ins>+function bp_the_topic_post_poster_name() {
+        echo bp_get_the_topic_post_poster_name();
</ins><span class="cx"> }
</span><span class="cx">         function bp_get_the_topic_post_poster_name() {
</span><span class="cx">                 global $topic_template;
</span><span class="cx"> 
</span><del>-                if ( !$name = bp_core_get_userlink( $topic_template-&gt;post-&gt;poster_id ) )
</del><ins>+                if ( !$link = bp_core_get_user_domain( $topic_template-&gt;post-&gt;poster_id, $topic_template-&gt;post-&gt;poster_nicename, $topic_template-&gt;post-&gt;poster_login ) )
</ins><span class="cx">                         return __( 'Deleted User', 'buddypress' );
</span><span class="cx"> 
</span><del>-                return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_userlink( $topic_template-&gt;post-&gt;poster_id ) );
</del><ins>+                return apply_filters( 'bp_get_the_topic_post_poster_name', '&lt;a href=&quot;' . $link . '&quot; title=&quot;' . $topic_template-&gt;post-&gt;poster_name . '&quot;&gt;' . $topic_template-&gt;post-&gt;poster_name . '&lt;/a&gt;' );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-function bp_the_topic_post_time_since( $deprecated = true ) {
-        if ( !$deprecated )
-                return bp_get_the_topic_post_time_since();
-        else
-                echo bp_get_the_topic_post_time_since();
</del><ins>+function bp_the_topic_post_poster_link() {
+        echo bp_get_the_topic_post_poster_link();
</ins><span class="cx"> }
</span><ins>+        function bp_get_the_topic_post_poster_link() {
+                global $topic_template;
+
+                return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_user_domain( $topic_template-&gt;post-&gt;poster_id, $topic_template-&gt;post-&gt;poster_nicename, $topic_template-&gt;post-&gt;poster_login ) );
+        }
+
+function bp_the_topic_post_time_since() {
+        echo bp_get_the_topic_post_time_since();
+}
</ins><span class="cx">         function bp_get_the_topic_post_time_since() {
</span><span class="cx">                 global $topic_template;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-forums.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -385,7 +385,7 @@
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="cx"> 
</span><span class="cx">         $query = new BB_Query( 'post', $args, 'get_thread' );
</span><del>-        return $query-&gt;results;
</del><ins>+        return bp_forums_get_post_extras( $query-&gt;results );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_forums_get_post( $post_id ) {
</span><span class="lines">@@ -450,6 +450,45 @@
</span><span class="cx">         return $post;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_forums_get_post_extras( $posts ) {
+        global $bp, $wpdb;
+
+        if ( empty( $posts ) )
+                return $posts;
+
+        /* Get the user ids */
+        foreach ( (array)$posts as $post ) $user_ids[] = $post-&gt;poster_id;
+        $user_ids = $wpdb-&gt;escape( join( ',', (array)$user_ids ) );
+
+        /* Fetch the poster's user_email, user_nicename and user_login */
+        $poster_details = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb-&gt;users} u WHERE u.ID IN ( {$user_ids} )&quot; ) );
+
+        for ( $i = 0; $i &lt; count( $posts ); $i++ ) {
+                foreach ( (array)$poster_details as $poster ) {
+                        if ( $poster-&gt;user_id == $posts[$i]-&gt;poster_id ) {
+                                $posts[$i]-&gt;poster_email = $poster-&gt;user_email;
+                                $posts[$i]-&gt;poster_login = $poster-&gt;user_nicename;
+                                $posts[$i]-&gt;poster_nicename = $poster-&gt;user_login;
+                                $posts[$i]-&gt;poster_name = $poster-&gt;display_name;
+                        }
+                }
+        }
+
+        /* Fetch fullname for each poster. */
+        if ( function_exists( 'xprofile_install' ) ) {
+                $poster_names = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT pd.user_id, pd.value FROM {$bp-&gt;profile-&gt;table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )&quot; ) );
+                for ( $i = 0; $i &lt; count( $posts ); $i++ ) {
+                        foreach ( (array)$poster_names as $name ) {
+                                if ( $name-&gt;user_id == $topics[$i]-&gt;user_id )
+                                $posts[$i]-&gt;poster_name = $poster-&gt;value;
+                        }
+                }
+        }
+
+        return $posts;
+}
+
+
</ins><span class="cx"> function bp_forums_get_forum_topicpost_count( $forum_id ) {
</span><span class="cx">         global $wpdb, $bbdb;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-groups/bp-groups-templatetags.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -1399,6 +1399,15 @@
</span><span class="cx">                 return apply_filters( 'bp_get_group_member_link', '&lt;a href=&quot;' . bp_core_get_user_domain( $members_template-&gt;member-&gt;user_id, $members_template-&gt;member-&gt;user_nicename, $members_template-&gt;member-&gt;user_login ) . '&quot;&gt;' . $members_template-&gt;member-&gt;display_name . '&lt;/a&gt;' );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+function bp_group_member_domain() {
+        echo bp_get_group_member_domain();
+}
+        function bp_get_group_member_domain() {
+                global $members_template;
+
+                return apply_filters( 'bp_get_group_member_domain', bp_core_get_user_domain( $members_template-&gt;member-&gt;user_id, $members_template-&gt;member-&gt;user_nicename, $members_template-&gt;member-&gt;user_login ) );
+        }
+
</ins><span class="cx"> function bp_group_member_is_friend() {
</span><span class="cx">         echo bp_get_group_member_is_friend();
</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 (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/groups/single/forum/topic.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-themes/bp-default/groups/single/forum/topic.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -28,8 +28,10 @@
</span><span class="cx"> 
</span><span class="cx">                                 &lt;li id=&quot;post-&lt;?php bp_the_topic_post_id() ?&gt;&quot;&gt;
</span><span class="cx">                                         &lt;div class=&quot;poster-meta&quot;&gt;
</span><del>-                                                &lt;?php bp_the_topic_post_poster_avatar( 'width=40&amp;height=40') ?&gt;
-                                                &lt;?php echo sprintf( __( '%s said %s ago:', 'buddypress' ), bp_the_topic_post_poster_name( false ), bp_the_topic_post_time_since( false ) ) ?&gt;
</del><ins>+                                                &lt;a href=&quot;&lt;?php bp_the_topic_post_poster_link() ?&gt;&quot;&gt;
+                                                        &lt;?php bp_the_topic_post_poster_avatar( 'width=40&amp;height=40' ) ?&gt;
+                                                &lt;/a&gt;
+                                                &lt;?php echo sprintf( __( '%s said %s ago:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ) ?&gt;
</ins><span class="cx">                                         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                                         &lt;div class=&quot;post-content&quot;&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultgroupssinglegroupheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/groups/single/group-header.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/groups/single/group-header.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-themes/bp-default/groups/single/group-header.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -21,7 +21,9 @@
</span><span class="cx"> &lt;/div&gt;&lt;!-- #item-actions --&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;item-header-avatar&quot;&gt;
</span><del>-        &lt;?php bp_group_avatar() ?&gt;
</del><ins>+        &lt;a href=&quot;&lt;?php bp_group_permalink() ?&gt;&quot; title=&quot;&lt;?php bp_group_name() ?&gt;&quot;&gt;
+                &lt;?php bp_group_avatar() ?&gt;
+        &lt;/a&gt;
</ins><span class="cx"> &lt;/div&gt;&lt;!-- #item-header-avatar --&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;item-header-content&quot;&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultgroupssinglemembersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/groups/single/members.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/groups/single/members.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-themes/bp-default/groups/single/members.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -20,7 +20,9 @@
</span><span class="cx">                 &lt;?php while ( bp_group_members() ) : bp_group_the_member(); ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;li&gt;
</span><del>-                                &lt;?php bp_group_member_avatar_thumb() ?&gt;
</del><ins>+                                &lt;a href=&quot;&lt;?php bp_group_member_domain() ?&gt;&quot;&gt;
+                                        &lt;?php bp_group_member_avatar_thumb() ?&gt;
+                                &lt;/a&gt;
</ins><span class="cx">                                 &lt;h5&gt;&lt;?php bp_group_member_link() ?&gt;&lt;/h5&gt;
</span><span class="cx">                                 &lt;span class=&quot;activity&quot;&gt;&lt;?php bp_group_member_joined_since() ?&gt;&lt;/span&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultmemberssinglememberheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/members/single/member-header.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/members/single/member-header.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-themes/bp-default/members/single/member-header.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -1,7 +1,9 @@
</span><span class="cx"> &lt;?php do_action( 'bp_before_member_header' ) ?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;item-header-avatar&quot;&gt;
</span><del>-        &lt;?php bp_displayed_user_avatar( 'type=full' ) ?&gt;
</del><ins>+        &lt;a href=&quot;&lt;?php bp_user_link() ?&gt;&quot;&gt;
+                &lt;?php bp_displayed_user_avatar( 'type=full' ) ?&gt;
+        &lt;/a&gt;
</ins><span class="cx"> &lt;/div&gt;&lt;!-- #item-header-avatar --&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;item-header-content&quot;&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultregistrationregisterphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/registration/register.php (2625 => 2626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/registration/register.php        2010-02-08 13:00:50 UTC (rev 2625)
+++ trunk/bp-themes/bp-default/registration/register.php        2010-02-08 13:26:48 UTC (rev 2626)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">                                                         &lt;span class=&quot;label&quot;&gt;&lt;?php _e( 'I would like my blog to appear in search engines, and in public listings around this site', 'buddypress' ) ?&gt;:&lt;/span&gt;
</span><span class="cx">                                                         &lt;?php do_action( 'bp_signup_blog_privacy_errors' ) ?&gt;
</span><span class="cx"> 
</span><del>-                                                        &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;signup_blog_privacy&quot; id=&quot;signup_blog_privacy_public&quot; value=&quot;public&quot;&lt;?php if ( 'public' == bp_get_signup_blog_privacy_value() ) : ?&gt; checked=&quot;checked&quot;&lt;?php endif; ?&gt; /&gt; &lt;?php _e( 'Yes' ) ?&gt;&lt;/label&gt;
</del><ins>+                                                        &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;signup_blog_privacy&quot; id=&quot;signup_blog_privacy_public&quot; value=&quot;public&quot;&lt;?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?&gt; checked=&quot;checked&quot;&lt;?php endif; ?&gt; /&gt; &lt;?php _e( 'Yes' ) ?&gt;&lt;/label&gt;
</ins><span class="cx">                                                         &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;signup_blog_privacy&quot; id=&quot;signup_blog_privacy_private&quot; value=&quot;private&quot;&lt;?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?&gt; checked=&quot;checked&quot;&lt;?php endif; ?&gt; /&gt; &lt;?php _e( 'No' ) ?&gt;&lt;/label&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;/div&gt;
</span></span></pre>
</div>
</div>

</body>
</html>