The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Topic Prefix problem

View previous topic View next topic Go down

Solved Topic Prefix problem

Post by Babybok on November 7th 2016, 7:28 pm

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

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, 5:58 pm; edited 1 time in total
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 7th 2016, 8:31 pm

Where are you adding the code?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 7th 2016, 8:39 pm



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 3:13 am


Hello @SLGray , The link you provided is the modification of topic, what I mean is this one the drop down list



and adding a CSS to this

http://img.prntscr.com/img?url=http://i.imgur.com/kUKjJyP.png

------------------------------------

@SLGray wrote:Where are you adding the code?

I've added that code into my Javascript, but didn't worked.
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 8th 2016, 3:16 am

Do you have JavaScript Management activated?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 3:35 am

@SLGray wrote:Do you have JavaScript Management activated?

Yes it is activated, I have even 11 Javascripts and 1 is this.
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 8th 2016, 4:05 am

What option do you have selected for the placement?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 4:16 am

In all pages
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 8th 2016, 4:25 am

Try in topics.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 4:27 am

I have already tried it, but still it didn't worked
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 8th 2016, 4:39 am

Please post a link to where you got the code.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 5:14 am

avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 5:34 am

http://asistencia.foroactivo.com/t110856-sistema-de-prefijos-en-el-asunto-de-los-posts

I saw a solution in my problem and it's working but my last problem is how can I make a css with this spanish code to do this onehttp://img.prntscr.com/img?url=http://i.imgur.com/kUKjJyP.png

And how can I code that only moderators and admin can only used the prefix?

Edited:
The last code/link that I've posted is working however if I will edit a post in a topic the prefix will gone, I just wanted my prefix like the " modify topic title" is it posibble?
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 12:59 pm

ChanelW wrote:Hello,

I am glad you found a solution for your issue Smile
Regards to your question about a code for a moderator you will have to create a new topic and request a code for that Razz

Thanks,
ChanelW

Thanks for you help, but I'll just wait for @SLGray for his reply.
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 8th 2016, 2:07 pm

ChanelW wrote:Hello,

No staff member your question you have proposed it is unrelated to this topic, therefore, you must create a new one! Wink

Thanks,
ChanelW :rose:

My questions is still related in my topic mister, as it is still a problem for prefix, scroll up again and read my title. Thanks I'll just wait for SLGray.
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by Babybok on November 10th 2016, 5:59 pm

This is solved alread, thanks for your help. Especially to @SLGray
avatar
Babybok
Forumember

Male Posts : 136
Reputation : 0
Language : Filipino, English
Location : Philippines

http://rl-rp.board.st

Back to top Go down

Solved Re: Topic Prefix problem

Post by SLGray on November 10th 2016, 9:28 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38226
Reputation : 2576
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum