About reputation bar
2 posters
Page 1 of 1
About reputation bar
Hi guys, Im using reputation bar by @ange tuteur and its a great code btw thanks for sharing this great code/script ange & other people who contribute for that code.
what i want here ...
1. it is possible to make the green bar becomes red bar when it comes to minus points? with the same level from the green bar. anyone can help me how to do the code things for this? See the example pic below for the red bar minus reputation
and the last.. if this too much please skip this
2. it is possible to change the description of the green bar per level.
Example : the green bars description showing Reputation 1 ( Next : 1/500 ) , can we just change the description to like this : Reputation 1 ( +Username+ has starting to become famous now ) Or see the pic below for the example
Note : the bar reputation code by ange is little bit from mine, im using the code from luffy to suit the FAE template. Here's the code
what i want here ...
1. it is possible to make the green bar becomes red bar when it comes to minus points? with the same level from the green bar. anyone can help me how to do the code things for this? See the example pic below for the red bar minus reputation
- Spoiler:
and the last.. if this too much please skip this
2. it is possible to change the description of the green bar per level.
Example : the green bars description showing Reputation 1 ( Next : 1/500 ) , can we just change the description to like this : Reputation 1 ( +Username+ has starting to become famous now ) Or see the pic below for the example
- Spoiler:
Note : the bar reputation code by ange is little bit from mine, im using the code from luffy to suit the FAE template. Here's the code
- Code:
$(document).ready(function() {
var version = 'phpbb3';
var settings = {
repName : 'Reputation',
repStyle : 'block',
repImage : 'https://i.servimg.com/u/f57/18/21/41/30/star12.png'
};
var repLv = {
lv1 : 1,
lv2 : 500,
lv3 : 750,
lv4 : 1000,
lv5 : 3000,
lv6 : 5000,
lv7 : 7500,
lv8 : 9000,
lv9 : 10000,
lv10 : 15000
};
if (settings.repStyle.toLowerCase() == 'block') { var repBlock = '<span id="rLv" class="repuBlock">' }
else if (settings.repStyle.toLowerCase() == 'image') { var repBlock = '<img id="rLv" src="'+settings.repImage+'"/>' }
else { var repBlock = '<span id="rLv" class="repuBlock">' }
var ver = { phpbb2 : version.toLowerCase() == 'phpbb2', phpbb3 : version.toLowerCase() == 'phpbb3', punbb : version.toLowerCase() == 'punbb', invision : version.toLowerCase() == 'invision' };
var reg = new RegExp('.*'+settings.repName+'\\s+:\\s+(\\d+).*');
if (ver.phpbb3 || ver.punbb || ver.invision) {
if (ver.phpbb3 || ver.invision) { var profSel = '.postprofile'; var addRepu = $(this).find('dt').append('<div id="repu">'); }
else if (ver.punbb) { var profSel = '.user'; var addRepu = $(this).find('.user-ident').prepend('<div id="repu">'); }
$(profSel).each(function() {
var rep = Number($(this).text().replace(reg,'$1'));
addRepu;
if (rep >= repLv.lv1) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2 }
if (rep >= repLv.lv2) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3 }
if (rep >= repLv.lv3) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv4 }
if (rep >= repLv.lv4) {$(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv5 }
if (rep >= repLv.lv5) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv6 }
if (rep >= repLv.lv6) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv7 }
if (rep >= repLv.lv7) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv8 }
if (rep >= repLv.lv8) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv9 }
if (rep >= repLv.lv9) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv10 }
if (rep >= repLv.lv10) { $(this).find('#repu').append(repBlock); var next = 'MAX' }
$(this).find('#repu').attr('title','Reputation ' + $(this).find('#rLv').length + '\nNext: (' + next + ')');
});
}
else if (ver.phpbb2) {
$('td .postdetails.poster-profile').each(function() {
var rep = Number($(this).text().replace(reg,'$1'));
$(this).parent().find('.name').next().after('<div id="repu">');
if (rep >= repLv.lv1) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2 }
if (rep >= repLv.lv2) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3 }
if (rep >= repLv.lv3) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv4 }
if (rep >= repLv.lv4) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv5 }
if (rep >= repLv.lv5) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv6 }
if (rep >= repLv.lv6) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv7 }
if (rep >= repLv.lv7) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv8 }
if (rep >= repLv.lv8) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv9 }
if (rep >= repLv.lv9) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv10 }
if (rep >= repLv.lv10) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv11 }
if (rep >= repLv.lv11) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv12 }
if (rep >= repLv.lv12) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv13 }
if (rep >= repLv.lv13) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv14 }
if (rep >= repLv.lv14) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv15 }
if (rep >= repLv.lv15) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv16 }
if (rep >= repLv.lv16) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv17 }
if (rep >= repLv.lv17) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv18 }
if (rep >= repLv.lv18) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv19 }
if (rep >= repLv.lv19) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv20 }
if (rep >= repLv.lv20) { $(this).parent().find('#repu').append(repBlock); var next = 'MAX' }
$(this).parent().find('#repu').attr('title','Reputation level ' + $(this).parent().find('#rLv').length + '\nNext : (' + next + ')');
});
}
});
Last edited by ArmorKiller on December 10th 2018, 5:38 pm; edited 1 time in total
Re: About reputation bar
You have to focus to these lines
Demo HERE
- Code:
if (rep >= repLv.lv10) { $(this).find('#repu').append(repBlock); var next = 'MAX' }
$(this).find('#repu').attr('title','Reputation ' + $(this).find('#rLv').length + '\nNext: (' + next + ')');
- Code:
if (rep >= repLv.lv1) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2 }
- Code:
if (rep >= repLv.lv1) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2; var text = 'text-you-want-1' ; }
- Code:
if (rep >= repLv.lv2) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3; var text = 'text-you-want-2' ; }
- Code:
$(this).find('#repu').attr('title','Reputation ' + $(this).find('#rLv').length + '\nNext: (' + next + ')');
- Code:
$(this).find('#repu').attr('title', 'Reputation level ' + $(this).find('#rLv').length + '\n' + text + '\nNext : (' + next + ')');
Demo HERE
Re: About reputation bar
SarkZKalie wrote:You have to focus to these linesFirst of all, search and locate
- Code:
if (rep >= repLv.lv10) { $(this).find('#repu').append(repBlock); var next = 'MAX' }
$(this).find('#repu').attr('title','Reputation ' + $(this).find('#rLv').length + '\nNext: (' + next + ')');Replace by
- Code:
if (rep >= repLv.lv1) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2 }
Do the same thing to others, for example :
- Code:
if (rep >= repLv.lv1) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2; var text = 'text-you-want-1' ; }
Next step, replace this one
- Code:
if (rep >= repLv.lv2) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3; var text = 'text-you-want-2' ; }
by
- Code:
$(this).find('#repu').attr('title','Reputation ' + $(this).find('#rLv').length + '\nNext: (' + next + ')');
- Code:
$(this).find('#repu').attr('title', 'Reputation level ' + $(this).find('#rLv').length + '\n' + text + '\nNext : (' + next + ')');
Demo HERE
Thanks SarkZKalie! it works great so far..
but i've changed my mind to remove the level system description, how to do it? i mean like this :
thats example level 10 reputation, i already delete some script but it appears some script still there and its showing to be
" 0 " on every level. how to remove that?
and last thing, is it possible to make the green bar becomes red bar when someone have minus reputation with the same system above? ( sorry if this too much to ask )
Re: About reputation bar
Recommend to redo your changes, back to default main script. Do not touch anything if you don't how to play with it.
What are you talking about level system description thing?
1) If it was Reputation level x, simply do search this one
What are you talking about level system description thing?
1) If it was Reputation level x, simply do search this one
- Code:
$(this).find('#repu').attr('title', 'Reputation level ' + $(this).find('#rLv').length + '\n' + text + '\nNext : (' + next + ')');
- Code:
$(this).find('#repu').attr('title', text + '\nNext : (' + next + ')');
Re: About reputation bar
SarkZKalie wrote:Recommend to redo your changes, back to default main script. Do not touch anything if you don't how to play with it.
What are you talking about level system description thing?
1) If it was Reputation level x, simply do search this oneAnd replace by
- Code:
$(this).find('#repu').attr('title', 'Reputation level ' + $(this).find('#rLv').length + '\n' + text + '\nNext : (' + next + ')');
2) This reputation system don't have a minus point thing, so you have to ask its creator.
- Code:
$(this).find('#repu').attr('title', text + '\nNext : (' + next + ')');
thanks for the last script thats how i want! thank you so much Mr.SarkZKalie, problem solved. Da best!
GBU
Re: About reputation bar
Problem solved & topic archived.
|
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum