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.

Ange Tuteur's Reputation bars - Founder's problem

3 posters

Go down

In progress Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 18th 2015, 7:10 pm

I used it, but for the founder account it does not work. I use Phpbb3. it says: 

Code:
<div id="repu" original-title="Reputation's level 0
Next : (undefined)"></div>

undefined.. and level 0?? If the founder has 200 points...
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 18th 2015, 8:25 pm

Hi @Str0ng,

Could you provide an URL to your forum ?

Thanks
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 19th 2015, 11:09 am

Oh yeah! Sorry, is not updated on my profile. But is this: 
http://www.live-the-worldwide.com/



EDITED: I do not know why.. but I changed the permissions of the Points to be seen by guests.. and when I visit the site as guest it is shown.. but when I enter no.

PS: Sorry for my english, I am Spanish XD
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 19th 2015, 8:53 pm

It might be down to your profile field layout. Try replacing your script with this :
Code:
$(function() {
 
  var settings = {
      repName : 'Reputation',
      repStyle : 'block',
      repImage : 'http://i57.servimg.com/u/f57/18/21/41/30/star12.png'
    };
 
  var repLv = {
      lv1 : 1,
      lv2 : 2,
      lv3 : 3,
      lv4 : 4,
      lv5 : 5,
      lv6 : 6,
      lv7 : 7,
      lv8 : 8
    };
 
    if (settings.repStyle.toLowerCase() == 'block') { var repBlock = '<span class="rLv" class="repuBlock">' }
    else if (settings.repStyle.toLowerCase() == 'image') { var repBlock = '<img class="rLv" src="'+settings.repImage+'"/>' }
    else { var repBlock = '<span id="rLv" class="repuBlock">' }
 
    $('.postprofile').each(function() {
        var rep = Number($(this).text().replace(RegExp('.*'+settings.repName+'<\/span>:\\s+(\\d+).*'),'$1'));
        $(this).find('dt').append('<div id="repu">')
        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 + ')');
    });
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 19th 2015, 10:32 pm

This does not worked, this is the code I have:
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 19th 2015, 10:43 pm

try this :
Code:
$(document).ready(function() {
 
  var version = 'phpbb3';
 
  var settings = {
      repName : 'Feeding Points',
      repImage0 : 'http://i.imgur.com/1Lnr1av.png',
      repImage1 : 'http://i.imgur.com/mIKzCOh.png',
      repImage2 : 'http://i.imgur.com/upGbiDk.png',
      repImage3 : 'http://i.imgur.com/6EYRM2l.png',
      repImage4 : 'http://i.imgur.com/YdicLpI.png'
 
    };
 
  var repLv = {
      lv0 : 0,
      lv1 : 100,
      lv2 : 200,
      lv3 : 300,
      lv4 : 500

    };
 
    var ver = { phpbb2 : version.toLowerCase() == 'phpbb2', phpbb3 : version.toLowerCase() == 'phpbb3', punbb : version.toLowerCase() == 'punbb', invision : version.toLowerCase() == 'invision' };
    var reg = new RegExp('.*'+settings.repName+'</span>:\\s+(\\d+).*');
 
  if (ver.phpbb3 || ver.punbb || ver.invision) {
      if (ver.phpbb3 || ver.invision) { var profSel = '.postprofile'; var addRepu = $(this).find('.feedingpoints').append('<span style="color: #EAB85E; font-family: amarante; font-size:11pt!important ;text-shadow: 1px 0 2px #000000, 0 0 3px #1F0603;">Hunger Level: </span><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.lv0) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage0+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv1  }
          if (rep >= repLv.lv1) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage1+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv2  }
          if (rep >= repLv.lv2) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage2+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv3  }
          if (rep >= repLv.lv3) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage3+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv4 }
          if (rep >= repLv.lv4) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage4+'"/>'); var next = 'Maximum!' }
          $(this).find('#repu').attr('title', next);
 
 
      });
    }
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 19th 2015, 11:41 pm

Nothing, now it does not work on any of the profiles. Before it was working to everybody except on mine. And, is possible to make it work for negative numbers? ty for your answers Wink
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 20th 2015, 12:32 am

What's different on your field ? Could you show an image what the label and value of your field looks like ? That should be enough to figure out why it's not working for your profile specifically.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 20th 2015, 12:50 am

On my profile is just the name: 
https://i.imgur.com/RYBMm2e.png

On others.. is the image showing with the tooltip title when hover:
https://i.imgur.com/yZQ5yyq.png

Got what I mean?


Last edited by Str0ng on March 20th 2015, 8:06 am; edited 1 time in total
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 20th 2015, 1:07 am

Without the code what is the value of "hunger level" is it a number or word ?

example :
LABEL : VALUE
Reputation : 15

If the value is not a number, it's most likely what's causing the problem. blackeye
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 20th 2015, 8:05 am

It is a number value. I tried it without the code as well.. and it is a number. The weird thing is that if I give permissions to the field to be seen by guests, then.. it is shown (visiting as a guest) on my profile.. but no when you logged in. 

EDITED: Never mind, I found what was causing it.. it was a code on a field of my profile. Ty!

And for the negative numbers? How can I set them?  Razz
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Ange Tuteur March 20th 2015, 8:35 am

I suppose you could do something like this :
Code:
$(document).ready(function() {
 
  var version = 'phpbb3';
 
  var settings = {
      repName : 'Feeding Points',
      repImageN0 : '', // negative image
      repImage0 : 'http://i.imgur.com/1Lnr1av.png',
      repImage1 : 'http://i.imgur.com/mIKzCOh.png',
      repImage2 : 'http://i.imgur.com/upGbiDk.png',
      repImage3 : 'http://i.imgur.com/6EYRM2l.png',
      repImage4 : 'http://i.imgur.com/YdicLpI.png'
 
    };
 
  var repLv = {
      lvN0 : -10, // negative level
      lv0 : 0,
      lv1 : 100,
      lv2 : 200,
      lv3 : 300,
      lv4 : 500

    };
 
    var ver = { phpbb2 : version.toLowerCase() == 'phpbb2', phpbb3 : version.toLowerCase() == 'phpbb3', punbb : version.toLowerCase() == 'punbb', invision : version.toLowerCase() == 'invision' };
    var reg = new RegExp('.*'+settings.repName+'</span>:\\s+(\\d+).*');
 
  if (ver.phpbb3 || ver.punbb || ver.invision) {
      if (ver.phpbb3 || ver.invision) { var profSel = '.postprofile'; var addRepu = $(this).find('.feedingpoints').append('<span style="color: #EAB85E; font-family: amarante; font-size:11pt!important ;text-shadow: 1px 0 2px #000000, 0 0 3px #1F0603;">Hunger Level: </span><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;
       
          // negative conditions
          if (rep <= repLv.lvN0) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImageN0+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv0  }
       
          // positive conditions
          if (rep >= repLv.lv0) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage0+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv1  }
          if (rep >= repLv.lv1) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage1+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv2  }
          if (rep >= repLv.lv2) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage2+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv3  }
          if (rep >= repLv.lv3) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage3+'"/>'); var next = 'Current: ' + rep + ' / ' + 'Next: ' + repLv.lv4 }
          if (rep >= repLv.lv4) { $(this).find('#repu').html('<img id="rLv" src="'+settings.repImage4+'"/>'); var next = 'Maximum!' }
          $(this).find('#repu').attr('title', next);
 
 
      });
    }
});

I added comments for a brief explanation.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 20th 2015, 9:09 am

Hmmm no Confused

Is like the <= is not recognized properly. 

https://i.imgur.com/4ICsuQO.png

If I put it with equal or higher.. the blue disappears:
https://i.imgur.com/FkWhP7h.png
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Daemon March 27th 2015, 3:09 pm

Something like that?
Code:
$(document).ready(function() {
$('.postprofile dl').each(function() {
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.postprofile dl .post_field:contains("Reputação")').each(function() {
var rep = $(this).text().match(/\d+/g);
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
        $('.title', this).text('Neutro');
        $(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
        $('.title', this).text('Iniciante');
}
else if(rep >= 5 && rep < 10) {
        $('.title', this).text('Membro ativo');
}
else if(rep >= 10) {
        $('.title', this).text('Excelente');
}
});
});

Ange Tuteur's Reputation bars - Founder's problem 63LsD2E
Daemon
Daemon
Forumember

Posts : 104
Reputation : 91
Language : Português

Back to top Go down

In progress Re: Ange Tuteur's Reputation bars - Founder's problem

Post by Str0ng March 28th 2015, 6:44 pm

No, I mean negative numbers..

Reputation: -10
avatar
Str0ng
Forumember

Posts : 55
Reputation : 7
Language : Spanish

http://www.seasonal-trackers.com

Back to top Go down

Back to top

- Similar topics

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