level raputation
2 posters
Page 1 of 1
level raputation
how to make level on reputation
ex:
reputation 0
Newbie
reputation 1
Starter
Reputation 10
member
and more
ex:
reputation 0
Newbie
reputation 1
Starter
Reputation 10
member
and more
Re: level raputation
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 :
So it works, you must change the following :
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.
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.
Re: level raputation
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.
Re: level raputation
not modifiedAnge 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.
its work but like it
how to make like it
Re: level raputation
Replace your script with :
Add this to your CSS :
- 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;
}
Re: level raputation
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;
}
Re: level raputation
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) }
});
});
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum