Making WordPress.org


Ignore:
Timestamp:
01/09/2019 06:03:27 AM (6 years ago)
Author:
dd32
Message:

Forums: Remove the 'Forum Info' sidebar section.

This was previously mostly commented out, but was still displaying the 'Last Activity' which was often out of date due to caching.

Props Clorith for original patch, dd32.
Fixes #2109.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r7966 r8058  
    782782function bb_base_single_forum_description() {
    783783
    784     // Validate forum_id
    785     $forum_id = bbp_get_forum_id();
    786 
    787784    // Unhook the 'view all' query var adder
    788785    remove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
    789786
    790     // Get some forum data
    791     $topic_count = bbp_get_forum_topic_count( $forum_id, true, true );
    792     $reply_count = bbp_get_forum_reply_count( $forum_id, true, true );
    793     $last_active = bbp_get_forum_last_active_id( $forum_id );
    794 
    795     // Has replies
    796     if ( !empty( $reply_count ) ) {
    797         $reply_text = sprintf( _n( '%s reply', '%s replies', $reply_count, 'wporg-forums' ), bbp_number_format( $reply_count ) );
    798     } else {
    799         $reply_text = '';
    800     }
    801 
    802     // Forum has active data
    803     if ( !empty( $last_active ) ) {
    804         $topic_text      = bbp_get_forum_topics_link( $forum_id );
    805         $time_since      = bbp_get_forum_freshness_link( $forum_id );
    806 
    807     // Forum has no last active data
    808     } else {
    809         $topic_text      = sprintf( _n( '%s topic', '%s topics', $topic_count, 'wporg-forums' ), bbp_number_format( $topic_count ) );
    810     }
    811     ?>
    812 
    813     <?php if ( bbp_get_forum_parent_id() ) : ?>
     787    if ( bbp_get_forum_parent_id() ) : ?>
    814788        <li class="topic-parent"><?php
    815789            /* translators: %s: forum title */
     
    821795            );
    822796        ?></li>
    823     <?php endif; ?>
    824     <?php //if ( !empty( $topic_count ) ) : ?>
    825         <!-- <li class="topic-count"><?php echo $topic_text; ?></li> -->
    826     <?php //endif; ?>
    827     <?php //if ( !empty( $reply_count ) ) : ?>
    828         <!-- <li class="reply-count"><?php echo $reply_text; ?></li> -->
    829     <?php //endif; ?>
    830     <?php //if ( !empty( $last_active  ) ) : ?>
    831         <!-- <li class="forum-freshness-author"> --><?php
    832             /* translators: %s: post author link */
    833             //printf( __( 'Last post by: %s', 'wporg-forums' ),
    834             //  bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_active ) )
    835             //);
    836         ?><!-- </li> -->
    837     <?php //endif; ?>
    838     <?php if ( !empty( $time_since  ) ) : ?>
    839         <li class="forum-freshness-time"><?php
    840             /* translators: %s: date/time link to the latest post */
    841             printf( __( 'Last activity: %s', 'wporg-forums' ), $time_since );
    842         ?></li>
    843797    <?php endif;
    844798}
Note: See TracChangeset for help on using the changeset viewer.