Something like this should work for the sidebar:
<?php if( is_user_logged_in() ) : ?>
<div id="second-section" class="widget-section">
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('second-section') ) : ?>
<div class="widget-error">
<?php _e( 'Please log in and add widgets to this section.', 'buddypress' ) ?> <a href="<?php echo get_option('siteurl') ?>/wp-admin/widgets.php?s=&show=&sidebar=second-section"><?php _e( 'Add Widgets', 'buddypress' ) ?></a>
</div>
<?php endif; ?>
</div>
<?php else: ?>
<div id="other_sidebar">
</div>
<?php endif; ?>
also one other question I have is there any way to use roles in the if statement? for instance instead of is_user_logged_in something like is_user_administrator
This is pretty easy for admin. You can use: is_admin() in a conditional structure. I don;t think that there are other functions like this though. You can fine tune using current_user_can(). This function takes one argument which is the name of the capability you are testing for. something like:
if( current_user_can( 'edit_posts' ) ){
/* DO STUFF */
}
or
if( current_user_can( 'level_6' ) ){
/* DO STUFF */
}
more info on roles here:
http://codex.wordpress.org/Roles_and_Capabilities