Thay avatar nhanh tại mọi nơi trên diễn đàn.
Written by baivong - http://www.fmvi.vn/

Đợt trước có copy paste một bài hướng dẫn bên fmvi í...
mà cái í chỉ là thay avatar từ hình ảnh bài viết thôi...

Lần này là lấy cái nút, bấm vào nó hiện hộp thoại và nhập url vào í,
i như fmvi [MOD] Thay avatar nhanh tại mọi nơi trên diễn đàn. ShareActions 4250330451

HTML: (Chèn vào 1 widget hoặc Annoucement)

Code:

        <span class="name" style="display:none">{USERLINK}</span>
        <span style="display:none" id="numID"></span>
        <a class="changeatvar" title="Thay avatar" onclick="quickava()" href="javascript:void(0)"><i class="i-white i-picture"></i></a>

Javascript: (Tạo 1 js mới, đặt In all the pages)

Code:

        $(function () {
        function quickava() {
            var a = prompt("Nhập URL hình ảnh vào đây! Chấp nhận các ảnh dạng jpg, jpeg, gif, png, bmp", "");
            ("" != a && null != a) && avatarfmvi(a, $("#numID").text(), $(".name").text())
        }
        function avatarfmvi(a, d, v) {
            $(".changeatvar").html('<img src="http://i15.servimg.com/u/f15/17/70/31/89/13x13p10.gif/">');
            $.ajax({
                type: "POST",
                cache: false,
                url: "/profile?mode=editprofile&page_profil=avatars",
                data: {
                    avatarremoteurl: a,
                    username: v,
                    user_id: d,
                    submit: "Ok"
                },
                success: function (f) {
                    if($(f).find("a[href='/u" + d + "']").length) {
                        $.ajax({
                            type: "GET",
                            cache: false,
                            url: "/profile?mode=editprofile&page_profil=avatars",
                            success: function (e) {
                                c = $(e).find("#ucp img:first").attr("src");
                                $(".thongtin a .avatar-user img, .avatarUn img").attr("src", c);
                                $(".changeatvar").html('<i class="i-white i-picture"></i>');
                                alert("Thay avatar thành công")
                            }
                        })
                    }
                }
            })
        }

CSS:

Code:

        .i-white{background-image:url(http://i15.servimg.com/u/f40/17/70/31/89/w111010.png)}
        .i-picture{background-position:-456px -48px}

các bạn có thể thay link https://i.servimg.com/u/f40/17/70/31/89/w111010.png ở trên bằng cái này https://i.servimg.com/u/f40/17/70/31/89/b101010.png Cười nhăn răng