Diendandip

Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Diendandip

Latest topics

» TEAM THIÊN TÀI VÔ ĐỊCH GIẢI ĐẤU CLAN ĐẦU TIÊN
by rename Fri Dec 12, 2014 12:25 am

» [CPVM] Like Fanpage ngay, nhận quà liền tay!
by rename Fri Dec 12, 2014 12:23 am

» Xạ thủ Truy Kích Bắc – Nam: Bên tám lạng người nửa cân
by rename Wed Dec 10, 2014 11:54 pm

» Teen chia sẻ bí quyết chinh phục đỉnh vũ môn
by rename Wed Dec 10, 2014 11:51 pm

» [Chinh Phục Vũ Môn] Hoạt động hàng ngày, chăm chỉ nhận thưởng
by rename Wed Dec 10, 2014 11:48 pm

» Truy Kích - những vấn đề cần giải quyết để thành ông hoàng mới của MMOFPS Việt
by rename Wed Dec 10, 2014 4:52 am

» Chinh Phục Vũ Môn đi tiên phong cho thế hệ game Cross-Platform Việt Nam
by rename Wed Dec 10, 2014 4:47 am

» Game đấu trí Chinh Phục Vũ Môn phiên bản mới có gì hot
by rename Wed Dec 10, 2014 4:43 am

» Ra mắt thành công, clan Truy Kích mọc lên như nấm
by rename Mon Dec 08, 2014 7:34 pm

» Tích xúc xắc, Vui từng khoảnh khắc!
by rename Mon Dec 08, 2014 7:30 pm

» Chinh Phục Vũ Môn-Hướng Dẫn Tân Thủ
by rename Mon Dec 08, 2014 7:26 pm

» CPVM toàn quốc lần thứ nhất 2014 - 2015 chính thức được gia hạn
by rename Mon Dec 08, 2014 3:02 am

» Bắc Giang tổ chức hội nghị tập huấn, triển khai cuộc thi Chinh Phục Vũ Môn
by rename Mon Dec 08, 2014 2:52 am

» [Chinh Phục Vũ Môn] Tham gia Tích xúc xắc, Vui từng khoảnh khắc!
by rename Sun Dec 07, 2014 2:42 am

» Chinh phục Vũ Môn – Câu chuyện Egame viết cho cộng đồng
by rename Sun Dec 07, 2014 2:37 am

» [TRUY KÍCH] CHÙM SỰ KIỆN CHÀO MỪNG PHIÊN BẢN CHÍNH THỨC
by rename Fri Dec 05, 2014 7:12 pm

» Chinh Phục Vũ Môn Mobile ghi điểm nhờ tính giáo dục cao
by rename Fri Dec 05, 2014 7:04 pm


    Code giới hạn kí tự gửi bài

    admin
    admin
    Admin


    Điểm : 4677
    Bài viết : 1563
    Like : 4408
    Forum,web : http://www.diendandip.info

    Tài sản
    Tài sản: 0

    Code giới hạn kí tự gửi bài Empty Code giới hạn kí tự gửi bài

    Bài gửi  admin Thu May 23, 2013 11:43 pm

    Demo:Code giới hạn kí tự gửi bài 1-3
    Cách làm:
    tìm trong viewtopic_body code:
    Code:
    {QUICK_REPLY_FORM}
    Thay bằng code:
    Code:
    <a name="quickreply"></a>
    <iframe style="display:none;" class="post_vds" name="guinhanhz"></iframe>
    <div class="tbpost"></div>
    <div  class="imgloadpost"  style="display:none;"><img src="http://i43.servimg.com/u/f43/16/03/04/56/icon_l12.gif"/>Đang gửi....</div>
      {QUICK_REPLY_FORM}
    Chèn cuối viewtopic_body code:
    Code:
    <script type="text/javascript">
      var banquyen= "Giới Hạn Ký Tự Style TeenLyThuongKiet.Net";
      $('.imgloadpost').clone().appendTo('.frm-buttons');
     $('input[name=preview]').one('click', function () {
        ktgui = 0;
        $("form[action='/post']").submit(function () {
            if (kiemtragui()) {
                $("input[type='submit']").hide();
                $('.frm-buttons .imgloadpost').show();
                setTimeout('xemtruoc();', 200);
            } else {
                return false;
            };
        });
    });
    $("input.xoabai").click(function(){
      $(this).parents(".baigui").html('<div id=tbpost align=center>Đã xóa khỏi cơ sở dữ liệu</div>');
     
      });
     
    function xemtruoc() {
        if (ktgui == 0) {
            if ($('.post_vds').contents().find('.post').length) {
                $('.tbpost').html('<br><hr>');
                $('.post_vds').contents().find('.post:first').appendTo('.tbpost');
                $('.post_vds').contents().empty();
                $('.tbpost').css({
                    'color': 'black',
                    'background-color': 'white'
                }).slideDown();
                $('.frm-buttons .imgloadpost').hide();
                $('input[name=post],input[name=preview]').show();
                return false;
            } else setTimeout('xemtruoc();', 200);
        };
    };
     
      $('input[name=post]').one('click', function () {
        ktgui = 1;
        $("form[action='/post']").submit(function () {
            if (kiemtragui()) {
                guibainhanh();
            } else {
                return false;
            };
        });
    });
    $("form[action='/post']").attr('target','guinhanhz');
    function kiemtragui() {
        min = 10;
        kt = $('textarea#text_editor_textarea').val().replace('<br>', '').replace(/ /gi, '').length;
        if (kt < min) {
            $('.tbpost').html('Bài viết quá ngắn!<br>Số ký tự tối thiểu là ' + min + ' ký tự.<br>Bạn cần viết thêm ' + (min - kt) + ' ký tự nữa mới có thể gửi bài.');
            $('.tbpost').slideDown();
            $('textarea#text_editor_textarea').focus();
            return false;
        } else {
            return true;
        };
    };

    function guibainhanh() {
        $("input[type='submit']").hide();
        $('.tbpost').slideUp();
        $('.frm-buttons .imgloadpost').show();
        setTimeout('guibaiviet(ktgui);', 200);
    };

    function guibaiviet(ktgui) {
        if (ktgui == 1) {
            if ($('.post_vds').contents().find('.message:contains(Bài của bạn đã được chuyển)').length || $('.post_vds').contents().find('.message:contains(Your message has been entered successfully)').length) {
                chenbai();
                $("form[action='/post']").hide();
                $('.tbpost').text('Thành công, Bài viết của bạn đã được gửi. Ấn F5 Load lại để xem lại cảm nhận bạn vừa viết ^^');
                $('.tbpost').slideDown().css('color', 'green');
                $('.post_vds').remove();
                return false;
            } else if ($('.post_vds').contents().find("form[action='/post']").length && $('.post_vds').contents().find('.p-hidden:contains(A new message has been posted while you were writing your response. Please)').length) {
                chenbai();
                $('.main-content.frm:first').empty();
                $('.post_vds').contents().find("form[action='/post']").appendTo('.main-content.frm:first');
                $("form[action='/post']").attr('target', 'guinhanhz');
                $('.imgloadpost').clone().appendTo('.frm-buttons');
                $('.tbpost').text('Thông báo, Chủ đề này vừa có người gửi bài trước bạn. Bạn có muốn tiếp tục gửi bài?');
                $('.post_vds').contents().empty();
                $('.tbpost').css({
                    'color': 'red',
                    'background-color': 'wheat'
                }).slideDown();
                $('input[name=prevent_modif]').hide();
                $("form[action='/post']").focus().submit(function () {
                    guibainhanh();
                });
                return false;
            } else if ($('.post_vds').contents().find('.main .main-content p:contains(Flood control is active on this forum, please wait)').length) {
                $('.tbpost').text($('.post_vds').contents().find('.main .main-content p:contains(Flood control is active on this forum, please wait)').text());
                $('.post_vds').contents().empty();
                $('.tbpost').text($('.tbpost').text().replace('second(s) before replying or posting', 'giây(s) trước khi trả lời hoặc gửi bài').replace('Flood control is active on this forum, please wait', 'Phát hiện bạn gửi bài quá nhanh, xin đợi'));
                $('.tbpost').css({
                    'color': 'red',
                    'background-color': 'wheat'
                }).slideDown();
                $('.frm-buttons .imgloadpost').hide();
                $('input[name=post]').show();
                return false;
            } else {
                setTimeout('guibaiviet(ktgui);', 200);
            };
        };
    };


    function chenbai() {
        if ($('.main-head.clearfix:contains(Thông điệp) strong:eq(0)').text() == $('.main-head.clearfix:contains(Thông điệp) strong:eq(1)').text()) {
            gtlink = $('.baigui:last .posthead h2 strong:eq(0)').text();
        } else {
            gtlink = parseInt($('.main-head.clearfix:contains(Thông điệp) strong:eq(1)').text()) * 10 - 9;
        };
        link = location.href.replace('http://a1-annhon3.forumvi.com', '').split("-")[0].split("p")[0] + 'p' + gtlink + '-topic';
    $('<div class=postcuoi><div  align=center><img src="http://i43.servimg.com/u/f43/16/03/04/56/icon_l12.gif"/>Đang gửi bài viết.....</div></div>').appendTo('.toanbo:last').load(link + ' .toanbo .baigui:last',function(){ hehe();});
    };

      </script>
    Mọi người muốn thay đổi số ký tự giới hạn thì thay số 10 thành số tương ứng:
    Code:
    min = 10;

      Hôm nay: Fri Sep 20, 2024 1:51 pm

      Scroll To Bottom
      Tắt