Cách Làm:
- Code:
<br>
<!-- BEGIN switch_vote_active -->
<iframe name="v{postrow.displayed.U_POST_ID}" class="ajaxvote" style="display:none"></iframe>
<!-- BEGIN switch_no_bar -->
<span class="c3zvau v{postrow.displayed.U_POST_ID}" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}">{postrow.displayed.switch_vote_active.L_VOTE_TITLE}</span>
<!-- END switch_no_bar -->
<!-- BEGIN switch_bar -->
<span class="c3zvau v{postrow.displayed.U_POST_ID}" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}">{postrow.displayed.switch_vote_active.L_VOTE_TITLE}</span>
<!-- END switch_bar -->
<!-- END switch_vote_active -->
<br>
<div style="float: left; left:375px;position:absolute;top:7px;">
<!-- BEGIN switch_vote_active -->
<div class="vote vote-button" title="Like Vì Bài Viết Hay !">
<!-- BEGIN switch_vote -->
<a target="v{postrow.displayed.U_POST_ID}" href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}" alt="c3zplus" class="c3zplus lvote"><span style="font: normal 11px Tahoma, Arial, Helvetica, sans-serif;margin-left: -2px; color: #3B5998;">Thích</span></a>
<!-- END switch_vote -->
</div>
<div class="vote vote-button" title="Dislike Vì Bài Viết Chưa Tốt !">
<!-- BEGIN switch_vote -->
<a target="v{postrow.displayed.U_POST_ID}" href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_MINUS}" alt="c3zminus" class="c3zminus lvote"><span style="font: normal 11px Tahoma, Arial, Helvetica, sans-serif;margin-left: -2px; color: #3B5998;">Không thích</span></a>
<!-- END switch_vote -->
</div>
<div id="v{postrow.displayed.U_POST_ID}" class="loadding" style="display: none"><img src="http://i43.servimg.com/u/f43/16/03/04/56/icon_l12.gif"> Chờ chút nhé ^^! </div>
<!-- END switch_vote_active -->
</div></div>
Bước 2: Chèn Code Sau Vào Cuối Viewtopic_body:
- Code:
<script type="text/javascript">
function chvote(a, b) {
"Message not voted" == b && (b = "c3zone z vietk 0% (0 vote)");
var d = parseInt(b.split(" ")[3], 10) / 100,
c = parseInt(b.split(" ")[4].substr(1), 10),
b = "Message reputation : " + Math.round(100 * ("c3zplus" == a ? (d * c + 1) / (c + 1) : d * c / (c + 1))) + "% (" + (c + 1) + " vote)";
return votetrans(b)
}
$(".c3zvau").each(function () {
var a = $(this).text();
$(this).html(votetrans(a))
});
function votetrans(a) {
if ("Message not voted" == a) return "<span class='qua'>Hãy là người đầu tiên thích điều này</span>";
var b = parseInt(a.split(" ")[3], 10) / 100,
a = parseInt(a.split(" ")[4].substr(1), 10),
d = 0 != b ? "<span class=vop>" + Math.round(b * a) + "+</span>" : "",
c = 0 != b && 1 != b ? ' <span style="color:#C2D5E3">|</span> ' : "",
a = 1 != b ? "<span class=vom>" + Math.round(a - b * a) + "-</span>" : "",
b = Math.round(100 * b);
return "<span class=no>" + d + c + a + "</span> <span class=qua>Đánh giá: " + b + "%</span>"
}
$(".lvote").click(function () {
"c3zplus" == $(this).attr("alt") ? $(this).parent().html("").next().html("") : $(this).parent().html("").prev().html("");
var a = $(this).attr("target"),
b = $(this).attr("alt"),
d = $("." + a).attr("title");
$("#" + a).show();
$("." + a).html(chvote(b, d));
$("#" + a).fadeIn("slow").animate({
opacity: 1
}, 1500).fadeOut("slow", function () {
$("." + a).fadeOut("slow").animate({
opacity: 1
}, 1E3).fadeIn()
});
$("." + $(this).attr("target")).removeAttr("title")
});
</script>
Bước 3: Chèn Code Sau Vào Cuối CSS:
- Code:
300;padding: 0.7em 0.1em;}
.numtopF{margin-right:-12px!important}
a.mainmenu[href='/groups'],a.mainmenu[href='/privmsg?folder=inbox'],#left,#textarea_content dt,#dulieutip,#dulieupostter,#sapxepdulieu{display:none}
.hihi {font-size: 11px!important}
.dacong{background:url(http://i48.servimg.com/u/f48/16/58/89/73/like_n11.png) no-repeat scroll 0 0 ;float:left;height:14px;width:16px;text-align:middle;}.datru{background:url(http://i48.servimg.com/u/f48/16/58/89/73/dislik16.png) no-repeat scroll ;float:left;height:16px;width:16px;text-align:middle;}
.vote-button{float:left;width:75px}
.c3zplus{background:url(http://i48.servimg.com/u/f48/16/58/89/73/like_b12.png) no-repeat scroll 0 0 ;float:left;height:13px;width:16px; text-align:middle; margin-left:-113px;}
.c3zplus{background-position:5px 50%;background-repeat:no-repeat;border:1px solid #C2D5E3;margin:6px 2px 0;width:34px;padding:5px 8px 5px 25px;text-align:left; text-color: black;margin-top: -4px;background-color:#ECEEF5;border: 1px solid #CAD4E7;border-radius: 3px 3px 3px 3px; color:#FFF!important;display:block;position:relative;}
.c3zplus:hover{background-color:#ebedf4;border-color:#9dacce}
.c3zminus:hover{background-color:#ebedf4;border-color:#9dacce}
.c3zminus {background: url(http://i48.servimg.com/u/f48/16/58/89/73/dislik15.png) no-repeat scroll #ECEEF5;
background-position: 6px 36%;background-repeat: no-repeat;border: 1px solid #CAD4E7;border-radius: 3px 3px 3px 3px;color: white!important;display: block;float: left;height: 13px;margin: -4px 0px 0;padding: 4px 4px 5px 24px;position: relative;text-align: left;width: 55px;}
.ost,.share,.c3zvau .qua,.no{background-position:5px 50%;background-repeat:no-repeat;border:1px solid #C2D5E3;margin:6px 2px 0;padding:5px 8px 5px 25px}.share{background-image:url(http://i43.servimg.com/u/f43/16/03/04/56/fav10.png)}.qua{background-image:url(http://i43.servimg.com/u/f43/16/03/04/56/no10.gif);padding-left:29px!important}.no{padding:5px 8px}.no .vop{background:url(http://i48.servimg.com/u/f48/16/58/89/73/like_b12.png) no-repeat left center;padding:0 0 0 20px}.no .vom{background:url(http://i48.servimg.com/u/f48/16/58/89/73/dislik15.png) no-repeat left center;padding:0 0 0 20px}
Được sửa bởi Admin ngày Wed Dec 21, 2016 2:32 pm; sửa lần 1.