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.
The forum of the forums
4 posters

    How do I make prefixes for my forum?

    Kamui
    Kamui
    Forumember


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

    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]
    JScript
    JScript
    Forumember


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

    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
    Pizza Boi
    Pizza Boi
    Hyperactive


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

    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
    JScript
    JScript
    Forumember


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

    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
    Kamui
    Kamui
    Forumember


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

    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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.
    Kamui
    Kamui
    Forumember


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

    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)
    Pizza Boi
    Pizza Boi
    Hyperactive


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

    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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.

      Current date/time is September 22nd 2024, 11:34 pm