• 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.

Share mod đánh giá cho johncms fix lại

Admin

Well-Known Member
Staff member
Administrator
Vào phpmyadmin run jquery này
ALTER TABLE `forum` ADD `like` int(11) not null default '0';
ALTER TABLE `forum` ADD `dislike` int(11) not null default '0';

Sau đó mở /forum/index.php
Dán vào chỗ muốn hiển thị

echo '<div class="cmt"><b>Đánh Giá:</b>';
if(!isset($_SESSION['rate-'.$id])) echo '(<a href="index.php?act=like&amp;id=' . $id . '"><img src="/images/like.png" alt="Hay"></a> <font color="green">'.$type1['like'].'</font> - <a href="index.php?act=like&amp;id=' . $id . '&amp;dis"><img src="/images/dis.png" alt="Không Hay"></a> <font color="red">'.$type1['dislike'].'</font>) ';
echo '<font color="green">'.$type1['like'].'</font> / <font color="red">'.$type1['dislike'].'</font><br />';
echo '</div>';

Tiếp theo bạn mở /incfiles/classes/core.php dán mã

function likeimg($n,$x=false){
$n=$n*10;
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); }
}}

Bạn tải file ở dưới rồi giải nén ra file like.php upload vào thư mục
forum/includes

Sau đó vào /forum/index.php
Tìm

'addfile',

Thêm vào dưới

 

Facebook Comments

New posts New threads New resources

Back
Top