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
$(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) }
});
});
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'
};
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.
$(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) }
});
});
#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;
}
#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;
}
$(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) }
});
});