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.

reputation bar not working

2 posters

Go down

Solved reputation bar not working

Post by Manameh April 25th 2014, 11:20 am

https://help.forumotion.com/t132299-add-a-bar-for-reputation

doesn't seem to work for me. I think it's because of where it has been displayed.

I'd like it to be displayed after Rep if that's possible.

reputation bar not working G5KaZxe

forum is phpbb3, link: http://naruhina.lovediscussion.net/


Last edited by Manameh on April 25th 2014, 12:26 pm; edited 1 time in total
Manameh
Manameh
Forumember

Posts : 31
Reputation : 2
Language : English

http://naruhina.lovediscussion.net/

Back to top Go down

Solved Re: reputation bar not working

Post by Ange Tuteur April 25th 2014, 12:20 pm

Have you changed this part in the script ?

repName : 'Reputation',

to that of your rep fields name :

repName : 'Rep',
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: reputation bar not working

Post by Manameh April 25th 2014, 12:25 pm

it worked! thanks. I'm very clumsy. Razz

Now i want it to go below "Rep" instead of the username. Very Happy
Manameh
Manameh
Forumember

Posts : 31
Reputation : 2
Language : English

http://naruhina.lovediscussion.net/

Back to top Go down

Solved Re: reputation bar not working

Post by Ange Tuteur April 25th 2014, 12:53 pm

Here,

Change your script to :
Code:
$(document).ready(function() {
  
  var version = 'phpbb3';
  
  var settings = {
      repName : 'Rep',
      repStyle : 'block',
      repImage : 'http://i57.servimg.com/u/f57/18/21/41/30/star12.png'
    };
  
  var repLv = {
      lv1 : 1,
      lv2 : 5,
      lv3 : 10,
      lv4 : 20,
      lv5 : 40,
      lv6 : 65,
      lv7 : 80,
      lv8 : 100
    };
  
    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+(\\d+).*');
    var replace = new RegExp('(<span class="label"><span style="color:#[0-9a-f]+;">' + settings.repName + '</span>:\\s</span>\\s\\d+<br>)','i');
 
  if (ver.phpbb3) {
      $('.postprofile').each(function() {
          var rep = Number($(this).text().replace(reg,'$1'));
          $(this).html($(this).html().replace(replace,'$1<div id="repu"></div>'));
          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 = 'MAX' }
          $(this).find('#repu').attr('title','Reputation level ' + $(this).find('#rLv').length + '\nNext : (' + next + ')');
      });
    }
});

I reworked it to place the reputation bar after the rep field for phpbb3. Just replace your current script with the above and you should be good Very good
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: reputation bar not working

Post by Manameh April 25th 2014, 1:12 pm

Thanks a lot! I appreciate your time. You're an excellent scripter. luv 

Solved!
Manameh
Manameh
Forumember

Posts : 31
Reputation : 2
Language : English

http://naruhina.lovediscussion.net/

Back to top Go down

Solved Re: reputation bar not working

Post by Ange Tuteur April 25th 2014, 1:14 pm

You're welcome and thanks I love you

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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