The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How do I make prefixes for my forum?

4 posters

Go down

In progress How do I make prefixes for my forum?

Post by Kamui July 3rd 2015, 12:48 am

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

[Hunter]
[Assassin]
[Vagabond]
Kamui
Kamui
Forumember

Male Posts : 291
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 July 3rd 2015, 2: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://2img.net/i/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:
How do I make prefixes for my forum? Captur20

JS
JScript
JScript
Forumember

Male Posts : 741
Reputation : 175
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 July 3rd 2015, 8: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
Pizza Boi
Hyperactive

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

Back to top Go down

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

Post by JScript July 3rd 2015, 10:21 pm

@Pizza Boi
Use this:

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

JS
JScript
JScript
Forumember

Male Posts : 741
Reputation : 175
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 July 4th 2015, 12:13 am

@Jscript

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


How do I make prefixes for my forum? Prefix10
Kamui
Kamui
Forumember

Male Posts : 291
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 July 4th 2015, 12:15 am

This is the part where you change the titles:

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


How do I make prefixes for my forum? Slgray10

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

Male Posts : 51489
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

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

Post by Kamui July 4th 2015, 12:26 am

Not that, talking about the (sem prefixo)
Kamui
Kamui
Forumember

Male Posts : 291
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 July 4th 2015, 3: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
Pizza Boi
Hyperactive

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

Back to top Go down

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

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

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


How do I make prefixes for my forum? Slgray10

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

Male Posts : 51489
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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