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.

How do I make prefixes for my forum?

View previous topic View next topic Go down

In progress How do I make prefixes for my forum?

Post by Kamui on July 3rd 2015, 1:48 am

When I make a new topic, I'd like some options for different prefixes like

[Hunter]
[Assassin]
[Vagabond]

Kamui
Forumember

Male Posts : 280
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by JScript on July 3rd 2015, 3:38 am

@Kamui

Try this:

In your ACP: Modules -> HTML&JAVASCRIPT -> JavaScript codes management -> [Create a new JavaScript]
Title *: <- Whatever you want
Placement : <- In all the pages
Javascript Code * : <- Select, copy and paste the code below in this field:
Code:

function tagprefixo() {
    jQuery('input[name=subject]').val(jQuery('select[name=tags4]').val() + jQuery('input[name=subject]').val());
};
jQuery(document).ready(function () {
    var sHtmlPrefx =
        '<select name="tags4" onchange="tagprefixo()">' +
            '<option value="">' +
                '(sem prefixo)' +
            '</option>' +
            '<option value="[Apresentacao]">' +
                'Apresentação' +
            '</option>' +
            '<option value="[Download]">' +
                'Download' +
            '</option>' +
            '<option value="[Duvida]">' +
                'Dúvida' +
            '</option>' +
            '<option value="[Dica]">' +
                'Dica' +
            '</option>' +
            '<option value="[Evento]">' +
                'Evento' +
            '</option>' +
            '<option value="[Entrega]">' +
                'Entrega' +
            '</option>' +
            '<option value="[Filme]">' +
                'Filme' +
            '</option>' +
            '<option value="[Game]">' +
                'Game' +
            '</option>' +
            '<option value="[Imagem]">' +
                'Imagem' +
            '</option>' +
            '<option value="[Noticia]">' +
                'Notícia' +
            '</option>' +
            '<option value="[Offtopic]">' +
                'Offtopic' +
            '</option>' +
            '<option value="[Pedido]">' +
                'Pedido' +
            '</option>' +
            '<option value="[Recado]">' +
                'Recado' +
            '</option>' +
            '<option value="[Regras]">' +
                'Regras' +
            '</option>' +
            '<option value="[Sugestao]">' +
                'Sugestão' +
            '</option>' +
            '<option value="[Seriado]">' +
                'Seriado' +
            '</option>' +
            '<option value="[Tutorial]">' +
                'Tutorial' +
            '</option>' +
            '<option value="[Video]">' +
                'Vídeo' +
            '</option>' +
        '</select>&nbsp;<img src="http://illiweb.com/fa/wysiwyg/separator.png" style="vertical-align:middle">&nbsp;';
    try {
        jQuery('input[name=subject]').after(sHtmlPrefx);
        var mode = jQuery('input[value=reply]').val();
        if (mode == 'reply') {
            jQuery('select[name=tags4]').css('display', 'none');
        } else if (mode == 'quote') {
            jQuery('select[name=tags4]').css('display', 'none');
        }
   } catch (e) {
      if (typeof (console) != 'undefined') {
         console.error(e)
      }
   }   
});

You only need to edit what is bold as shown below:

'<option value="[Apresentacao]">' +
'Apresentação' +
'</option>' +

Result:


JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by Pizza Boi on July 3rd 2015, 9:21 pm

Hi Very Happy

@JScript : Is it possible if we design it with CSS? If so, can you please state where I can add an ID/class for them? 

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by JScript on July 3rd 2015, 11:21 pm

@Pizza Boi
Use this:

select[name="tags4"] {
        property_name: value;
}

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by Kamui on July 4th 2015, 1:13 am

@Jscript

It works great, only question now is, how do I change the name of this?



Kamui
Forumember

Male Posts : 280
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by SLGray on July 4th 2015, 1:15 am

This is the part where you change the titles:

Code:
<option value="[Game]">' +
                'Game' +


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


SLGray
Administrator
Administrator

Male Posts : 36648
Reputation : 2443
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by Kamui on July 4th 2015, 1:26 am

Not that, talking about the (sem prefixo)

Kamui
Forumember

Male Posts : 280
Reputation : 3
Language : English
Location : Greed Island

http://narutogaiden.forumotion.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by Pizza Boi on July 4th 2015, 4:49 am

Hi Very Happy

@JScript : What if I want to set it a specific page? I'm sorry I'm not good in Javascript so sorry for bothering you. Also, I want to style each of the options differently and I don't know where exactly to add an individual class for it Sad.

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: How do I make prefixes for my forum?

Post by SLGray on July 4th 2015, 5:06 am

Do you mean this:
Code:
<option value="">' +
                '(sem prefixo)' +
            '</option>' +


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


SLGray
Administrator
Administrator

Male Posts : 36648
Reputation : 2443
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