0
personal I am with the following problem I have a page where you put the comments everything right there loads up to 5 comments so far everything works out what occurs is that in these 5 comments has a button that you click and appears in fadein the field for by reply so far all right, but when I click to show more comments he Ask from another page and those that comes when it is clicked on answer does not work I do not know why.
source code:
javascript
$('.resposta').click(function(){
var id = $(this).children('input').val();
alert(id);
$(this).fadeOut("fast");
$(this).parents('.coment').find('.resp').fadeIn("slow");
$('form[name="responder"]').submit(function(){
return false;
});
return false;
});
php page where already displays the 5 comments
<?php
/*
**********************************************
**********************************************
***********Função para exibição dos***********
****************comentarios*******************
**********************************************/
$comentar = new Read;
$comentar ->ExeRead('coment', 'WHERE video = :video ORDER BY id DESC LIMIT 5', "video={$sei[1]}");
foreach ($comentar->getResult() as $big):
extract($big);
$image = new Read;
$image ->ExeRead('users', 'WHERE id = :id', "id={$big['user']}");
foreach ($image->getResult() as $imx)
extract ($imx);
/*
**********************************************
**********************************************
*********Fim da função de exibição************
***************de comentarios*****************
**********************************************/
echo "<input type='text' hidden='hidden' value='{$link}' id='link'>";
?>
<div class='comentar fl-left'>
<div class='coment com' >
<?php
if($foto == "" || $foto == "uploads/"):
echo "<a href='user?id={$id}'><img class='fl-left' src='".REQUIRE_PATH."/css/boot/icons/thumb.png'></a>";
else:
echo "<a href='user?id={$id}'><img class='fl-left' src='{$imx['foto']}'></a>";
endif;
?>
<p><small class='fontze1'>Comentado por:</small> <?=$nome?> <small>Em: </small> <?=$date?> <small>As: </small> <?=$hora?></p>
<div class="comentando">
<p><?=nl2br($comentario)?></p></div>
<div class='fl-right resposta'>Responder<input type='hidden' value='<?=$big[id] ?>' name='idcoment'>
</div>
<div class=' resp' style='display:none'>
<form method='post'><textarea></textarea>
<input class='btn btn-green' type='submit' value='responder' name='responder'>
</form>
</div>
</div>
<?php
endforeach;
endforeach;
endforeach;
?>
<center><div id='load' class='btn btn-blue btn-full'>Mostar mais comentários</div></center> <div class='clear'></div>
</div>
page where is puchado the show more
<?php
include '../_app/Config.inc.php';
// Função do jquery para listar os comentários
if(filter_input(INPUT_POST, 'acao') == 'comentarios'){
$video = filter_input(INPUT_POST, 'video');
$numcom = filter_input(INPUT_POST, 'numcom');
$readCount = new Read ();
$readCount ->ExeRead('coment', "WHERE video = :video LIMIT $numcom,4", "video={$video}");
echo $readCount->getRowCount();
}
// Função do jquery para exibir mais comentários
if(filter_input(INPUT_POST, 'acao') == 'morecoment'){
$video = filter_input(INPUT_POST, 'video');
$numcom = filter_input(INPUT_POST, 'numcom');
$readCount = new Read ();
$readCount ->FullRead("SELECT * FROM coment WHERE video = :video ORDER BY id DESC LIMIT $numcom,3", "video={$video}" );
foreach ($readCount->getResult() as $cat):
extract($cat);
$image = new Read;
$image ->ExeRead('users', 'WHERE id = :id', "id={$cat['user']}");
foreach ($image->getResult() as $imx):
extract ($imx);
echo "<div class='coment com' style='display:none'>";
if($foto == "" || $foto == "uploads/"):
echo "<a href='user?id={$id}'><img class='fl-left' src='".REQUIRE_PATH."/css/boot/icons/thumb.png'></a>";
else:
echo "<a href='user?id={$id}'><img class='fl-left' src='{$imx['foto']}'></a>";
endif;
?>
<p><small class='fontze1'>Comentado por:</small> <?=$nome?> <small>Em: </small> <?=$date?> <small>As: </small> <?=$hora?></p>
<div class="comentando">
<p><?=nl2br($comentario)?></p></div>
<div class='fl-right resposta'>Responder<input type='hidden' value='<?=$big[id] ?>' name='idcoment'>
</div>
<div class=' resp' style='display:none'>
<form name='responder' method='post'><textarea></textarea>
<input class='btn btn-green' type='button' value='responder' name='responder'>
</form>
</div></div>
<?php
endforeach;
endforeach;
}