• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hướng dẫn thêm nút chọn "select all" cho code, php, html vbb 4.1.x

Admin

Well-Known Member
Staff member
Administrator
Mods template này cho phép bạn bổ xung vào BB Code CODE/HTML/PHP chức năng lựa chọn tất cả nội dung nằm trong những BB Code ấy bằng một nút bấm.

Bước 1: Chèn javascript vào template headinclude

- AdminCP -> Styles & Templates -> Style Manager -> Edit Templates ->headinclude
- Copy nội dung js sau vào cuối cùng của template headinclude :

HTML:
<script type="text/javascript">

    function selectAll(a)    {        var e  = a.parentNode.parentNode.getElementsByTagName('code')[0];        if  (window.getSelection)        {            var s = window.getSelection();            if  (s.setBaseAndExtent)            {                s.setBaseAndExtent(e, 0, e, e.innerText.length -  1);            }            else            {                var r = document.createRange();                r.selectNodeContents(e);                s.removeAllRanges();                s.addRange(r);            }        }        else if (document.getSelection)        {            var s = document.getSelection();            var r = document.createRange();            r.selectNodeContents(e);            s.removeAllRanges();            s.addRange(r);        }        else if  (document.selection)        {            var r = document.body.createTextRange();            r.moveToElementText(e);            r.select();        }    } 
</script>


Bước 2:
Thay thế toàn bộ các Temp sau đây:

... -> Edit Templates -> BB Code Layout Templates -> bbcode_code

HTML:
<div class="bbcode_container">
    <div class="bbcode_description">{vb:rawphrase code}::&nbsp;<input type="button" value="{vb:rawphrase   select_code}" onclick="selectAll(this); return false;"></div>
    <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><code>{vb:raw code}</code></pre>
</div>

... -> Edit Templates -> BB Code Layout Templates -> bbcode_html

HTML:
<div class="bbcode_container">
    <div class="bbcode_description">{vb:rawphrase html_code}::&nbsp;<input type="button"  value="{vb:rawphrase select_code}" onclick="selectAll(this); return  false;"></div>
    <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:<vb:if condition="$blockheight<=$vboptions['codemaxlines']">{vb:math {vb:math {vb:raw blockheight}+2}}*{vb:stylevar mid_fontSize}}<vb:else />{vb:math {vb:math {vb:raw blockheight}+1}*{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><code>{vb:raw code}</code></pre>
</div>

... -> Edit Templates -> BB Code Layout Templates -> bbcode_php

HTML:
<div class="bbcode_container">
    <div class="bbcode_description">{vb:rawphrase php_code}::&nbsp;<input type="button"  value="{vb:rawphrase select_code}" onclick="selectAll(this); return  false;"></div>
    <div class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><code>{vb:raw code}</code></div>
</div>

Bước 3: Tạo thêm phrase : dễ dàng trong việc Việt hoá, và chuyên nghiệp hơn.

AdminCP -> Languages & Phrases -> Phrase Manager -> [Add New Phrase]
Phrase Type : GLOBAL
Product : vBulletin
Varname : select_code
Text : select all
Vietnamese (VI) Translation : Chọn tất cả

Save lại, và thưởng thức nào :tz46:
 
Em làm cho 4.1.0 không chạy anh coi lại cám ơn nhiều nhe
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin Hướng dẫn thêm nút gửi bài mới vào trang xem bài cho xenforo Xenforo 0
Admin Hướng dẫn thêm nút "Trả lời nhanh" và "Đăng bài mới" trong bài viết cho xenforo Xenforo 1
Admin Hướng dẫn thêm các nút bbcode cho wblib HTML & CSS 0
Admin Hướng dẫn thêm nút ban thành viên style mobile vbb Vbb tutorial 5
Della007 Hướng dẫn Thêm nút tạo chủ đề mới trong xenforo Xenforo 0
Admin Hướng dẫn thêm nút viết chủ đề mới bên cạnh nút trả lời bài viết Vbb tutorial 0
Admin Hướng dẫn thêm nút trên navbar Vbulletin 0
N Help Hướng dẫn thêm nút band Vbulletin 3
Tjeuphong Hướng dẫn Thêm nút remove thanks cho style mobile Add-ons 17
Admin Hướng dẫn thêm nút Up Thread - Đưa chủ đề lên vbb 4.1.x Vbulletin 0
Admin Hướng dẫn thêm nút report vào postbit hoặc postbit_legacy Vbulletin 0
Admin Thêm nút "Này Thím Đăng Ký Đi" Cho VBB all x.xx Vbulletin 2
T Cách thêm avatar vào khung ảnh cực kỳ đơn giản trên myFrame.vn Thảo luận chung 0
T Cách Thêm File robots.xtx cho web xtgem Thảo luận chung 1
katy Android Siêu ưu đãi MobiFone: tặng thêm gói cước 30GB mừng sinh nhật 30 năm Điện thoại di động 12
Thichquangboom [New Update] Fshare Tool cho MAC OS: Giao diện mới thông minh – Thêm tính năng tiện ích Tin tức, sự kiện thường ngày 0
tunglamed MobiFone tặng thêm ngày sử dụng cho các thuê bao trả trước tại các vùng dịch Điện thoại di động 8
tunglamed MobiFone khuyến mại: Thanh toán online, ở nhà tránh dịch - nhận thêm chiết khấu 5%!! Điện thoại di động 6
Thichquangboom Fshare tiếp sức đẩy lùi Covid – Tặng thêm 40% ngày VIP!!! Tin tức CNTT 0
tunglamed Thanh toán online giao dịch nhanh, gọn - Hưởng thêm chiết khấu 5% Điện thoại di động 0
tunglamed MobiFone tặng thêm 15 ngày hưởng ưu đãi cùng thẻ Kết nối dài lâu Điện thoại di động 0
tunglamed Gọi miễn cước - Rước thêm mười nghìn với dịch vụ 8Friend Điện thoại di động 0
Admin Hướng dẫn thêm form liên hệ (contact) cho wordpress mới nhất Wordpress 0
T Shell dự định đầu tư thêm vào blockchain Tin tức CNTT 0
cuongpro9x Hỏi Lỗi khi thêm ram máy tính Sử dụng, chia sẻ, hỏi đáp 7
T Microsoft thêm ứng dụng Blockchain vào Power Platform Tin tức CNTT 0
N MobiFone bổ sung thêm tính năng tra cứu chi tiết cước trên ứng dụng My MobiFone Thông tin các mạng di động 2
N MobiFone bổ sung thêm ưu đãi tại 2 Sân golf Đại Lải và Yên Dũng Thông tin các mạng di động 6
Thichquangboom Ưu Đãi Thêm 50% Ngày Vip Fshare Khi Thanh Toán Qua Webmoney Trò chuyện linh tinh 2
U AIO Patch v17.0 thêm nhiều tiện ích mới S60 0
haopro Nonstop Nonstop bass cực mạnh 2017 bay cao cho đời thêm đẹp sao Âm nhạc 0
Thichquangboom [cực sốc] fshare giảm giá đến 50%, tặng thêm 30% ngày vip Thông tin khuyến mại Fshare 0
D Mobifone cung cấp thêm gói Data50 Thông tin các mạng di động 9
Admin Hướng dẫn nhận thêm 2GB dung lượng Google Drive mới nhất 2016 Sử dụng, chia sẻ, hỏi đáp 0
B Asphalt 8 nhận bản cập nhật: thêm xe mới, decal mới và thử thách mới Windows phone 0
Admin Hướng dẫn thêm thành viên vào OpenVPN trên CentOS 7 chi tiết VPS & Dedicated Server 7
Admin Hướng dẫn thêm tiện ích IDM Integration vào Google Chrome đơn giản Sử dụng, chia sẻ, hỏi đáp 0
P Hỏi PHP Post ID cần thêm chức năng limit time PHP 2
E Xin Mong anh Thắng tạo thêm 1 trang xem điểm chuẩn 2014 PHP 0
Admin Hướng dẫn thêm lượt xem chủ đề cho johncms chi tiết Johncms 0
tubotocdo Góp ý thêm chuyên mục. Ý tưởng, góp ý, sáng kiến mới của thành viên 3
Smobi Hướng dẫn Send dữ liệu bằng Ajax Jquery cho việc thêm sửa xóa PHP 0
Admin LG thêm phiên bản 3 SIM cho điện thoại Optimus L1 II Android, iOS 0
Admin Hướng dẫn thêm bản quyền vào bài viết cho johncms bằng php Johncms 0
Admin Hướng dẫn thêm nick và gửi tin nhắn yahoo online bằng php PHP 0
Admin Hướng dẫn thêm rel="nofollow" và target="_blank" cho wordpress không dùng plugin Wordpress 1
Admin Hướng dẫn thêm đuôi .html cho xenforo không dùng add-ons Xenforo 0
Admin Hướng dẫn thêm google tìm kiếm tuỳ chỉnh cho xenforo Xenforo 0
Admin Hướng dẫn thêm tiêu đề bài viết đầu tiên cho xenforo Xenforo 0
Admin Thêm 50$ miễn phí từ digitalocean ngày black friday Chia sẻ mã giảm giá 0

Similar threads

New posts New threads New resources

Back
Top