<?php get_header() ?>

<?php locate_template( array( 'leftsidebar.php' ), true ) ?>

    <div id="content">
        <div id="iron-encabezado-container">
            <h2 class="iron-encabezado-seccion"><?php echo __('Eventos','buddypress'); ?></h2>

            <ul class="iron-encabezado-ul">
                <?php if (xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) != 'Privado') { ?>
                    <li class="iron-encabezado-li"><a class="fancybox-groups" href="<?php echo bp_get_root_domain() . '/eventos-create/' ?>"><?php _e( 'Crear Evento', 'buddypress' ) ?></a></li>
                <?php } ?>
                <li class="iron-encabezado-li">
                <?php
                    if (xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) != 'Privado') { ?>
                <?php } ?>
                <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if (bp_current_action() == 'my-events') echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain() . 'events/' ?>"><?php printf( __( 'Mis Eventos', 'buddypress' )  ) ?></a></li>
                <li class="iron-encabezado-li">&middot;&nbsp;<a <?php if (bp_current_action() == 'invites') echo 'class="selected"'; ?> href="<?php echo bp_loggedin_user_domain() . 'events/invites/' ?>"><?php _e( 'Invitaciones', 'buddypress' ) ?></a></li>
            </ul>
        </div>
        
        <div class="padder" id="jes-padder">
        
            <div id="content-top"></div>

            <div id="content-middle">
                <div id="item-body">
                    <?php do_action( 'bp_before_member_body' ) ?>
    
                    <div class="item-list-tabs no-ajax" id="subnav">
                        <ul>
                            <?php if ( bp_is_my_profile() ) : ?>
                                <?php bp_get_options_nav() ?>
                            <?php endif; ?>
                    
                            <?php if ( 'invites' != bp_current_action() ) : ?>
                            <li id="events-order-select" class="last filter">
                    
                                <?php _e( 'Order By:', 'buddypress' ) ?>
                                <select id="events-sort-by">        
                                    <option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
                                    <option value="popular"><?php _e( 'Most Members', 'buddypress' ) ?></option>
                                    <option value="newest"><?php _e( 'Newly Created', 'buddypress' ) ?></option>
                                    <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
                                    <option value="soon"><?php _e( 'Soon', 'buddypress' ) ?></option>
                                    
                                    <?php do_action( 'bp_member_event_order_options' ) ?>
                                </select>
                            </li>
                            <?php endif; ?>
                        </ul>
                    </div><!-- .item-list-tabs -->
        
                    <?php if ( 'invites' == bp_current_action() ) : ?>
                        <?php locate_template( array( 'members/single/events/invites.php' ), true ) ?>
                    
                    <?php else : ?>
                    
                        <?php do_action( 'bp_before_member_events_content' ) ?>
                    
                        <div class="events myevents">
                            <?php locate_template( array( 'events/events-loop.php' ), true ) ?>
                        </div>
                    
                        <?php do_action( 'bp_after_member_events_content' ) ?>
                    
                    <?php endif; ?>
    
                    <?php do_action( 'bp_after_event_body' ) ?>
    
                </div><!-- #item-body -->
    
                <?php do_action( 'bp_after_event_home_content' ) ?>
    
                    <!-- Page Generate by Jet Event System for BP , http://milordk.ru Milordk Studio -->
            </div><!-- content-middle -->

            <div id="content-bottom"></div>
            
        </div><!-- .padder -->
    </div><!-- #content -->

    <?php locate_template( array( 'sidebar.php' ), true ) ?>

<?php get_footer() ?>