Khi sáng mình vào thì vẫn còn, không hiểu sao tối nay vào lại thì không thấy khung chọn tiền tố đâu nữa mặc dù mình không chỉnh sửa gì trong posting_body cả.
Đây là đoạn code mà mình đang sử dụng:
Demo: http://www.congdongotakuviet.com/
Nick test: Zzbaivong / Pass: baivong123
Mong được giúp đỡ. Cảm ơn vì đã ghé thăm topic.
Đây là đoạn code mà mình đang sử dụng:
- Code:
var prefixes = ["NEWS","PIC","VIDEO","BXH","GÓC ẨM THỰC","TÌM HIỂU NHẬT BẢN","GAME OFFLINE","VISUAL NOVEL","OST","AMV","VOCALOID","REVIEW","COSPLAY","SHARE","HPBD","VOTE","TRUYỆN NGẮN","NEKO CAFE","BASKET"]; //danh sách các prefix
var _pm = false; //true: cho phép dùng prefix khi gửi tin nhắn
/*!
* Topic prefixes - Copyright © 2011 by Viet K - chinhphuc.info
* Fix by Zzbaivong - devs.forumvi.com
*/
$(function() {
var chk = true;
if (_pm) chk = /\privmsg/.test(location.href);
if (/\/post/.test(location.href) || chk) {
var $select = $("<select>", {
id: "prefix",
style: "margin-top: 2px; margin-right:5px; height: 21px",
size: 1,
html: '<option value="">Mặc định (bỏ trống)</option>'
});
$.each(prefixes, function(i, val) {
$("<option>", {
value: val,
text: val
}).appendTo($select);
});
var $subject = $("input[name='subject']");
$select.insertBefore("select[name='topic_color']");
$subject.width($subject.width() - $select.width() - 5);
var testPrefix = new RegExp("^\\[(" + prefixes.join("|") + ")\\]");
var title = $subject.val();
if (testPrefix.test(title)) {
var prefix = title.match(/^\[([^\[\]]+)\]\s*(.*)/);
$select.find("option[value='" + prefix[1] + "']").attr("selected", true);
console.log($select.find("option[value='" + prefix[1] + "']"));
$subject.val(prefix[2]);
}
$("input[name='post']").click(function() {
if ($subject.val().trim() !== "" && $select.val() !== "") $subject.val("[" + $select.val() + "] " + $subject.val())
});
}
});
Demo: http://www.congdongotakuviet.com/
Nick test: Zzbaivong / Pass: baivong123
Mong được giúp đỡ. Cảm ơn vì đã ghé thăm topic.