<!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" />
<title>[BuddyPress][5343] trunk/bp-activity/bp-activity-admin.php: See #3660.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/5343">5343</a></dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2011-11-21 20:57:54 +0000 (Mon, 21 Nov 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>See <a href="http://buddypress.trac.wordpress.org/ticket/3660">#3660</a>. Tidy markup and fix number i18n.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityadminphp">trunk/bp-activity/bp-activity-admin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-admin.php (5342 => 5343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-admin.php        2011-11-21 20:31:05 UTC (rev 5342)
+++ trunk/bp-activity/bp-activity-admin.php        2011-11-21 20:57:54 UTC (rev 5343)
</span><span class="lines">@@ -158,16 +158,12 @@
</span><span class="cx">                 '&lt;p&gt;' . __( '&lt;a href=&quot;http://buddypress.org/support/&quot;&gt;Support Forums&lt;/a&gt;', 'buddypress' ) . '&lt;/p&gt;'
</span><span class="cx">         );
</span><span class="cx"> 
</span><ins>+        $dev = ( defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ) ? 'dev.' : '';
+
</ins><span class="cx">         // Enqueue CSS and JavaScript
</span><del>-        if ( defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ) {
-                wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . 'bp-activity/admin/js/admin.dev.js', array( 'jquery', 'wp-ajax-response' ), '20111120' );
-                wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . 'bp-activity/admin/css/admin.dev.css', array(), '20111120' );
</del><ins>+        wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . &quot;bp-activity/admin/js/admin.{$dev}js&quot;, array( 'jquery', 'wp-ajax-response' ), '20111120' );
+        wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . &quot;bp-activity/admin/css/admin.{$dev}css&quot;, array(), '20111120' );
</ins><span class="cx"> 
</span><del>-        } else {
-                wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . 'bp-activity/admin/js/admin.js', array( 'jquery', 'wp-ajax-response' ), '20111120' );
-                wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . 'bp-activity/admin/css/admin.css', array(), '20111120' );
-        }
-
</del><span class="cx">         // Create the Activity screen list table
</span><span class="cx">         $bp_activity_list_table = new BP_Activity_List_Table();
</span><span class="cx"> 
</span><span class="lines">@@ -306,16 +302,16 @@
</span><span class="cx">                 $unspammed = !empty( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
</span><span class="cx"> 
</span><span class="cx">                 if ( $deleted &gt; 0 )
</span><del>-                        $messages[] = sprintf( _n( '%s activity was permanently deleted.', '%s activities were permanently deleted.', $deleted, 'buddypress' ), $deleted );
</del><ins>+                        $messages[] = sprintf( _n( '%s activity was permanently deleted.', '%s activities were permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
</ins><span class="cx"> 
</span><span class="cx">                 if ( $error &gt; 0 )
</span><del>-                        $messages[] = sprintf( __( 'An error occured when updating Activity ID #%d.', 'buddypress' ), $error );
</del><ins>+                        $messages[] = sprintf( __( 'An error occured when updating Activity ID #%s.', 'buddypress' ), number_format_i18n( $error ) );
</ins><span class="cx"> 
</span><span class="cx">                 if ( $spammed &gt; 0 )
</span><del>-                        $messages[] = sprintf( _n( '%s activity marked as spam.', '%s activities marked as spam.', $spammed, 'buddypress' ), $spammed );
</del><ins>+                        $messages[] = sprintf( _n( '%s activity marked as spam.', '%s activities marked as spam.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
</ins><span class="cx"> 
</span><span class="cx">                 if ( $unspammed &gt; 0 )
</span><del>-                        $messages[] = sprintf( _n( '%s activity restored from the spam.', '%s activities restored from the spam.', $unspammed, 'buddypress' ), $unspammed );
</del><ins>+                        $messages[] = sprintf( _n( '%s activity restored from the spam.', '%s activities restored from the spam.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
</ins><span class="cx"> 
</span><span class="cx">         // Handle the edit screen
</span><span class="cx">         } elseif ( 'edit' == $bp_activity_list_table-&gt;current_action() &amp;&amp; !empty( $_GET['aid'] ) ) {
</span><span class="lines">@@ -331,7 +327,7 @@
</span><span class="cx">                 &lt;?php screen_icon( 'buddypress' ); ?&gt;
</span><span class="cx">                 &lt;h2&gt;
</span><span class="cx">                         &lt;?php if ( !empty( $_REQUEST['aid'] ) ) : ?&gt;
</span><del>-                                &lt;?php printf( __( 'Activity (ID #%d)', 'buddypress' ), (int) $_REQUEST['aid'] ); ?&gt;
</del><ins>+                                &lt;?php printf( __( 'Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?&gt;
</ins><span class="cx">                         &lt;?php else : ?&gt;
</span><span class="cx">                                 &lt;?php _e( 'Activity', 'buddypress' ); ?&gt;
</span><span class="cx">                         &lt;?php endif; ?&gt;
</span><span class="lines">@@ -351,7 +347,7 @@
</span><span class="cx">                 &lt;form id=&quot;bp-activities-form&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
</span><span class="cx">                         &lt;?php $bp_activity_list_table-&gt;search_box( __( 'Search Activities', 'buddypress' ), 'bp-activity' ); ?&gt;
</span><span class="cx"> 
</span><del>-                        &lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;&lt;?php echo esc_attr( $_REQUEST['page'] ); ?&gt;&quot; /&gt;
</del><ins>+                        &lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;&lt;?php echo esc_attr( (int) $_REQUEST['page'] ); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;?php $bp_activity_list_table-&gt;display(); ?&gt;
</span><span class="cx">                 &lt;/form&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -593,7 +589,7 @@
</span><span class="cx">         ?&gt;
</span><span class="cx">                 &lt;ul class=&quot;subsubsub&quot;&gt;
</span><span class="cx">                         &lt;li class=&quot;all&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_attr( esc_url( $redirect_to ) ); ?&gt;&quot; class=&quot;&lt;?php if ( 'spam' != $this-&gt;view ) echo 'current'; ?&gt;&quot;&gt;&lt;?php _e( 'All', 'buddypress' ); ?&gt;&lt;/a&gt; |&lt;/li&gt;
</span><del>-                        &lt;li class=&quot;spam&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?&gt;&quot; class=&quot;&lt;?php if ( 'spam' == $this-&gt;view ) echo 'current'; ?&gt;&quot;&gt;&lt;?php printf( __( 'Spam &lt;span class=&quot;count&quot;&gt;(%d)&lt;/span&gt;', 'buddypress' ), $this-&gt;spam_count ); ?&gt;&lt;/a&gt;&lt;/li&gt;
</del><ins>+                        &lt;li class=&quot;spam&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?&gt;&quot; class=&quot;&lt;?php if ( 'spam' == $this-&gt;view ) echo 'current'; ?&gt;&quot;&gt;&lt;?php printf( __( 'Spam &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'buddypress' ), number_format_i18n( $this-&gt;spam_count ) ); ?&gt;&lt;/a&gt;&lt;/li&gt;
</ins><span class="cx">                 &lt;/ul&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">         }
</span><span class="lines">@@ -811,29 +807,34 @@
</span><span class="cx">                 if ( empty( $root_activity_id[1] ) )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><del>-                $root_activity_id = (int) $root_activity_id[1];
</del><ins>+                $root_activity_id  = (int) $root_activity_id[1];
+                $root_activity_url = network_admin_url( 'admin.php?page=bp-activity&amp;amp;aid=' . $root_activity_id );
</ins><span class="cx"> 
</span><span class="cx">                 // Is $item the root activity?
</span><span class="cx">                 if ( (int) $item['id'] == $root_activity_id ) {
</span><span class="cx">                         $root_activity = (object) $item;
</span><span class="cx"> 
</span><span class="cx">                         // Get root activity comment count
</span><del>-                        $comment_count = !empty( $root_activity-&gt;children ) ? bp_activity_recurse_comment_count( $root_activity ) : 0;
</del><ins>+                        $comment_count = !empty( $root_activity-&gt;children ) ? number_format_i18n( bp_activity_recurse_comment_count( $root_activity ) ) : 0;
+                        $title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
</ins><span class="cx"> 
</span><span class="cx">                         // Display a link to the root activity's permalink, with its comment count in a speech bubble
</span><del>-                        printf( '&lt;br /&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; class=&quot;post-com-count&quot;&gt;&lt;span class=&quot;comment-count&quot;&gt;%3$d&lt;/span&gt;&lt;/a&gt;',  network_admin_url( 'admin.php?page=bp-activity&amp;amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
</del><ins>+                        printf( '&lt;br /&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; class=&quot;post-com-count&quot;&gt;&lt;span class=&quot;comment-count&quot;&gt;%3$s&lt;/span&gt;&lt;/a&gt;', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
</ins><span class="cx"> 
</span><span class="cx">                 // $item is not the root activity (it is probably an activity_comment).
</span><span class="cx">                 } else {
</span><span class="cx">                         $comment_count = count( BP_Activity_Activity::get_child_comments( $item['id'] ) );
</span><span class="cx"> 
</span><del>-                        /// If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
</del><ins>+                        // If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
</ins><span class="cx">                         if ( 0 == $comment_count ) {
</span><span class="cx">                                 echo '&lt;br /&gt;';
</span><span class="cx"> 
</span><span class="cx">                         } else {
</span><ins>+                                $comment_count = number_format_i18n( $comment_count );
+                                $title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
+
</ins><span class="cx">                                 // Display a link to the root activity's permalink, with the current activity's (child) comment count in a speech bubble
</span><del>-                                printf( '&lt;br /&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; class=&quot;post-com-count&quot;&gt;&lt;span class=&quot;comment-count&quot;&gt;%3$d&lt;/span&gt;&lt;/a&gt;',  network_admin_url( 'admin.php?page=bp-activity&amp;amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
</del><ins>+                                printf( '&lt;br /&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; class=&quot;post-com-count&quot;&gt;&lt;span class=&quot;comment-count&quot;&gt;%3$s&lt;/span&gt;&lt;/a&gt;', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>