10:46 / 12.08.2015 | #1 |
![]() | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Share Mod đánh giá bài viết cho mã nguồn JohnCMS
Hướng dẫn:
Import data:
''.highlight('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';').''
Mở forum/index.php tìm:
''.highlight(''tema',
'users'').''
Thêm vào phía trên đó
''.highlight(''likes',
'like',
'dislike',').''
Tìm tiếp:
''.highlight('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
''.highlight('if ($i == 1) {
if(!isset($_SESSION['rate-'.$id]))
echo '
Đánh giá : . $id . '\" style=\"color:red;\">Tốt - . $id . '&dis\" style=\"color:blue;\">Kém
';
echo '';
echo ''.$type1['like'].' Like / '.$type1['dislike'].' Dislike
';
likeview($type1['like'], $type1['dislike']);
echo '
';
$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
';
}
').''
Mở incfiles/core.php thêm vào dưới cùng
''.highlight('function likeimg2($n,$x=false){
$n=$n*20;
if($x){
$n=$n-5;
echo ''.$n.'';
} else {
echo ''.$n.'';
}
}
function likeview2($like,$unlike){
if($like==0 and $unlike==0){ likeimg2(5); } else {
$tong=$like+$unlike;
$thich=($like/$tong)*100;
if($thich >= 100){ likeimg2(5);}
elseif($thich >= 90){ likeimg2(5,true);}
elseif($thich >= 80){ likeimg2(4);}
elseif($thich >= 70){ likeimg2(3,true);}
elseif($thich >= 60){ likeimg2(3);}
elseif($thich >= 50){ likeimg2(3,true);}
elseif($thich >= 40){ likeimg2(2);}
elseif($thich >= 30){ likeimg2(2,true);}
elseif($thich >= 20){ likeimg2(1);}
elseif($thich >= 10){ likeimg2(1,true);}
elseif($thich == 0){ likeimg2(1); }
}}
function likeimg($n,$x=false){
$n = $n*20;
if($x){
$n = $n-5;
echo '.$n.'.png\" alt=\"Đánh giá '.$n.' %\" title=\"Đánh giá '.$n.' %\"/>';
} else {
echo '.$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 vào /forum/includes Upfile star lên thư mục images Xong
Hỗ trợ: http://dd.ovigame.mobi
Đã chỉnh sửa. Admin (14:15 / 13.08.2015) [1]
Hướng dẫn:
Import data:
''.highlight('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';').''
Mở forum/index.php tìm:
''.highlight(''tema',
'users'').''
Thêm vào phía trên đó
''.highlight(''likes',
'like',
'dislike',').''
Tìm tiếp:
''.highlight('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
''.highlight('if ($i == 1) {
if(!isset($_SESSION['rate-'.$id]))
echo '
Đánh giá : . $id . '\" style=\"color:red;\">Tốt - . $id . '&dis\" style=\"color:blue;\">Kém
';
echo '';
echo ''.$type1['like'].' Like / '.$type1['dislike'].' Dislike
';
likeview($type1['like'], $type1['dislike']);
echo '
';
$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
';
}
').''
Mở incfiles/core.php thêm vào dưới cùng
''.highlight('function likeimg2($n,$x=false){
$n=$n*20;
if($x){
$n=$n-5;
echo ''.$n.'';
} else {
echo ''.$n.'';
}
}
function likeview2($like,$unlike){
if($like==0 and $unlike==0){ likeimg2(5); } else {
$tong=$like+$unlike;
$thich=($like/$tong)*100;
if($thich >= 100){ likeimg2(5);}
elseif($thich >= 90){ likeimg2(5,true);}
elseif($thich >= 80){ likeimg2(4);}
elseif($thich >= 70){ likeimg2(3,true);}
elseif($thich >= 60){ likeimg2(3);}
elseif($thich >= 50){ likeimg2(3,true);}
elseif($thich >= 40){ likeimg2(2);}
elseif($thich >= 30){ likeimg2(2,true);}
elseif($thich >= 20){ likeimg2(1);}
elseif($thich >= 10){ likeimg2(1,true);}
elseif($thich == 0){ likeimg2(1); }
}}
function likeimg($n,$x=false){
$n = $n*20;
if($x){
$n = $n-5;
echo '.$n.'.png\" alt=\"Đánh giá '.$n.' %\" title=\"Đánh giá '.$n.' %\"/>';
} else {
echo '.$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 vào /forum/includes Upfile star lên thư mục images Xong
Hỗ trợ: http://dd.ovigame.mobi
Đã chỉnh sửa. Admin (14:15 / 13.08.2015) [1]
Bạn cần phải Đăng nhập để có thể tải file
Các thánh hãy cẩn thận
Bạn cần phải Đăng nhập để có thể tham gia bình luận!