<?php
/**
 * This template is used by activity-loop.php and AJAX functions to show each activity
 */

global $wpdb, $bp, $activities_template;

do_action( 'bp_before_activity_entry' );

/**
 * Calculate mood bar color
**/
$class        = calculate_moodbar( bp_get_activity_user_id() );
$class_reply  = calculate_moodbar( get_current_user_id() );

/**
 * Obtener metas de un activity
 */
$post_mood  = '';
$privacity  = '';
$imagen     = '';
$enlace     = '';
$table_name = $wpdb->prefix . "bp_activity_meta";
$query      = "SELECT * FROM ".$table_name." WHERE activity_id = ". bp_get_activity_id() . " order by meta_key DESC";
$results    = $wpdb->get_results( $query );

foreach ($results as $activity_meta) {

    if ($activity_meta->meta_key == "privacity") {
        $privacity    = $activity_meta->meta_value;
    } elseif ($activity_meta->meta_key == "orig_mood") {
        $post_mood    = $activity_meta->meta_value;
    } elseif ($activity_meta->meta_key == "enlace") {
        $enlace       = $activity_meta->meta_value;
    } elseif ($activity_meta->meta_key == "video") {
        $video        = $activity_meta->meta_value;
    } elseif ($activity_meta->meta_key == "imagen") {
        $imagen       = $activity_meta->meta_value;
    } elseif ($activity_meta->meta_key == "iron_post_type") {
        $type         = $activity_meta->meta_value;
    }
}

$userdata  = get_userdata(bp_get_activity_user_id());
$postd     = get_post(bp_get_activity_secondary_item_id());

/**
 * Para saber si es testimonio o pregunta
 **/
$postm     = get_post_meta (bp_get_activity_secondary_item_id(), '_wp_page_type');

/**
 * Cuando son blog posts, el estado se guarda en post_meta
 * Cuando son grupos, cogemos el meta de group_meta
 * Cuando son eventos, cogemos el meta de events_meta
 * Color Estado de Animo con el que se creo
 **/

$classbackground = check_activity_estado( bp_get_activity_type(), $post_mood );

$actclass    = 'activity-content';
$actclass2   = '';

/**
 * comprueba si es un elemento sin background
 * relacion de amistad, pregunta/testimonio, crear evento/grupo, achievement 
 */
if ( checkTypeActivityClear(bp_get_activity_type()) ) { 
    $addstyle  = 'style="background: #fff;"';
    $actclass  = 'activity-content-2';
    $actclass2 = 'inner-blog-post';
}
?>

<li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>" <?php echo $addstyle; ?>>
    <?php
        /**
         * comprueba si es un elemento que usa un contenedor completo
         * que no sea => relacion de amistad, pregunta/testimonio, crear evento/grupo, achievement
         */
        if ( checkTypeActivityFull(bp_get_activity_type()) ) {
    ?>
        <div class="activity-avatar <?php echo $class; ?>">
            <a href="<?php bp_activity_user_link() ?>" title="<?php echo $userdata->nickname; ?>">
                <?php bp_activity_avatar( 'type=full&width=100&height=100' ); ?>
            </a>
            <?php
            /**
             * Check online icon
             * Checks users last activity and if less than 5 minute have passed, display online icon
            **/
            date_default_timezone_set('Europe/Madrid');
            $online_time = get_user_meta(bp_get_activity_user_id(), 'last_activity');
            $online_time2 = strtotime($online_time[0]) + 300;
            
            if (time() <= $online_time2) {
                echo '<img class="check-online" src="'. get_stylesheet_directory_uri() . '/_inc/images/user_online.png" />';
            }
            ?>
        </div>
    <?php } else { ?>
        <div class="acomment-avatar">
            <a href="<?php bp_activity_user_link() ?>" title="<?php echo $userdata->nickname; ?>">
                <?php $actid = bp_get_activity_user_id(); ?>
                <?php echo bp_core_fetch_avatar( array( 'item_id' => $userdata->ID, 'type' => 'full', 'width' => 24, 'height' => 24 ) ); ?>
            </a>
        </div>
    <?php } ?>
    
    <div class="<?php echo $actclass; ?>">
        <div class="activity-header">
            <?php 
            if ($bp->current_component == 'groups') {
                echo '<p>';
                echo '<a href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a>';
                echo '<span id="mentions">@'. $userdata->user_login .'</span>';
                echo apply_filters( 'bp_activity_time_since', '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded )  . '</span>', &$activities_template->activity );
                echo apply_filters( 'bp_activity_permalink', ' &middot; <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '">' . __( 'View', 'buddypress' ) . '</a>', &$activities_template->activity );
                echo apply_filters( 'bp_activity_delete_link', ' &middot; ' . bp_get_activity_delete_link(), &$activities_template->activity );
                //echo '</p>'; 
            } elseif (
                        bp_get_activity_type() == 'friendship_created' ||
                        bp_get_activity_type() == 'new_blog_post'      ||
                        bp_get_activity_type() == 'created_group'      ||
                        bp_get_activity_type() == 'created_event'
                    ) {
            // Si es un post de blog
                echo '<p>';
                
                if (bp_get_activity_type() == 'new_blog_post') {
                    $who = '<a href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a> <span id="mentions">@'. $userdata->user_login .'</span>';
                    
                    if ($postm[0] == 'pregunta') {
                        
                        echo sprintf( __('%s lanza una %s','buddypress') , $who , '<a href="'. site_url().'/questions" title="' . __( "pregunta","buddypress" ) . '">' . __( "pregunta","buddypress" ) . '</a>');
                    
                    } elseif ($postm[0] == 'testimonio') {
                        
                        echo sprintf(__('%s ha publicado un %s','buddypress'), $who , '<a href="'. site_url().'/miembros/' . $userdata->user_login . '/testimonies" title="' . __( "testimonio","buddypress" ) . '">' . __( "testimonio","buddypress" ) . '</a>');
                    
                    }
                } elseif (bp_get_activity_type() == 'created_event') {
                    
                    echo sprintf( __("%s ha creado un %s",'buddypress'), '<a href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a> <span id="mentions">@'. $userdata->user_login .'</span>', '<a href="'. site_url() .'/eventos/" title="Eventos">'.__("evento","buddypress").'</a>');
                
                } elseif (bp_get_activity_type() == 'created_group') {

                    //echo '<a href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a>';
                    echo sprintf( __ ("%s ha creado un %s",'buddypress') , '<a href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a> <span id="mentions">@'. $userdata->user_login .'</span>', '<a href="'. site_url() .'/grupos/" title="'.__("Grupos","buddypress") . '">'.__("grupo","buddypress"). '</a>');
                
                } elseif (bp_get_activity_type() == 'friendship_created') {

                    $userdata2 = get_userdata(bp_get_activity_secondary_item_id());

                    echo '<a style="float: left;" href="'. $userdata->user_url .'" title="'. $userdata->nickname.'">'. $userdata->nickname .'</a>';
                    echo '<span id="mentions">@'. $userdata->user_login .'</span>';
                    echo '<span style="float: left; margin-left: 4px; padding: 0px;">';
                    _e('y','buddypress');
                    echo '</span>';
                    echo '<a href="'. $userdata2->user_url .'" title="'. $userdata2->nickname.'"> <span id="mentions">@'. $userdata2->user_login .'</span>';
                    echo bp_core_fetch_avatar( array( 'item_id' => $userdata2->ID, 'type' => 'full', 'width' => 24, 'height' => 24 ) );
                    echo '</a>';

                    echo '<a style="float: left; margin-left: 10px;" href="'. $userdata2->user_url .'" title="'. $userdata2->nickname.'">'. $userdata2->nickname .'</a> <span id="mentions">@'. $userdata2->user_login .'</span>';
                    echo '<span style="float: left;">&nbsp;';
                    _e('son ahora amigos','buddypress');
                    echo'</span>';
                }

                echo apply_filters( 'bp_activity_time_since', '<span class="time-since">' . sprintf( __( '&nbsp; %s ago', 'buddypress' ), bp_core_time_since( $activities_template->activity->date_recorded ) ) . '</span>', &$activities_template->activity );
                echo apply_filters( 'bp_activity_permalink', ' &middot; <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '">' . __( 'View', 'buddypress' ) . '</a>', &$activities_template->activity );
                
                if ( bp_get_activity_user_id() == get_current_user_id() ) {
                    
                    //echo apply_filters( 'bp_activity_delete_link', ' &middot; ' . bp_get_activity_delete_link(), &$activities_template->activity );
                    
                }
                
            } else {
                
                if ( bp_get_activity_type() == 'activity_update' ) {
                    
                    if ( strpos(bp_get_activity_action(),'postedgroup') ) {
                        echo do_shortcode(bp_get_activity_action(), 'postedgroupDo');
                    } else {
                        echo do_shortcode(bp_get_activity_action(), 'postedpublish');
                    }
                } 
                
                /**
                 * Achievements Conetados
                 **/
                if ( bp_get_activity_type() == 'new_achievement' ) {
                    
                    if (!function_exists('achievementDo')) {
                    
                        function achievementDo($attr) {
                            
                            global $wpdb;
                            
                            $hito = new DPA_Achievement( array( 'id' => $attr['itemid'], 'populate_extras' => false ) );
                            
                            $permalink = get_option('home') . '/achievements/' . $hito->slug ;
                            
                            if ($_COOKIE['LANG'] == 'es') {
                                $name = $hito->name;
                            } else {
                                $lang = 'name_'.$_COOKIE['LANG'];
                                $name = $hito->$lang;
                            }
                            $id_img_hito = $wpdb->get_row('select picture_id from wp_achievements where id = '.$attr['itemid']); 
                            
                            $muro = sprintf( __( '<span>%1$s ha obtenido %2$s</span>', 'buddypress' ),
                                               bp_core_get_userlink( $attr['userid'] ) . '<span id="mentions">@'. get_userdata( $attr['userid'] )->user_login .'</span>',
                                               '<a href="' . $permalink . '">' . dpa_get_achievement_picture( 'activitystream', $id_img_hito->picture_id ) . '</a><a href="' . $permalink . '">' . $name . '</a>'
                                           );
                            //dpa_get_achievement_picture_id()
                            
                            return $muro;
                        }
                        add_shortcode('achievement', 'achievementDo');
                    }
                    
                    echo do_shortcode(bp_get_activity_action(), 'achievementDo');
                    
                    //echo str_replace(' ha obtenido ',' ' .__( ' obtained ','buddypress' ) . ' ',bp_get_activity_action());
                }
            }
            
            if (($userdata->ID == wp_get_current_user()->ID or is_admin() or current_user_can('administrator')) and $bp->current_component != 'groups') {
                echo apply_filters( 'bp_activity_delete_link', ' ' . bp_get_activity_delete_link(), &$activities_template->activity );
                
            }
            echo '</p>';
            ?>
        </div>
        
        <?php
            if ( bp_activity_has_content() ) :
            ?>
                
                <div class="activity-inner <?php echo $actclass2; if (bp_get_activity_type()!='new_blog_post') echo $classbackground; ?>">
                
                <?php
                // Para la pestanita de estado de animo calculado 
                if ( bp_get_activity_type() == 'activity_update') {
                    
                    /**
                     * se saca el triangulo de la parte superior izquierda.
                     */
                    $class_current_state = calculateStatePost(
                                                                bp_get_activity_id(),
                                                                $classbackground,
                                                                xprofile_get_field_data( 'EstadoAnimo',$userdata->ID),
                                                                bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' )
                                                            );
                    
                    ?>
                    <div class="activity_calc_state " <?php echo $class_current_state;?>></div>
                <?php } 
                
                $conte = $conte2 = $act_content =  $ContectClear = "";
                
                    if ( bp_get_activity_type() == 'new_blog_post') {
                        echo '<a class="new_blog_post_title '.$classbackground.' iron-post" href="'. $postd->guid.'" title="'.$postd->post_title.'">'. $postd->post_title .'</a>';
                    } else {
                        // Si no estamos en el Hilo en concreto limitamos el texto mostrado
                        if (
                            !$bp->current_action             ||
                            $bp->current_action  == 'just-me' ||
                            $bp->current_action  == 'home'
                            ) {
                            
                            echo contenidoMuroCorto($activities_template->activity->content);
                            
                        } else {
                            
                            echo contenidoMuroCompleto(bp_get_activity_content_body());
                        }
                        
                        // Obtener metas de un activity
                        $imagen = '';
                        $enlace= '';
                        $table_name  = $wpdb->prefix . "bp_activity_meta";
                        $results     = $wpdb->get_results( "SELECT * FROM ".$table_name." WHERE activity_id = ". bp_get_activity_id());
                        
                        foreach ($results as $activity_meta) {
                            if ($activity_meta->meta_key == "privacity") {
                                $privacity = $activity_meta->meta_value;
                            } elseif ($activity_meta->meta_key == "current_mood") {
                                $post_mood = $activity_meta->meta_value;
                            } elseif ($activity_meta->meta_key == "video") {
                                $video     = $activity_meta->meta_value;
                            } elseif ($activity_meta->meta_key == "imagen") {
                                $imagen    = $activity_meta->meta_value;
                            } elseif ($activity_meta->meta_key == "enlace") {
                                $enlace    = $activity_meta->meta_value;
                                $link      = $activity_meta->meta_value;
                            } elseif ($activity_meta->meta_key == "iron_post_type") {
                                $type      = $activity_meta->meta_value;
                            }
                        }
                        
                        
                        if ($enlace != '') {
                            echo '<br />' . check_enlaceActivity( $enlace );
                        }
                        
                        // Random para evitar cacheo de imagenes
                        $rnd = rand(13452,23567);
                        
                        // Mostrar la imagen
                        if ( $type=='image' or $imagen != 'http://' && $imagen != '' ) {
                            echo '<br /><a class="fancybox-activity-images" href="'.site_url() . '/wp-content/uploads/activity/'.bp_get_activity_user_id() .'/full_'. $imagen.'">';
                            echo '<img src="'.site_url() . '/wp-content/uploads/activity/'.bp_get_activity_user_id() .'/'. $imagen.'" />';
                            echo '</a>';
                        }
                        
                        // Si es privado se muestra un candado
                        if ($privacity == "privado") {
                            echo '<img style="float: left; padding-top: 6px;" src="'. get_stylesheet_directory_uri().'/_inc/images/closed.png" title="' . __( 'Post Privado','buddypress' ) . '" alt="Post Privado" />';
                            echo '<p style="margin-top: 12px; margin-left: 16px; font-size: 10px; color: #666;">';
                            _e('Este post es privado y s&oacute;lo t&uacute; puedes verlo.','buddypress');
                            echo '</p>';
                        }
                    }
                ?>
                </div><!-- inner -->
        
        <?php
        /**
         * Cuando no tiene contenido es una solicitud de amistad, creacion de evento, grupo, etc.
         */
          
        else :
                
                if ( bp_get_activity_type() == 'created_event' ) {
                    
                    $evdata = events_get_event( array ( 'event_id'=>bp_get_activity_item_id() ) );
                    echo '<div class="activity-inner inner-blog-post">';
                    echo '<a class="new_event_title '.$classbackground.'" href="'. site_url() . '/eventos/?view='.$evdata->slug.'" title="'.$evdata->name.'">'. $evdata->name .'</a>';
                    echo '</div>';
                    
                } elseif ( bp_get_activity_type() == 'created_group' ) {
                    
                    $grdata = groups_get_group( array ( 'group_id'=>bp_get_activity_item_id() ) );
                    echo '<div class="activity-inner inner-blog-post">';
                    echo '<a class="new_group_title '.$classbackground.'" href="'. site_url() . '/grupos/'.$grdata->slug.'" title="'.$grdata->name.'">'. $grdata->name .'</a>';
                    echo '</div>';
                    
                }
                /*
                elseif ( bp_get_activity_type() == 'new_achievement' ) {
                    $achievement_id=bp_get_activity_item_id();
                    // Select de hito
                    echo '<div class="activity-inner inner-blog-post">';
                    echo '<a class="new_achievement_title '.$classbackground.'" href="'. site_url() . '/achievements/'.$grdata->slug.'" title="'.$grdata->name.'">Nombre del hito</a>';
                    echo '</div>';
                }
                */
                
        
        endif;
        
        do_action( 'bp_activity_entry_content' );
        
        // Chek if the user is member of the group if in a group
        // is_numeric (current_action) es para los activity permalink (ver)
        $ismember = 0;
        if (
                (
                    bp_get_activity_item_id() &&
                    bp_get_activity_type() == 'activity_update'
                ) ||
                $bp->current_component == 'groups'  ||
                $sc == 'groups'                     ||
                (
                    is_numeric($bp->current_action) &&
                    bp_get_activity_item_id()
                )
            ) {
            $ismember = groups_is_user_member(bp_loggedin_user_id(), bp_get_activity_item_id());
            //$ismember = groups_is_user_member(bp_loggedin_user_id(), bp_get_group_id());
        } elseif (
                    bp_get_activity_type() == 'new_blog_post'       ||
                    bp_get_activity_type() == 'friendship_created'  ||
                    bp_get_activity_type() == 'new_achievement'     ||
                    bp_get_activity_type() == 'created_group'       ||
                    bp_get_activity_type() == 'created_event'       ||
                    xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) == 'Privado'
                 ) {
            // Si es un post de blog no dejamos responder, ni favoritos ni nada
            $ismember=0;
        } else {
            $ismember=1;
        }

        if ( is_user_logged_in() && $ismember==1 && bp_get_activity_type() != 'new_achievement' && bp_get_activity_type() != 'friendship_created') { ?>

        <div class="activity-meta <?php echo $classbackground; ?>">
            <?php if ( is_user_logged_in() && bp_activity_can_comment() ) { ?>
                <?php /*
                <a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Respuestas', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
                */
                ?>
                <a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Responder', 'buddypress' ) ?></a>
            <?php } ?>

            <?php // ME GUSTA ?>

            <?php if ( is_user_logged_in() ) { ?>

                    <?php
                    $my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
                    
                    if ( !bp_get_activity_is_favorite() ) { ?>
    
                        <a style="margin-left: 0px; margin-right: 4px;" href="<?php bp_activity_favorite_link() ?>" class="fav" id="<?php echo bp_get_activity_id(); ?>"><?php _e( 'Me gusta', 'buddypress' ) ?></a>
                        <?php if ($my_fav_count>0) { ?>
                            <span id="me-gusta-count-<?php echo bp_get_activity_id(); ?>" rel="<?php echo get_stylesheet_directory_uri() ?>/_inc/tips.php?id=<?php echo bp_get_activity_id(); ?>&act=fav" class="cluetip fav-count" style="margin-left: -4px;">(<?php echo $my_fav_count; ?>)</span>
                        <?php } else { ?>
                            <span id="me-gusta-count-<?php echo bp_get_activity_id(); ?>" rel="<?php echo get_stylesheet_directory_uri() ?>/_inc/tips.php?id=<?php echo bp_get_activity_id(); ?>&act=fav" class="cluetip fav-count" style="margin-left: -4px;">(0)</span>
                        <?php } 
                    } else { ?>
                        <a style="margin-left: 4px; margin-right: 0px;" href="<?php bp_activity_unfavorite_link() ?>" class="unfav" id="<?php echo bp_get_activity_id(); ?>"><?php _e( 'Ya no me gusta', 'buddypress' ) ?></a>
                        <?php if ($my_fav_count>0) { ?>
                            <span id="me-gusta-count-<?php echo bp_get_activity_id(); ?>" rel="<?php echo get_stylesheet_directory_uri() ?>/_inc/tips.php?id=<?php echo bp_get_activity_id(); ?>&act=fav" class="cluetip fav-count">(<?php echo $my_fav_count; ?>)</span>
                        <?php } 
                     } 
                } ?>

            <?php // FIN ME GUSTA ?>

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

        <?php } else { ?>

                <?php if (
                            bp_get_activity_type() != 'activity_comment'    &&
                            bp_get_activity_type() != 'new_achievement'     &&
                            bp_get_activity_type() != 'friendship_created'  &&
                            (
                                $bp->current_component == 'groups'  ||
                                $sc == 'groups'                     ||
                                (
                                    is_numeric($bp->current_action) &&
                                    bp_get_activity_item_id()
                                )
                            )
                        ) { ?>
                        <div class="activity-meta <?php echo $classbackground; ?>" style="font-size: 8px; color: #888;">
                        <?php _e('Debes unirte al grupo para responder.','buddypress'); ?>
                        </div>
                <?php
                    } elseif (!is_user_logged_in()) { ?>
                        <div class="activity-meta <?php echo $classbackground; ?>" style="font-size: 8px; color: #888;">
                            <?php _e('Debes registrarte para responder.','buddypress'); ?>
                        </div>
            <?php  } ?>

        <?php } ?>
    </div>

    <?php if ( 'activity_comment' == bp_get_activity_type() ) { ?>
        <div class="activity-inreplyto">
            <strong><?php _e( 'En respuesta a', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> &middot;
            <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'Ver', 'buddypress' ) ?>"><?php _e( 'Ver', 'buddypress' ) ?></a>
        </div>
    <?php } ?>

    <?php do_action( 'bp_before_activity_entry_comments' ) ?>

    <?php if ( bp_activity_can_comment() && bp_get_activity_type() != 'new_achievement' && bp_get_activity_type() != 'friendship_created' ) { ?>
        <?php /* <div class="activity-comments <?php echo $classbackground; ?>"> */ ?>
        <div class="activity-comments">

            <?php
            // Funcion custom, dentro de themes/cvp-irontec/functions.php
            new_bp_activity_comments();
            
            // Chek if the user is member of the group if in a group
            $ismember = 0;
            
            if (
                    (
                        bp_get_activity_item_id() && bp_get_activity_type() == 'activity_update'
                    ) ||
                $bp->current_component == 'groups' ||
                $sc == 'groups'                    ||
                    (
                        is_numeric($bp->current_action) &&
                        bp_get_activity_item_id()
                    )
                ) {
                $ismember = groups_is_user_member(bp_loggedin_user_id(), bp_get_activity_item_id());
                //$ismember = groups_is_user_member(bp_loggedin_user_id(), bp_get_group_id());
            } elseif (
                        bp_get_activity_type() == 'friendship_created' ||
                        bp_get_activity_type() == 'new_blog_post'      ||
                        bp_get_activity_type() == 'new_achievement'    ||
                        bp_get_activity_type() == 'created_group'      ||
                        bp_get_activity_type() == 'created_event'      ||
                        xprofile_get_field_data('Privacidad', bp_loggedin_user_id()) == 'Privado'
                      ) {
                // Si es un post de blog no dejamos responder, ni favoritos ni nada
                $ismember=0;
            } else {
                $ismember=1;
            }
            
            if ( is_user_logged_in() && $ismember==1 ) { ?>
            
            <form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form  <?php echo $class_reply; ?>"<?php bp_activity_comment_form_nojs_display() ?>>
                
                <div class="ac-reply-avatar">
                    <?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?>
                </div>
                
                <div class="ac-reply-content">
                    <div class="ac-textarea post-bar-close" style=" width: 282px; ">
                        <textarea style="background:#F7F7F7;" id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea>
                    </div>
                    
                    <input type="submit" name="ac_form_submit" value="<?php _e( 'Responder', 'buddypress' ) ?> &rarr;" />
                    
                    <p class="iron-loading" id="iron-loading" style="float: right; margin-right: 5px;">&nbsp;</p>
                    
                    <input type="hidden" id="comment_form_id" name="comment_form_id" value="<?php bp_activity_id() ?>" />
                </div>
                <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
            </form>
            <?php } ?>
        </div>
    <?php } ?>
    <?php do_action( 'bp_after_activity_entry_comments' ); ?>
</li>

<?php do_action( 'bp_after_activity_entry' ) ?>