Changeset 5617
- Timestamp:
- 07/03/2017 10:43:31 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/user-details.php
r5094 r5617 55 55 <a href="<?php bbp_user_profile_url(); ?>reviews/" title="<?php 56 56 /* translators: %s: user's display name */ 57 printf( esc_attr__( "%s's Reviews ", 'wporg-forums' ), bbp_get_displayed_user_field( 'display_name' ) );58 ?>"><?php esc_html_e( 'Reviews ', 'wporg-forums' ); ?></a>57 printf( esc_attr__( "%s's Reviews Written", 'wporg-forums' ), bbp_get_displayed_user_field( 'display_name' ) ); 58 ?>"><?php esc_html_e( 'Reviews Written', 'wporg-forums' ); ?></a> 59 59 </span> 60 60 </li> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/user-profile.php
r5158 r5617 116 116 117 117 <p class="bbp-user-topic-count"><?php 118 $review_count = wporg_support_get_user_review_count(); 119 118 120 /* translators: %s: number of user's topics */ 119 printf( esc_html__( 'Topics Started: %s', 'wporg-forums' ), number_format_i18n( bbp_get_user_topic_count_raw() ) );121 printf( esc_html__( 'Topics Started: %s', 'wporg-forums' ), number_format_i18n( bbp_get_user_topic_count_raw() - $review_count ) ); 120 122 ?></p> 121 123 … … 124 126 printf( esc_html__( 'Replies Created: %s', 'wporg-forums' ), number_format_i18n( bbp_get_user_reply_count_raw() ) ); 125 127 ?></p> 128 129 <p class="bbp-user-review-count"><?php 130 /* translators: %s: number of user's reviews */ 131 printf( esc_html__( 'Reviews Written: %s', 'wporg-forums' ), number_format_i18n( $review_count ) ); 132 ?></p> 126 133 </div> 127 134 </div><!-- #bbp-author-topics-started --> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/user-reviews-written.php
r5616 r5617 2 2 3 3 /** 4 * User Reviews Created4 * User Reviews Written 5 5 * 6 6 * @package bbPress … … 8 8 */ 9 9 10 do_action( 'bbp_template_before_user_ topics_created' ); ?>10 do_action( 'bbp_template_before_user_reviews_written' ); ?> 11 11 12 12 <div id="bbp-user-topics-started" class="bbp-user-topics-started"> 13 <h2 class="entry-title"><?php esc_html_e( 'Reviews ', 'wporg-forums' ); ?></h2>13 <h2 class="entry-title"><?php esc_html_e( 'Reviews Written', 'wporg-forums' ); ?></h2> 14 14 <div class="bbp-user-section"> 15 15 … … 25 25 26 26 <p><?php bbp_is_user_home() 27 ? esc_html_e( 'You have not createdany reviews.', 'wporg-forums' )28 : esc_html_e( 'This user has not createdany reviews.', 'wporg-forums' );27 ? esc_html_e( 'You have not written any reviews.', 'wporg-forums' ) 28 : esc_html_e( 'This user has not written any reviews.', 'wporg-forums' ); 29 29 ?></p> 30 30 … … 34 34 </div><!-- #bbp-user-topics-started --> 35 35 36 <?php do_action( 'bbp_template_after_user_ topics_created' );36 <?php do_action( 'bbp_template_after_user_reviews_written' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r5602 r5617 212 212 /* translators: registration date format, see https://secure.php.net/date */ 213 213 return mysql2date( __( 'F jS, Y', 'wporg-forums' ), $user->user_registered ); 214 } 215 216 /** 217 * Return the raw database count of reviews by a user. 218 * 219 * @global wpdb $wpdb WordPress database abstraction object. 220 * 221 * @param int $user_id User ID to get count for. 222 * @return int Raw DB count of reviews. 223 */ 224 function wporg_support_get_user_review_count( $user_id = 0 ) { 225 global $wpdb; 226 227 $user_id = bbp_get_user_id( $user_id ); 228 if ( empty( $user_id ) ) { 229 return false; 230 } 231 232 if ( ! class_exists( 'WordPressdotorg\Forums\Plugin' ) ) { 233 return false; 234 } 235 236 $count = (int) $wpdb->get_var( $wpdb->prepare( 237 "SELECT COUNT(*) 238 FROM {$wpdb->posts} 239 WHERE post_type = 'topic' 240 AND post_status IN ( 'publish', 'closed' ) 241 AND post_parent = %s 242 AND post_author = %d", 243 WordPressdotorg\Forums\Plugin::REVIEWS_FORUM_ID, 244 $user_id 245 ) ); 246 247 return $count; 214 248 } 215 249
Note: See TracChangeset
for help on using the changeset viewer.