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
2 posters

    level raputation

    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved level raputation

    Post by erchima March 28th 2014, 10:53 am

    how to make level on reputation

    ex:
    reputation 0 
    Newbie

    reputation 1
    Starter

    Reputation 10
    member

    and more
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 11:07 am

    Hello erchima,

    You can try this :
    Administration panel > modules > javascript codes management > create a new script

    Title : what you wish
    Placement : in the topics
    Paste the code below and save :
    Code:
    $(document).ready(function() {
        
        var repName = 'Reputation';
        var repLv = {
           lv1 : 1,
           lv2 : 2,
           lv3 : 3,
           lv4 : 4,
           lv5 : 5,
           lv6 : 6,
           lv7 : 7,
           lv8 : 8
        };
        var repLvName = {
           lv1 : 'level 1',
           lv2 : 'level 2',
           lv3 : 'level 3',
           lv4 : 'level 4',
           lv5 : 'level 5',
           lv6 : 'level 6',
           lv7 : 'level 7',
           lv8 : 'level 8'
        };
        
        $('.user').each(function() {
           var reg = new RegExp ('.*'+repName+': (\\d+).*');
           var rep = Number($(this).text().replace(reg,'$1'));
           $(this).find('.user-ident').prepend('<div id="repu">');
           if (rep >= repLv["lv1"]) { $(this).find('#repu').text(repLvName.lv1) }
           if (rep >= repLv["lv2"]) { $(this).find('#repu').text(repLvName.lv2) }
           if (rep >= repLv["lv3"]) { $(this).find('#repu').text(repLvName.lv3) }
           if (rep >= repLv["lv4"]) { $(this).find('#repu').text(repLvName.lv4) }
           if (rep >= repLv["lv5"]) { $(this).find('#repu').text(repLvName.lv5) }
           if (rep >= repLv["lv6"]) { $(this).find('#repu').text(repLvName.lv6) }
           if (rep >= repLv["lv7"]) { $(this).find('#repu').text(repLvName.lv7) }
           if (rep >= repLv["lv8"]) { $(this).find('#repu').text(repLvName.lv8) }
        });
    });

    So it works, you must change the following :
    Code:
       var repName = 'Reputation';
        var repLv = {
           lv1 : 1,
           lv2 : 2,
           lv3 : 3,
           lv4 : 4,
           lv5 : 5,
           lv6 : 6,
           lv7 : 7,
           lv8 : 8
        };
        var repLvName = {
           lv1 : 'level 1',
           lv2 : 'level 2',
           lv3 : 'level 3',
           lv4 : 'level 4',
           lv5 : 'level 5',
           lv6 : 'level 6',
           lv7 : 'level 7',
           lv8 : 'level 8'
        };

    Change repName = 'Reputation' to the name of your rep field. If Reputation is rep change it to :
    repName = 'Rep';

    For repLv, the numbers are the amount of rep points it takes to reach the next level.

    repLvName is the name of the levels achieved.
    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved Re: level raputation

    Post by erchima March 28th 2014, 11:16 am

    not changed :/
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 11:18 am

    Have you modified your posting profile in the templates ? If so I would need to see a topic directly on your forum to modify the code for your template.
    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved Re: level raputation

    Post by erchima March 28th 2014, 11:26 am

    Ange Tuteur wrote:Have you modified your posting profile in the templates ? If so I would need to see a topic directly on your forum to modify the code for your template.
    not modified
    its work but like it
    level raputation IREezuW

    how to make like it
    level raputation YoLTmfc
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 11:36 am

    Replace your script with :
    Code:
    $(document).ready(function() {
        
        var repName = 'Reputation';
        var repLv = {
           lv1 : 1,
           lv2 : 2,
           lv3 : 3,
           lv4 : 4,
           lv5 : 5,
           lv6 : 6,
           lv7 : 7,
           lv8 : 8
        };
        var repLvName = {
           lv1 : 'level 1',
           lv2 : 'level 2',
           lv3 : 'level 3',
           lv4 : 'level 4',
           lv5 : 'level 5',
           lv6 : 'level 6',
           lv7 : 'level 7',
           lv8 : 'level 8'
        };
        
        $('.user').each(function() {
           var reg = new RegExp ('.*'+repName+': (\\d+).*');
           var rep = Number($(this).text().replace(reg,'$1'));
           $(this).find('.user-ident').prepend('<div id="repu">');
           if (rep >= repLv["lv1"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv1) }
           if (rep >= repLv["lv2"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv2) }
           if (rep >= repLv["lv3"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv3) }
           if (rep >= repLv["lv4"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv4) }
           if (rep >= repLv["lv5"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv5) }
           if (rep >= repLv["lv6"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv6) }
           if (rep >= repLv["lv7"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv7) }
           if (rep >= repLv["lv8"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv8) }
        });
    });

    Add this to your CSS :
    Code:
    #repu {
        color:#fff;
        text-align:center;
        font-weight:bold;
        background:#8B3;
        box-shadow:0px 16px 6px rgba(255,255,255,0.1) inset;
        border-radius:4px;
        padding:3px;
    }
    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved Re: level raputation

    Post by erchima March 28th 2014, 11:42 am

    workkk but
    level raputation AxbCA2s
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 11:44 am

    Adjust its margin :
    Code:
    #repu {
        color:#fff;
        text-align:center;
        font-weight:bold;
        background:#8B3;
        box-shadow:0px 16px 6px rgba(255,255,255,0.1) inset;
        border-radius:4px;
        padding:3px;
        margin:6px auto;
    }
    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved Re: level raputation

    Post by erchima March 28th 2014, 12:00 pm

    move it
    level raputation ZDJ0DTk
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 12:12 pm

    Replace your javascript with :
    Code:
    $(document).ready(function() {
        
        var repName = 'Reputation';
        var repLv = {
           lv1 : 1,
           lv2 : 2,
           lv3 : 3,
           lv4 : 4,
           lv5 : 5,
           lv6 : 6,
           lv7 : 7,
           lv8 : 8
        };
        var repLvName = {
           lv1 : 'level 1',
           lv2 : 'level 2',
           lv3 : 'level 3',
           lv4 : 'level 4',
           lv5 : 'level 5',
           lv6 : 'level 6',
           lv7 : 'level 7',
           lv8 : 'level 8'
        };
        
        $('.user').each(function() {
           var reg = new RegExp ('.*'+repName+': (\\d+).*');
           var rep = Number($(this).text().replace(reg,'$1'));
           $(this).find('.label:contains('+repName+')').before('<div id="repu">');
           var reg2 = new RegExp ('<span class="label">'+repName+': </span>\\d+<br>');
           $(this).html($(this).html().replace(reg2,''));
           if (rep >= repLv["lv1"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv1) }
           if (rep >= repLv["lv2"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv2) }
           if (rep >= repLv["lv3"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv3) }
           if (rep >= repLv["lv4"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv4) }
           if (rep >= repLv["lv5"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv5) }
           if (rep >= repLv["lv6"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv6) }
           if (rep >= repLv["lv7"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv7) }
           if (rep >= repLv["lv8"]) { $(this).find('#repu').html('Reputation: '+rep+'<br>'+repLvName.lv8) }
        });
    });
    erchima
    erchima
    Forumember


    Female Posts : 627
    Reputation : 15
    Language : INDONESIAN | Lua Script | Visual Basic | and Coding
    Location : Under your bed xD

    Solved Re: level raputation

    Post by erchima March 28th 2014, 12:18 pm

    Thank you very much  :wouhou: you are the best staff  loove  kiss
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: level raputation

    Post by Ange Tuteur March 28th 2014, 12:22 pm

    You're welcome :rose:

    Topic solved and archived

      Current date/time is November 14th 2024, 1:07 pm