Ticket #2958: 2958.diff
| File 2958.diff, 5.3 KB (added by , 10 years ago) |
|---|
-
src/includes/common/functions.php
416 416 * Get the forum statistics 417 417 * 418 418 * @since 2.0.0 bbPress (r2769) 419 * @since 2.6.0 bbPress (rXXXX) Introduced the `count_pending_topics` and 420 * `count_pending_replies` arguments. 419 421 * 420 422 * @param array $args Optional. The function supports these arguments (all 421 423 * default to true): … … 423 425 * - count_forums: Count forums? 424 426 * - count_topics: Count topics? If set to false, private, spammed and trashed 425 427 * topics are also not counted. 428 * - count_pending_topics: Count pending topics? (only counted if the current 429 * user has edit_others_topics cap) 426 430 * - count_private_topics: Count private topics? (only counted if the current 427 431 * user has read_private_topics cap) 428 432 * - count_spammed_topics: Count spammed topics? (only counted if the current … … 431 435 * user has view_trash cap) 432 436 * - count_replies: Count replies? If set to false, private, spammed and 433 437 * trashed replies are also not counted. 438 * - count_pending_replies: Count pending replies? (only counted if the current 439 * user has edit_others_replies cap) 434 440 * - count_private_replies: Count private replies? (only counted if the current 435 441 * user has read_private_replies cap) 436 442 * - count_spammed_replies: Count spammed replies? (only counted if the current … … 457 463 'count_users' => true, 458 464 'count_forums' => true, 459 465 'count_topics' => true, 466 'count_pending_topics' => true, 460 467 'count_private_topics' => true, 461 468 'count_spammed_topics' => true, 462 469 'count_trashed_topics' => true, 463 470 'count_replies' => true, 471 'count_pending_replies' => true, 464 472 'count_private_replies' => true, 465 473 'count_spammed_replies' => true, 466 474 'count_trashed_replies' => true, … … 489 497 } 490 498 491 499 // Post statuses 500 $pending = bbp_get_pending_status_id(); 492 501 $private = bbp_get_private_status_id(); 493 502 $spam = bbp_get_spam_status_id(); 494 503 $trash = bbp_get_trash_status_id(); … … 503 512 504 513 if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) { 505 514 515 // Pending 516 $topics['pending'] = ( ! empty( $r['count_pending_topics'] ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$pending} : 0; 517 506 518 // Private 507 519 $topics['private'] = ( ! empty( $r['count_private_topics'] ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->{$private} : 0; 508 520 … … 513 525 $topics['trashed'] = ( ! empty( $r['count_trashed_topics'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$trash} : 0; 514 526 515 527 // Total hidden (private + spam + trash) 516 $topic_count_hidden = $topics['p rivate'] + $topics['spammed'] + $topics['trashed'];528 $topic_count_hidden = $topics['pending'] + $topics['private'] + $topics['spammed'] + $topics['trashed']; 517 529 518 530 // Generate the hidden topic count's title attribute 531 $topic_titles[] = ! empty( $topics['pending'] ) ? sprintf( __( 'Pending: %s', 'bbpress' ), number_format_i18n( $topics['pending'] ) ) : ''; 519 532 $topic_titles[] = ! empty( $topics['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $topics['private'] ) ) : ''; 520 533 $topic_titles[] = ! empty( $topics['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $topics['spammed'] ) ) : ''; 521 534 $topic_titles[] = ! empty( $topics['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $topics['trashed'] ) ) : ''; … … 535 548 536 549 if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) { 537 550 551 // Pending 552 $replies['pending'] = ( ! empty( $r['count_pending_replies'] ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$pending} : 0; 553 538 554 // Private 539 555 $replies['private'] = ( ! empty( $r['count_private_replies'] ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->{$private} : 0; 540 556 … … 545 561 $replies['trashed'] = ( ! empty( $r['count_trashed_replies'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$trash} : 0; 546 562 547 563 // Total hidden (private + spam + trash) 548 $reply_count_hidden = $replies['p rivate'] + $replies['spammed'] + $replies['trashed'];564 $reply_count_hidden = $replies['pending'] + $replies['private'] + $replies['spammed'] + $replies['trashed']; 549 565 550 566 // Generate the hidden topic count's title attribute 567 $reply_titles[] = ! empty( $replies['pending'] ) ? sprintf( __( 'Pending: %s', 'bbpress' ), number_format_i18n( $replies['pending'] ) ) : ''; 551 568 $reply_titles[] = ! empty( $replies['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $replies['private'] ) ) : ''; 552 569 $reply_titles[] = ! empty( $replies['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $replies['spammed'] ) ) : ''; 553 570 $reply_titles[] = ! empty( $replies['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $replies['trashed'] ) ) : '';
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)