In my web site timeline, I want to just append new update after a time interval like facebook timeline. So I read about many article about comet, long poll, web socket etc here and many where in web. But I can understand how to implement any script to append new update only without refresh page or any div.
I have not enough knowledge about jQuery, Javascript. But I already solved many more problem with Stackoverflow's help. So please help me to do it as a newbie.
You can also say me to give some working example that not work. But I cannot understand how and what to do.
Here I give my timeline and wall related all script.
My comment.php
function getComments($userwallid){
$results = mysqli_query($dbh,"SELECT * FROM comments_lite WHERE qazi_id='$userwallid' ORDER BY id DESC LIMIT 20") or die(mysqli_error($dbh));
echo '<div class="comments"><div id="updates">';
while($rows = mysqli_fetch_assoc($results)) {
$id = $rows['id'];
$uesrpage_id = $rows['userpage_id'];
$likes = $rows['likes'];
$username = $rows['username'];
$description = $rows['description'];
$date = $rows['date'];
// etc all..
echo'<div class="case postcom'.$id.'"><div class="comment">
<div class="cdomment_cheder">
<div class="avatarcnt">
<img alt="" src="uploadprofile/'.$u_imgurl.'"/></div><div class="newkochi">';
if ($url=="") {
echo'<p class="name">'.$username.' Says:</p>'; }
else echo'<p class="name"><a href="'.$url.'" title="'.$username.'">'.$username.'</a> Says:</p>';
echo'<span class="cdomment_time">'.$date.'</span>
<div class="cdomment_text">';
if ($description=="") {echo '';}
else echo''.nl2br(smileys($description)).'<br>';
if ($img=="") {echo '';}
else echo'<br><img src="comimage/'.$img.'" />';
echo '</div>';
//delete button
//Likes button
echo'</div></div></div></div>';
//Reply script goes here...
echo 'same as aove';
}
Timeline page
<div class="timelineupdate">
<?php
include_once('comment.php');
getComments("$uesrid");
?>
</div>