Yorumları Beğen , beğenme olayları php ve jquery –Like ,unlike


İndirme linki [dm]107[/dm]
php , mysql ve jquery kullanarak Yorumları Beğen , beğenme olayları üzerine bir çalışma yaptım


php include_once ('lib/class.ez_sql_core.php'); include_once ('lib/class.ez_sql_mysql.php'); require_once ('connect.php'); include 'lib/class.kgPager.ajax.php'; $vid_id=1; $total_records = $db--->get_var("SELECT count(vcom.id) from comments as vcom, comments_likes as vcomlike where vcom.status_=1 and vcomlike.comment_id=vcom.id ");
$kgPagerOBJ = & new kgPager();
$scroll_page = 10; // paging
$per_page = 3; // page total
$git_sayfa = 'ajax_video_yorumlar.php';
$current_page = $_GET['page'];
$pager_url = 1;// $id;
$inactive_page_tag = 'class="current_page"';
$previous_page_text = '$next_page_text = 'Sonraki Sayfa >';
$first_page_text = '$last_page_text = '>>';
$pager_url_last = 1;//$id;
$kgPagerOBJ->pager_set($pager_url, $total_records, $scroll_page, $per_page, $current_page, $inactive_page_tag, $previous_page_text, $next_page_text, $first_page_text, $last_page_text, $pager_url_last, $git_sayfa);

$first_page = $kgPagerOBJ->first_page;
$previous_page = $kgPagerOBJ->previous_page;
$page_links = $kgPagerOBJ->page_links;
$next_page = $kgPagerOBJ->next_page;
$last_page = $kgPagerOBJ->last_page;
echo 'toplam yorum: '.$total_records;

?>


<!--?php

echo '

';

echo $first_page;
echo $previous_page;
echo $page_links;
echo $next_page;
echo $last_page;

echo '

';

//yorumlar

/* $sql = "SELECT id,name_surname,comments,add_date from vimhub_video_comments
where status_=1 and video_id=1 limit ".$kgPagerOBJ->start.", ".$kgPagerOBJ->per_page; */

/*

echo $sql = "SELECT vcomlike.id as comlike_id, vcom.name_surname,vcom.comments,vcom.add_date,likes,unlikes
from vimhub_video_comments as vcom, vimhub_video_comments_likes as vcomlike where vcom.status_=1 and
vcom.video_id=".$vid_id." and vcom.video_id=vcomlike.video_id and vcomlike.comment_id=vcom.id limit ".$kgPagerOBJ->start.", ".$kgPagerOBJ->per_page;

*/
$sql = "SELECT vcomlike.id as comlike_id, vcom.name_surname,vcom.comments,vcom.add_date,likes,unlikes
from comments as vcom, comments_likes as vcomlike where vcom.status_=1 and vcomlike.comment_id=vcom.id limit ".$kgPagerOBJ->start.", ".$kgPagerOBJ->per_page;
$comments = $db->get_results($sql, ARRAY_A);
if ($comments != '') {
foreach ($comments as $comment) {
$com_id = $comment['comlike_id'];
$com_like = $comment['likes'];
$com_unlike = $comment['unlikes'];
$ad = $comment['name_surname'];

$zaman_once = $comment['add_date'];
$yorum = $comment['comments'];

?>