The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

level raputation

View previous topic View next topic Go down

Solved level raputation

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

how to make level on reputation

ex:
reputation 0
Newbie

reputation 1
Starter

Reputation 10
member

and more
avatar
erchima
Forumember

Female Posts : 629
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 on 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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

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

not changed :/
avatar
erchima
Forumember

Female Posts : 629
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 on 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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

Post by erchima on 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


how to make like it
avatar
erchima
Forumember

Female Posts : 629
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 on 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;
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

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

workkk but
avatar
erchima
Forumember

Female Posts : 629
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 on 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;
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

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

move it
avatar
erchima
Forumember

Female Posts : 629
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 on 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) }
  });
});
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: level raputation

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

Thank you very much :wouhou:you are the best staffloovekiss
avatar
erchima
Forumember

Female Posts : 629
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 on March 28th 2014, 12:22 pm

You're welcome :rose:

Topic solved and archived
avatar
Ange Tuteur
Forumaster

Male Posts : 13174
Reputation : 2872
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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