Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

Last modified 8 years ago

#2542 closed defect (bug) (wontfix)

activity-meta in entry.php needs is_user_logged_in() around whole div...

Reported by: grimbog's profile grimbog Owned by:
Milestone: 1.2.6 Priority: normal
Severity: Version:
Component: Templates Keywords: activity-meta div is_user_logged_in
Cc:

Description

Hey guys,

Fairly minor thing, but noticed that an empty div element is rendered to the activity entry page when a user is logged out. Usually wouldn't mind, but finding that its styled (by default) with "margin:15px 0 15px 5px;", which is causing quite a gap, and generally wasting space.

I've attached a screenshot with the problem highlighted, and have adapted the code to this in my version, but you might want to alter the template:

<?php if ( is_user_logged_in() ) : ?>
<div class="activity-meta">
	<?php if ( bp_activity_can_comment() ) : ?>
		<a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
	<?php endif; ?>

	<?php if ( !bp_get_activity_is_favorite() ) : ?>
		<a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
	<?php else : ?>
		<a href="<?php bp_activity_unfavorite_link() ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
	<?php endif; ?>
	

	<?php do_action( 'bp_activity_entry_meta' ) ?>
</div>
<?php endif;?>

Attachments (1)

blah.jpg (116.3 KB) - added by grimbog 14 years ago.
showing problem div element…

Download all attachments as: .zip

Change History (4)

@grimbog
14 years ago

showing problem div element...

#1 @r-a-y
14 years ago

The problem with your suggested fix is some plugins might want their content publically available.

Wrapping a is_user_logged_in() around the activity-meta <div> effectively blocks this functionality.

An easy way to get rid of the activity-meta div if not logged in is using CSS.

div.activity-meta {display:none;}
body.logged-in div.activity-meta {display:block !important;}

#2 @r-a-y
14 years ago

  • Component changed from Core to Theme
  • Milestone changed from 1.2.5 to 1.2.6
  • Resolution set to wontfix
  • Status changed from new to closed

I'm closing this as you can override this in a child theme and for the reason I stated above.

Feel free to reopen though.

#3 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.