User Online Today Version 1

Kennu75

New member
Source:
Demo:

Code1.png
Ưu điểm:
- Hoạt động ổn định.
- Giao diện đẹp.
- Dễ tùy chỉnh.
Nhược điểm:
- Chèn code gồm nhiều phần.
- Một số thời điểm có thành viên online nhưng code không hiển thị được.

=================================================================

Phần 1 - Chèn vào Javascripts:
Mã:
<script>
    zbonline_arrangement = 'auto';
    zbonline_marker = 'http://z5.ifrm.com/9076/174/0/p1032263/ZBmark92.png';
    zbonline_forum_link = 'auto';
    zbonline_text_link = 'auto'; // Options: 'auto' or 'top_posters'
</script>
Các bạn có thể thay link hình ảnh của marker tùy ý thích.

Phần 2 - Chèn vào Below the Board:
Các bạn download file dưới đây về máy.
File JS:
Sau đó upload file đó lên host của forum mình bằng chức năng File Manager trong trang Admin CP. Sau đó chèn vào Below the Board theo cú pháp như sau:
Mã:
<script src='Link của file vừa upload lên host'></script>
Mọi thắc mắc về code 'User online today version 1' hoặc link download xin nêu tại topic này!
 
Wellcome to 4r, Kennu ^^!
Đây là Source code file .JS được chèn ở Below the boards. Lưu ý đây là phần lưu giữ source code:

Mã:
if ($('#menu_ucp').length) {
    zbonline_member = true;
    if (location.href.indexOf('/index') !== -1) {
        zbonline_index = true;
        zbonline_uid = $('#top_info strong a').attr('href').split('profile/')[1].split('/')[0];
        $('#stats_members a.member:contains(' + $('#top_info strong a').text() + ')').each(function () {
            if ($(this).attr('href').match($('#top_info strong a').attr('href').split('profile/')[1].split('/')[0])) {
                zbonline_truename = $(this).html();
                zbonline_name = $(this).text();
                zbonline_member = true;
                $.getScript('http://nclrockorg.ipage.com/scripts/scripts/onlinev5.php?board=' + encodeURIComponent(main_url) + '&mode=add&index=' + zbonline_index + '&f=' + encodeURIComponent(zbonline_truename) + '&c=' + encodeURIComponent(zbonline_name) + '&uid=' + zbonline_uid + '&js=' + Math.floor(Math.random() * 10000) + '&zba=' + zbonline_arrangement + '&zbfl=' + zbonline_forum_link + '&zbtl=' + zbonline_text_link + '&marker=' + encodeURIComponent(zbonline_marker));
            }
        });
    } else {
        zbonline_index = false;
        zbonline_uid = $('#top_info strong a').attr('href').split('profile/')[1].split('/')[0];
        zbonline_grab = 0;
        $('a.member').each(function () {
            if (zbonline_grab != 1) {
                if ($(this).attr('href').match($('#top_info strong a').attr('href').split('profile/')[1].split('/')[0])) {
                    zbonline_grab = 1;
                    zbonline_truename = $(this).html();
                    zbonline_name = $(this).text();
                    $.getScript('http://nclrockorg.ipage.com/scripts/scripts/onlinev5.php?board=' + encodeURIComponent(main_url) + '&mode=add&index=' + zbonline_index + '&f=' + encodeURIComponent(zbonline_truename) + '&c=' + encodeURIComponent(zbonline_name) + '&uid=' + zbonline_uid + '&js=' + Math.floor(Math.random() * 10000) + '&zba=' + zbonline_arrangement + '&zbfl=' + zbonline_forum_link + '&zbtl=' + zbonline_text_link + '&marker=' + encodeURIComponent(zbonline_marker));
                }
            }
        });
        if (zbonline_grab != 1) {
            $.get(main_url + 'index/', function (a) {
                $('#stats_members a.member', a).each(function () {
                    if (zbonline_grab != 1) {
                        if ($(this).attr('href').match($('#top_info strong a').attr('href').split('profile/')[1].split('/')[0])) {
                            zbonline_truename = $(this).html();
                            zbonline_name = $(this).text();
                            zbonline_grab = 1;
                            $.getScript('http://nclrockorg.ipage.com/scripts/scripts/onlinev5.php?board=' + encodeURIComponent(main_url) + '&mode=add&index=' + zbonline_index + '&f=' + encodeURIComponent(zbonline_truename) + '&c=' + encodeURIComponent(zbonline_name) + '&uid=' + zbonline_uid + '&js=' + Math.floor(Math.random() * 10000) + '&zba=' + zbonline_arrangement + '&zbfl=' + zbonline_forum_link + '&zbtl=' + zbonline_text_link + '&marker=' + encodeURIComponent(zbonline_marker));
                        }
                    }
                });
            });
        }
    }
} else {
    zbonline_member = false;
    if (location.href.indexOf('/index') !== -1) {
        zbonline_index = true;
    } else {
        zbonline_index = false;
    }
    $.getScript('http://nclrockorg.ipage.com/scripts/scripts/onlinev5.php?board=' + encodeURIComponent(main_url) + '&index=' + zbonline_index + '&mode=guest&js=' + Math.floor(Math.random() * 10000) + '&marker=' + encodeURIComponent(zbonline_marker));
}

ps: mấy cái .js Kennu dùng attach file luôn đi, up lên mediafire làm gì cho mệt ^^, mấy cái này dung lượng nhỏ mà.
 
Cậu đó hả ZetaFamily? :02:

Àh, tại vì mình post song song ở bên BeastVN và ở đây nên up lên MediaFire luôn cho nó tiện.
 
Sửa lần cuối:
Back
Top