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.

level raputation

2 posters

Go down

Solved level raputation

Post by erchima Fri Mar 28, 2014 4:53 am

how to make level on reputation

ex:
reputation 0 
Newbie

reputation 1
Starter

Reputation 10
member

and more
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 5: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.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima Fri Mar 28, 2014 5:16 am

not changed :/
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 5: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.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima Fri Mar 28, 2014 5: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
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 5: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;
}
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima Fri Mar 28, 2014 5:42 am

workkk but
level raputation AxbCA2s
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 5: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;
}
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima Fri Mar 28, 2014 6:00 am

move it
level raputation ZDJ0DTk
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 6:12 am

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) }
    });
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima Fri Mar 28, 2014 6:18 am

Thank you very much  :wouhou: you are the best staff  loove  kiss
erchima
erchima
Forumember

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

http://erchimacute.forumid.net

Back to top Go down

Solved Re: level raputation

Post by Ange Tuteur Fri Mar 28, 2014 6:22 am

You're welcome :rose:

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top


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