<!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">                 '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
</span><span class="cx">         );
</span><span class="cx">
</span><ins>+        $dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : '';
+
</ins><span class="cx">         // Enqueue CSS and JavaScript
</span><del>-        if ( defined( 'SCRIPT_DEBUG' ) && 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 . "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' );
</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 > 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 > 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 > 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 > 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->current_action() && !empty( $_GET['aid'] ) ) {
</span><span class="lines">@@ -331,7 +327,7 @@
</span><span class="cx">                 <?php screen_icon( 'buddypress' ); ?>
</span><span class="cx">                 <h2>
</span><span class="cx">                         <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
</span><del>-                                <?php printf( __( 'Activity (ID #%d)', 'buddypress' ), (int) $_REQUEST['aid'] ); ?>
</del><ins>+                                <?php printf( __( 'Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
</ins><span class="cx">                         <?php else : ?>
</span><span class="cx">                                 <?php _e( 'Activity', 'buddypress' ); ?>
</span><span class="cx">                         <?php endif; ?>
</span><span class="lines">@@ -351,7 +347,7 @@
</span><span class="cx">                 <form id="bp-activities-form" action="" method="get">
</span><span class="cx">                         <?php $bp_activity_list_table->search_box( __( 'Search Activities', 'buddypress' ), 'bp-activity' ); ?>
</span><span class="cx">
</span><del>-                        <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
</del><ins>+                        <input type="hidden" name="page" value="<?php echo esc_attr( (int) $_REQUEST['page'] ); ?>" />
</ins><span class="cx">                         <?php $bp_activity_list_table->display(); ?>
</span><span class="cx">                 </form>
</span><span class="cx">
</span><span class="lines">@@ -593,7 +589,7 @@
</span><span class="cx">         ?>
</span><span class="cx">                 <ul class="subsubsub">
</span><span class="cx">                         <li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
</span><del>-                        <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%d)</span>', 'buddypress' ), $this->spam_count ); ?></a></li>
</del><ins>+                        <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
</ins><span class="cx">                 </ul>
</span><span class="cx">         <?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;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->children ) ? bp_activity_recurse_comment_count( $root_activity ) : 0;
</del><ins>+                        $comment_count = !empty( $root_activity->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( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>', network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
</del><ins>+                        printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $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 '<br />';
</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( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>', network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
</del><ins>+                                printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $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>