<!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] [2199] trunk: More number formatting changes.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2199</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-12-18 10:36:02 +0000 (Fri, 18 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>More number formatting changes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpblogsbpblogstemplatetagsphp">trunk/bp-blogs/bp-blogs-templatetags.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatetagsphp">trunk/bp-messages/bp-messages-templatetags.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-activity/bp-activity-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -172,8 +172,9 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $activities_template-&gt;pag_page - 1 ) * $activities_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $activities_template-&gt;pag_num - 1 ) &gt; $activities_template-&gt;total_activity_count ) ? $activities_template-&gt;total_activity_count : $from_num + ( $activities_template-&gt;pag_num - 1 ) );
</span><ins>+        $total = number_format( $activities_template-&gt;total_activity_count );
</ins><span class="cx"> 
</span><del>-        echo sprintf( __( 'Viewing item %d to %d (of %d items)', 'buddypress' ), $from_num, $to_num, $activities_template-&gt;total_activity_count ); ?&gt; &amp;nbsp;
</del><ins>+        echo sprintf( __( 'Viewing item %s to %s (of %s items)', 'buddypress' ), $from_num, $to_num, $total ); ?&gt; &amp;nbsp;
</ins><span class="cx">         &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpblogsbpblogstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs/bp-blogs-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs/bp-blogs-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-blogs/bp-blogs-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -171,8 +171,9 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $blogs_template-&gt;pag_page - 1 ) * $blogs_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $blogs_template-&gt;pag_num - 1 ) &gt; $blogs_template-&gt;total_blog_count ) ? $blogs_template-&gt;total_blog_count : $from_num + ( $blogs_template-&gt;pag_num - 1 ) );
</span><ins>+        $total = number_format( $blogs_template-&gt;total_blog_count );
</ins><span class="cx"> 
</span><del>-        echo sprintf( __( 'Viewing blog %d to %d (of %d blogs)', 'buddypress' ), $from_num, $to_num, $blogs_template-&gt;total_blog_count ); ?&gt; &amp;nbsp;
</del><ins>+        echo sprintf( __( 'Viewing blog %s to %s (of %s blogs)', 'buddypress' ), $from_num, $to_num, $total ); ?&gt; &amp;nbsp;
</ins><span class="cx">         &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -283,6 +284,7 @@
</span><span class="cx">         function bp_get_total_blog_count() {
</span><span class="cx">                 return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() );
</span><span class="cx">         }
</span><ins>+        add_filter( 'bp_get_total_blog_count', 'number_format' );
</ins><span class="cx"> 
</span><span class="cx"> function bp_total_blog_count_for_user( $user_id = false ) {
</span><span class="cx">         echo bp_get_total_blog_count_for_user( $user_id );
</span><span class="lines">@@ -290,6 +292,7 @@
</span><span class="cx">         function bp_get_total_blog_count_for_user( $user_id = false ) {
</span><span class="cx">                 return apply_filters( 'bp_get_total_blog_count_for_user', bp_blogs_total_blogs_for_user( $user_id ) );
</span><span class="cx">         }
</span><ins>+        add_filter( 'bp_get_total_blog_count_for_user', 'number_format' );
</ins><span class="cx"> 
</span><span class="cx"> /***
</span><span class="cx">  * Technically the template loops for blog posts and comments are deprecated.
</span><span class="lines">@@ -432,10 +435,10 @@
</span><span class="cx"> function bp_post_pagination_count() {
</span><span class="cx">         global $bp, $posts_template;
</span><span class="cx"> 
</span><del>-        $from_num = intval( ( $posts_template-&gt;pag_page - 1 ) * $posts_template-&gt;pag_num ) + 1;
-        $to_num = ( $from_num + ( $posts_template-&gt;pag_num - 1 ) &gt; $posts_template-&gt;total_post_count ) ? $posts_template-&gt;total_post_count : $from_num + ( $posts_template-&gt;pag_num - 1 ) ;
</del><ins>+        $from_num = number_format( intval( ( $posts_template-&gt;pag_page - 1 ) * $posts_template-&gt;pag_num ) + 1 );
+        $to_num = number_format( ( $from_num + ( $posts_template-&gt;pag_num - 1 ) &gt; $posts_template-&gt;total_post_count ) ? $posts_template-&gt;total_post_count : $from_num + ( $posts_template-&gt;pag_num - 1 ) );
</ins><span class="cx"> 
</span><del>-        echo sprintf( __( 'Viewing post %d to %d (of %d posts)', 'buddypress' ), $from_num, $to_num, $posts_template-&gt;total_post_count ); ?&gt; &amp;nbsp;
</del><ins>+        echo sprintf( __( 'Viewing post %s to %s (of %s posts)', 'buddypress' ), $from_num, $to_num, $posts_template-&gt;total_post_count ); ?&gt; &amp;nbsp;
</ins><span class="cx">         &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-core/bp-core-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -163,15 +163,16 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $members_template-&gt;pag_page - 1 ) * $members_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $members_template-&gt;pag_num - 1 ) &gt; $members_template-&gt;total_member_count ) ? $members_template-&gt;total_member_count : $from_num + ( $members_template-&gt;pag_num - 1) );
</span><ins>+        $total = number_format( $members_template-&gt;total_member_count );
</ins><span class="cx"> 
</span><span class="cx">         if ( 'active' == $members_template-&gt;type )
</span><del>-                echo sprintf( __( 'Viewing member %d to %d (of %d active members)', 'buddypress' ), $from_num, $to_num, $members_template-&gt;total_member_count );
</del><ins>+                echo sprintf( __( 'Viewing member %s to %s (of %s active members)', 'buddypress' ), $from_num, $to_num, $total );
</ins><span class="cx">         else if ( 'popular' == $members_template-&gt;type )
</span><del>-                echo sprintf( __( 'Viewing member %d to %d (of %d members with friends)', 'buddypress' ), $from_num, $to_num, $members_template-&gt;total_member_count );
</del><ins>+                echo sprintf( __( 'Viewing member %s to %s (of %s members with friends)', 'buddypress' ), $from_num, $to_num, $total );
</ins><span class="cx">         else if ( 'online' == $members_template-&gt;type )
</span><del>-                echo sprintf( __( 'Viewing member %d to %d (of %d members online)', 'buddypress' ), $from_num, $to_num, $members_template-&gt;total_member_count );
</del><ins>+                echo sprintf( __( 'Viewing member %s to %s (of %s members online)', 'buddypress' ), $from_num, $to_num, $total );
</ins><span class="cx">         else
</span><del>-                echo sprintf( __( 'Viewing member %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $members_template-&gt;total_member_count );
</del><ins>+                echo sprintf( __( 'Viewing member %s to %s (of %s members)', 'buddypress' ), $from_num, $to_num, $total );
</ins><span class="cx"> 
</span><span class="cx">         ?&gt;&lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-forums/bp-forums-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -643,8 +643,9 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $forum_template-&gt;pag_page - 1 ) * $forum_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $forum_template-&gt;pag_num - 1  ) &gt; $forum_template-&gt;total_topic_count ) ? $forum_template-&gt;total_topic_count : $from_num + ( $forum_template-&gt;pag_num - 1 ) );
</span><ins>+        $total = number_format( $forum_template-&gt;total_topic_count );
</ins><span class="cx"> 
</span><del>-        echo apply_filters( 'bp_forum_pagination_count', sprintf( __( 'Viewing topic %d to %d (%d total topics)', 'buddypress' ), $from_num, $to_num, $forum_template-&gt;total_topic_count ) );
</del><ins>+        echo apply_filters( 'bp_forum_pagination_count', sprintf( __( 'Viewing topic %s to %s (%s total topics)', 'buddypress' ), $from_num, $to_num, $total ) );
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;
</span><span class="cx"> &lt;?php
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-groups/bp-groups-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -677,8 +677,9 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $groups_template-&gt;pag_page - 1 ) * $groups_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $groups_template-&gt;pag_num - 1 ) &gt; $groups_template-&gt;total_group_count ) ? $groups_template-&gt;total_group_count : $from_num + ( $groups_template-&gt;pag_num - 1 ) );
</span><ins>+        $total = number_format( $groups_template-&gt;total_group_count );
</ins><span class="cx"> 
</span><del>-        echo sprintf( __( 'Viewing group %d to %d (of %d groups)', 'buddypress' ), $from_num, $to_num, $groups_template-&gt;total_group_count ); ?&gt; &amp;nbsp;
</del><ins>+        echo sprintf( __( 'Viewing group %s to %s (of %s groups)', 'buddypress' ), $from_num, $to_num, $total ); ?&gt; &amp;nbsp;
</ins><span class="cx">         &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1449,10 +1450,11 @@
</span><span class="cx">         function bp_get_group_member_pagination_count() {
</span><span class="cx">                 global $members_template;
</span><span class="cx"> 
</span><del>-                $from_num = intval( ( $members_template-&gt;pag_page - 1 ) * $members_template-&gt;pag_num ) + 1;
-                $to_num = ( $from_num + ( $members_template-&gt;pag_num - 1 ) &gt; $members_template-&gt;total_member_count ) ? $members_template-&gt;total_member_count : $from_num + ( $members_template-&gt;pag_num - 1 );
</del><ins>+                $from_num = number_format( intval( ( $members_template-&gt;pag_page - 1 ) * $members_template-&gt;pag_num ) + 1 );
+                $to_num = number_format( ( $from_num + ( $members_template-&gt;pag_num - 1 ) &gt; $members_template-&gt;total_member_count ) ? $members_template-&gt;total_member_count : $from_num + ( $members_template-&gt;pag_num - 1 ) );
+                $total = number_format( $members_template-&gt;total_member_count );
</ins><span class="cx"> 
</span><del>-                return apply_filters( 'bp_get_group_member_pagination_count', sprintf( __( 'Viewing members %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $members_template-&gt;total_member_count ) );
</del><ins>+                return apply_filters( 'bp_get_group_member_pagination_count', sprintf( __( 'Viewing members %s to %s (of %s members)', 'buddypress' ), $from_num, $to_num, $total ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_group_member_admin_pagination() {
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-templatetags.php (2198 => 2199)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-templatetags.php        2009-12-18 10:20:35 UTC (rev 2198)
+++ trunk/bp-messages/bp-messages-templatetags.php        2009-12-18 10:36:02 UTC (rev 2199)
</span><span class="lines">@@ -275,8 +275,9 @@
</span><span class="cx"> 
</span><span class="cx">         $from_num = number_format( intval( ( $messages_template-&gt;pag_page - 1 ) * $messages_template-&gt;pag_num ) + 1 );
</span><span class="cx">         $to_num = number_format( ( $from_num + ( $messages_template-&gt;pag_num - 1 ) &gt; $messages_template-&gt;total_thread_count ) ? $messages_template-&gt;total_thread_count : $from_num + ( $messages_template-&gt;pag_num - 1 ) );
</span><ins>+        $total = number_format( $messages_template-&gt;total_thread_count );
</ins><span class="cx"> 
</span><del>-        echo sprintf( __( 'Viewing message %d to %d (of %d messages)', 'buddypress' ), $from_num, $to_num, $messages_template-&gt;total_thread_count ); ?&gt; &amp;nbsp;
</del><ins>+        echo sprintf( __( 'Viewing message %s to %s (of %s messages)', 'buddypress' ), $from_num, $to_num, $total ); ?&gt; &amp;nbsp;
</ins><span class="cx">         &lt;span class=&quot;ajax-loader&quot;&gt;&lt;/span&gt;&lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>