ส่วนขยาย(Extension) จะทำให้ เว็บบอร์ด phpbb มีประสิทธิภาพ การทำงานที่ดีขึ้น โดยสามารถ ปรับเพิ่มเพิ่มแก้ไข้ ในส่วนต่างๆของ เว็บบอร์ด phpbb ได้ตามอิสระ ซึ่งในขั้นตอนพัฒนา ไม่จำเป้นที่จะต้องเข้าไปยุ่งเกี่ยว Code เดิมที่มีอยู่(แต่อาจจะมีบางครั่งที่ต้องเข้าไปแก้ไข้ เพิ่มเติม) นั้นก็ช่วยเราไม่ต้องกังวลกับการผิดพลาดที่อาจจะเกิดขึ้นได้เพราะหาก Code ของ เว็บบอร์ด phpbb เกิดความผิดพลาดก้อาจจะกระทบต่อการทำงานส่วนอื่นๆ ด้วย โดยการสร้าง Extension นั้นก็มีวิธีการพัฒนาที่ไม่ซับซ่อนมาก เพียงแต่จะมีเพียงการทำงานที่จะต้องเป็นไปตามที่เราต้องการเท่านั้น ที่จะยากนิดหน่อย
ซึ่งบางครั่ง เราก็อาจจะมีความจำเป็นที่จะต้องนำเอาภาษา คอมพิวเตอร์มาใช้เพื่อสนับสนุนการทำงานของเว็บบอร์ด phpbb เพื่อให้สามารถที่จะพัฒนา Extension ทำงานได้ตรงตามความต้องการแล้วมีประสิทธิภาพ มาขึ้น เช่น javascript ที่เป็นหนึ่งใน ภาษาคอมพิวเตอร์ ที่มีควสามารถมากมายในการพัฒนา เว็บอร์ด phpbb ตัวอย่างนี้
การใช้ javascript มีสร้างโฟกัส textbox แบบ อัตโนมัติ เมื่อกด ปุ่ม
โค้ด: เลือกทั้งหมด
$(document).on('click', '.reply_sub_com', function () {
var post = $(this).closest('.post.has-profile,.box-sub-comment-old');
var action = $(post).find('.reply_sub_com').attr('data-value');
var title = $(post).find('.reply_sub_com').attr('data-sub');
var close = $(post).find('.reply_sub_com').attr('data-close');
var sen = $(post).find('.reply_sub_com').attr('data-sen');
console.log(post);
if ($(post).hasClass('box-sub-comment-old')) {
var id = $(post).attr('data-id');
} else {
var id = $(post).prop('id');
}
console.log(id);
if (!$('.box-sub-comment[data-id="' + id + '"]').length) {
if (!$('.box-sub-comment-old[data-id="' + id + '"]').length) {
$(post).after('<div class="box-sub-comment" data-id="' + id + '" style="display: none;"></div>');
} else {
$(post).parent().find('.box-sub-comment-old[data-id="' + id + '"]:last').after('<div class="box-sub-comment" data-id="' + id + '" style="display: none;"></div>');
}
var box = $('.box-sub-comment[data-id="' + id + '"]');
console.log(title);
var html = '<br> ' + title + ' <hr><br><div class="box-sub-comment-inner" ><form action="' + action + '"> <textarea rows="12" cols="75" id="sub_box' + id + '" name="message"></textarea> <br><br> <input type="submit" value="' + sen + '"> <input class="sub_com_closed" type="button" value="' + close + '"> </form></div><br><br>';
$(box).append(html);
setTimeout(function(){
$('#sub_box' + id).focus();
},800);
} else {
var box = $('.box-sub-comment[data-id="' + id + '"]');
}
var sid = id.substr(1);
$(box).insertAfter('#txtHint' + sid);
// alert(sid);
$(box).slideDown();
});