• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Admin

Well-Known Member
Staff member
Administrator
Vào phpmyadmin run query
PHP:
ALTER TABLE `forum` ADD `likes` int(11) not null default '0';
ALTER TABLE `forum` ADD `like` int(11) not null default '0';
ALTER TABLE `forum` ADD `dislike` int(11) not null default '0';
Tìm trong forum/index.php đoạn
PHP:
'tema',
    'users'
Thay thế bằng
PHP:
'tema',
    'users',
    'likes',
    'like',
    'dislike',
Tìm trong file forum/index.php
PHP:
  if ($res['kedit']) {
Thêm vào bên trên hoặc chổ nào tùy í trong phạm vi khu vực hiển thị nội dung bài viết
PHP:
if ($i == 1) {
if(!isset($_SESSION['rate-'.$id]))
echo '
<div class="bv">Đánh giá : <b><a href="/forum/index.php?act=like&amp;id=' . $id . '"  style="color:red;">Tốt</a></b>  - <b><a href="/forum/index.php?act=like&amp;id=' . $id . '&amp;dis"  style="color:blue;">Kém</a></b>  </div> ';
 
echo '<div class="list1" style="text-align:center;">';
 
echo ''.$type1['like'].' Like / '.$type1['dislike'].' Dislike<br/>';
likeview($type1['like'], $type1['dislike']);
echo '<br/>';
 
$like = 50 ;
$lkie1 = $like + $type1 [ 'like' ] - $type1 [ 'dislike' ];
$like1 = $type1 [ 'like' ] + $type1 [ 'dislike' ];
likeview2($type1['like'], $type1['dislike']);
echo '' . $diemlike . '/100 -
';
echo '' . $like1 . ' phiếu</div>
';
}
Tìm
PHP:
function nav
Trong incfiles/core.php và thêm bên trên là
PHP:
function likeimg($n,$x=false){
$n = $n*20;
if($x){
$n = $n-5;
 
echo '<img src="/images/star/'.$n.'.png" alt="Đánh giá '.$n.' %" title="Đánh giá '.$n.' %"/>';
} else {
echo '<img src="/images/star/'.$n.'.png" alt="Đánh giá '.$n.' %" title="Đánh giá '.$n.' %" />';
}
}
function likeview($like,$unlike){
if($like==0 and $unlike==0){ likeimg(5); } else {
$tong=$like+$unlike;
$thich=($like/$tong)*100;
if($thich >= 100){ likeimg(5);}
elseif($thich >= 90){ likeimg(5,true);}
elseif($thich >= 80){ likeimg(4);}
elseif($thich >= 70){ likeimg(3,true);}
elseif($thich >= 60){ likeimg(3);}
elseif($thich >= 50){ likeimg(3,true);}
elseif($thich >= 40){ likeimg(2);}
elseif($thich >= 30){ likeimg(2,true);}
elseif($thich >= 20){ likeimg(1);}
elseif($thich >= 10){ likeimg(1,true);}
elseif($thich == 0){ likeimg(1); }
}}
Up 3 file like.php, likes.php, dislike.php vào /forum/includes
Upload tuoitreit.vn_star.zip vào /images rồi giải nén
Xong.
Download file tuoitreit.vn_star.zip - UpFile.vn
Download file tuoitreit.vn_modlike.zip - UpFile.vn
Nguồn: VNH
 

Facebook Comments

New posts New threads New resources

Back
Top