Hello forumotion, just gonna ask if a phbb2 has a possibility to have a Topic Prefix? Cause I have already search some prefix related in here but the only forum version I see is phbb3,punbb and Invision. If there was a code for it can you post it here? I need your help guys and If it has, how can I modify it with a color?
Thanks in advance.
Edited:
I have search in the forum and saw this code for the prefix but it didn't function in my forum
Forum link: http://www.rl-rp.board.st
Forum Version: phbb2
Thanks in advance.
Edited:
I have search in the forum and saw this code for the prefix but it didn't function in my forum
Forum link: http://www.rl-rp.board.st
Forum Version: phbb2
- Code:
var prefixes = ["PENDING", "ACCEPTED", "DENIED", "PENDING ADMIN", "PENDING INV", "APPROVED"];
var _pm = false;
var chk = false;
function toMenu(a) {
var htmlpre = '<select style="margin-right:5px" id="prefix" size="1"><option value="">(None)</option>';
for (i in a)
htmlpre += '<option value="' + a[i] + '">' + a[i] + '</option>';
htmlpre += '</select>';
return htmlpre;
}
function checkpre(ar, input) {
for (i in ar) {
var p = new RegExp("" + ar[i], "g");
var title = input.substr(0, input.indexOf(']'));
if (p.test(title)) return ar[i];
}
return "";
}
$(function () {
if (_pm) chk = /\privmsg/.test(location.href);
if (/\/post/.test(location.href) || chk) {
$(toMenu(prefixes)).insertBefore("input[name='subject'][type='text']");
var mw = $("#prefix").width() + 5;
$("input[name='subject']").css("width", $("input[name='subject']").width() - mw);
var t = $("[name='subject']").val();
var cur = checkpre(prefixes, t);
if (cur != "") {
$("[value=" + cur + "]").attr("selected", "selected");
$("input[name='subject']").val(t.replace('[' + cur + ']', '').trim())
}
$("input[name='post']").click(function () {
var sub = $("input[name='subject']").val().trim();
if (sub != "" && $("#prefix").val() != "") $("input[name='subject']").val("[" + $("#prefix").val() + "] " + sub)
})
}
});
Last edited by Babybok on November 10th 2016, 4:37 pm; edited 5 times in total