The0ne-zoner

Free Whole-hearted and Professional


You are not connected. Please login or register

Chuyển đến trang : Previous  1, 2

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down  Thông điệp [Trang 2 trong tổng số 2 trang]


ܓܨܓMxTrường
ܓܨܓMxTrường Nhóm the0ne
Nhóm the0ne

First topic message reminder :

Bài viết này được viết theo yêu cầu: [You must be registered and logged in to see this link.]


Thực hiện như sau:
ACP -> Modules -> HTML & JAVASCRIPT -> Javascript codes management -> Change a Javascript Code -> Create a new javascript
Nội dung:
Title: Js for the slimbox
Placement: In all the page
Javascript Code:
Code:
//Được viết bởi MxTruong
//Vui lòng không xóa sửa nội dung trong code
jQuery(function () {
    jQuery(".vote-button a").click(function (v) {
      v.preventDefault();
        a = jQuery(this).attr("href").split("eval=")[1].slice(0, 4);
        b = _userdata["username"];
        c = jQuery(this).parents(".post").find(".username a").html();
        d = jQuery(this).attr("href");
        a == "plus" ? a = "[b]Cộng[/b]" : a = "[b]Trừ[/b]";
        jQuery.post("/privmsg", {
            "mode": "post",
            "subject": "[Hệ Thống]" + b + " đã vote cho bạn!",
            "message": b + " đã vote " + a + " tại topic " + location.href,
            "username[]": c,
            "folder": "inbox",
            "post": "Send"         
        }).done(function(){location.href=d;});   
    })
})
Đối với forum không sử dụng toolbar mặc định của fm thì thay:(Lưu ý: phải sử dụng navbar của fm)
Code:
_userdata["username"]
Bằng:
Code:

jQuery('#logout').text().split(' ')[2]
Đối với phiên bản phppp3 thì thay:
Code:
jQuery(this).parents(".post").find(".username a").html()
Bằng:
Code:
jQuery(this).parents(".post").find('.author a').text()
Nếu muốn Viết lên Wall thay vì gửi tin nhắn thì thay:
Code:
 jQuery.post("/privmsg", {
            "mode": "post",
            "subject": "[Hệ Thống]" + b + " đã vote cho bạn!",
            "message": b + " đã vote " + a + " tại topic " + location.href,
            "username[]": c,
            "folder": "inbox",
            "post": "Send"         
        }).done(function(){location.href=d;});   
Bằng:
Code:
jQuery.post("/privmsg", {
          post_icon: 3,
            subject: "[Hệ Thống]" + b + " đã vote cho bạn!",
            message: b + " đã vote " + a + " tại topic " + location.href,
            username: c,
         mode: "post_profile",
        folder: "profile",
            "post": "Send"         
        }).done(function(){location.href=d;});   

Xem Bài viết trước của tôi:
  • Một phần nội dung bài viết đã bị ẩn, hãy thực hiện các bước trên, sử dụng thử mod và sau đó cho tôi ý kiến để được đọc tiếp nội dung bị ẩn.

Viết bởi MxTruong ngày 19-5-2013



Được sửa bởi ܓܨܓMxTrường ngày Mon May 20, 2013 8:09 pm; sửa lần 6. (Reason for editing : Sửa lỗi lần 1)

Hoàng Tử Nai
Hoàng Tử Nai Newbie
Newbie

xem

Kazuma Hoshino
Kazuma Hoshino Hiểu cách sử dụng the0ne
Hiểu cách sử dụng the0ne

Báo tập trung về 1 trang wall được không nhỉ ;d

doannamthai
doannamthai Nhóm the0ne
Nhóm the0ne

"username[]": c
chuyển cs thành tên người mà muốn chuyển mặc định VD:
"username[]": "doannamthai"

P/s : Thêm 1 bước nữa
ACP --> QLTT --> Forum --> Security
Unauthorize unofficial forms to post messages and private messages on the forum : Không

Kazuma Hoshino
Kazuma Hoshino Hiểu cách sử dụng the0ne
Hiểu cách sử dụng the0ne

Vậy phải thay đổi nút like ạ? Em test mà không được ;d

daicaibang
daicaibang Newbie
Newbie

Nếu mình dùng code Vote của LG thì mình phải làm sao, vì mình đã test với code trên vẫn kô đc.
code của LG mình đã dùng kèm theo bên dưới

Code:
<script type="text/javascript">
    var like_version = 'punbb';
    var DOM_IS_READY = false;
    $(function () {
        DOM_IS_READY = true;
    });
    var vote_singular = '';
    var vote_plural = '';
    $.getScript('/21238.js');
</script>

Code 21238.js

Code:
function lglike(b, a) {
    var d = a.innerHTML;
    a.innerHTML = "Loading...";
    a.onclick = "#";
    $.get(b, function () {
        a.className += " LGnovote";
        a.innerHTML = d;
        var c = a.nextSibling,
            b = parseInt(/\d+/.exec(c.innerHTML)[0]) + 1;
        c.innerHTML = c.innerHTML.replace(/\d+/, b)
    })
};

function init_lg_like_system() {
    for (var x = $('.vote'), i = 0, vote;
    (vote = x[i++]);) {
        var count = 0,
            plus = 0,
            bar = $('.vote-bar', vote)[0],
            button = $('.vote-button', vote)[0];
        if (bar) {
            var info = bar.title.match(/\d+/g);
            plus = Math.round(parseInt(info[1]) * parseInt(info[0])) / 100
        }
        button = button ? '<span onclick="lglike(\'' + button.firstChild.href + '\',this);" class="LGlike">' + vote_singular + '</span>' : '<span class="LGlike LGnovote">' + vote_singular + '</span>';
        var votes_text = '<span class="LGlikecount">' + plus + ' ' + (plus == 1 ? vote_singular : vote_plural) + '</span>';
        var total_button = '<div class="LGvote">' + button + votes_text + '</div>';
        like_version === 'phpbb3' ? $('.corners-bottom', vote.parentNode.parentNode).before(total_button) : like_version === 'invision' ? $(vote.parentNode.parentNode.parentNode.nextSibling.lastChild).prepend('<li>' + total_button + '</li>') : like_version === 'punbb' ? $('.edited', vote.parentNode.parentNode.parentNode.parentNode).before(total_button) : like_version === 'phpbb2' ? $('.lglike', vote.parentNode).html(total_button) : null
    }
    x.remove()
};
DOM_IS_READY ? init_lg_like_system() : $(function () {
    init_lg_like_system()
});

DrDuyWin
DrDuyWin Newbie
Newbie

http://forumvi.com
^ chỉnh lại class của nút vote với parents

Sponsored content

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang  Thông điệp [Trang 2 trong tổng số 2 trang]

Chuyển đến trang : Previous  1, 2

Permissions in this forum:
Bạn không có quyền trả lời bài viết