[Share] Tổng hợp một vài code hay cho forum Zetaboards (code ZB)

[Mr.P]

New member
Đây là một vài code hay sưu tầm và đã dùng dành cho các forum của Zetaboards


1. Code ẩn các tiêu mục: Viewer, Topic, Replies

Demo:
Trước khi thêm code
truoc.jpg


Sau khi thêm code
sau.jpg

Mã:
<script type="text/javascript">
$("tr.c_info").empty().prev().children(".c_last").attr("rowspan","2")
</script>
2. Code auto refesh list online: mọi khi nếu không có code này muốn biết list online có những ai đang online thì đành phải F5, nhưng với code này thì mọi chuyện sẽ được auto:06:
Mã:
<script type='text/javascript'>

auto_refresh = "on"; // set auto refresh 'on' or 'off'
seconds = 5; // seconds between each refresh...

$.getScript("http://209.85.62.24/53/36/0/p344094/member_auto_reload.js");
</script>
3. Code hiện một bảng thông báo khi Login và Logout
Mã:
<script>
function cancel () {}
if (confirm(" ( [COLOR=Green][B]Chào Mừng Bạn Ghé Thăm Forum[/B][/COLOR] )")) {
vote();
}
else cancel()
</SCRIPT>
<script>
function unloadP()
{
alert(" ( [COLOR=Green][B]Cảm ơn bạn đã ghé thăm ! Chúc bạn một ngày tốt lành![/B][/COLOR] )");
}
window.onunload=unloadP;
</SCRIPT>
các bạn có thể thay đổi nội dung cho phù hợp ở dòng chữ màu xanh

........to be continue!:06:
 
Sửa lần cuối:
Continue...
4. Code bảng màu trong Microshof cho ZB
Cái này mình sưu tầm được, nó sẽ giúp cho các bạn trình bày được bài viết sinh động hơn đó.


Mã:
<script type="text/javascript">
colors=[];i=0;

colors[i++] = ['#000000','Black'];
colors[i++] = ['#993300','Brown'];
colors[i++] = ['#333300','Olive Green'];
colors[i++] = ['#003300','Dark Green'];
colors[i++] = ['#003366','Dark Teal'];
colors[i++] = ['#000080','Dark Blue'];
colors[i++] = ['#333399','Indigo'];
colors[i++] = ['#333333','Gray-80%'];
colors[i++] = ['#800000','Dark Red'];
colors[i++] = ['#FF6600','Orange'];
colors[i++] = ['#808000','Dark Yellow'];
colors[i++] = ['#008000','Green'];
colors[i++] = ['#008080','Teal'];
colors[i++] = ['#0000FF','Blue'];
colors[i++] = ['#666699','Blue-Gray'];
colors[i++] = ['#808080','Gray-50%'];
colors[i++] = ['#FF0000','Red'];
colors[i++] = ['#FF6700','Light Orange'];
colors[i++] = ['#99CC00','Lime'];
colors[i++] = ['#339966','Sea Green'];
colors[i++] = ['#33CCCC','Aqua'];
colors[i++] = ['#3366FF','Light Blue'];
colors[i++] = ['#800080','Violet'];
colors[i++] = ['#999999','Gray-40%'];
colors[i++] = ['#FF00FF','Pink'];
colors[i++] = ['#FFCC00','Gold'];
colors[i++] = ['#FFFF00','Yellow']; 
colors[i++] = ['#00FF00','Bright Green'];
colors[i++] = ['#00FFFF','Turquoise'];
colors[i++] = ['#00CCFF','Sky Blue'];
colors[i++] = ['#993366','Plum'];
colors[i++] = ['#C0C0C0','Gray-25%'];
colors[i++] = ['#FF99CC','Rose'];
colors[i++] = ['#FFCC99','Tan'];
colors[i++] = ['#FFFF99','Light Yellow'];
colors[i++] = ['#CCFFCC','Light Green'];
colors[i++] = ['#CCFFFF','Light Turquoise'];
colors[i++] = ['#99CCFF','Pale Blue'];
colors[i++] = ['#CC99FF','Lavender'];
colors[i++] = ['#FFFFFF','White'];
</script>
<script type="text/javascript" src="http://209.85.62.24/307/162/0/p360451/msc.js"></script>

5. Code trao cúp cho top Poster



Mã:
<script type='text/javascript'>
var tropies = [
"<img src='http://playstationlifestyle.net/trophies/images/gold-20x20.png' title='Top Poster ' />",
"<img src='http://playstationlifestyle.net/trophies/images/silver-20x20.png' title='2nd Place'/>",
"..."
];

// Do not edit past here

$.get(main_url + 'members/?topten', function (data) {
var ranks = [];
$('#member_list_full tr:not(:eq(0)):lt(4)', data).each(function (i) {
ranks[i] = $(this).find('a:first').text();
});
$('a.member, #top_info strong a').each(function () {
var i = ranks.length, name = $(this).text();
while (i--) {
if (name === ranks[i]) {
$(this).after(tropies[i - 1] || "");
}
}
});
});

</script>
 
Sửa lần cuối:
Code Thanks trên ZB không hoạt động được đâu, đang cập nhật...:06:
 
Demo đây:
Nó chỉ phù hợp cho các Forum cho lớp,.... vì nó còn một số bất tiện.
 
Back
Top