#2542 closed defect (bug) (wontfix)
activity-meta in entry.php needs is_user_logged_in() around whole div...
Reported by: | 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)
Change History (4)
#1
@
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;}
showing problem div element...