<?php
get_header();

$group = explode('/', $_SERVER['REDIRECT_URL']);

if (isset($group[1]) and $group[1] == 'grupos' and isset($group[2])) {
    $privateGroup = $wpdb->get_row('select * from wp_bp_groups where slug = "' . $group[2] . '"');
}

locate_template( array( 'leftsidebar.php' ), true );
?>
    <div id="content">
        <div class="padder">
        
            <div id="content-top"></div>
            <div id="content-middle">
            
                <div id="content-middle-add">
                    <?php
                    do_action( 'bp_before_404' );
                    ?>
                    <div class="page 404">
                        <?php
                        if (isset($privateGroup)) {
                            ?>
                            <h2 class="pagetitle">
                                <?php
                                printf( __( 'El Evento %s es privado', 'buddypress' ), $privateGroup->name );
                                ?>
                            </h2>
                            
                            <div id="message" class="info">
                                <p>
                                <?php _e( 'Para entrar en el, el administrador debe enviarte una invitación.', 'buddypress' ) ?>
                                </p>
                            </div>
                        <?php
                        } else {
                        ?>
                        <h1 class="pagetitle" style="margin: 20px;">
                            <?php _e( 'The content has been deleted by its author.', 'kronikoensarea' ); ?>
                        </h1>
                        <?php
                        }
                        
                    do_action( 'bp_404' );
                    ?>
                    </div><!-- page 404 -->
                    <?php
                    do_action( 'bp_after_404' );
                    ?>
                
                </div> <!-- content-middle-add -->
                
                </div> <!-- content-middle -->
                <div id="content-bottom"></div>
        </div><!-- .padder -->
    </div><!-- #content -->
<?php
locate_template( array( 'sidebar.php' ), true );

get_footer();
?>