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.

Fixed reputation (to be modified by admins only)

View previous topic View next topic Go down

Solved Fixed reputation (to be modified by admins only)

Post by Guest on December 17th 2014, 9:05 am

Hello and goodmorning to you! Smile

I've followed Ange's tutorial just now installing the reputation bar (http://help.forumotion.com/t132299-add-a-bar-for-reputation#888421), but I want it fixed so that one starts with 100% and admins can control it, Forumotion style. How do I do that?

Sam.


Last edited by SamanthaS on December 19th 2014, 11:17 am; edited 1 time in total

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 17th 2014, 9:03 pm

Hello @Samantha,

Do you mean that members start with a set reputation count, and then you subtract it ? You can set the default reputation here : Modules > Reputation > Default value

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Guest on December 17th 2014, 9:22 pm

Hi Ange and thanks (I won't be calling you baby cuz you ain't Razz ). Hey, could you be a bit more precise on that please. I tried that. I got a points and reputation system installed as well. So, if you could please give he exact insight to what you meant, this tall blonde 'd be very pleased tonight yk, ty!

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 17th 2014, 9:45 pm

Will you be using this as a warning system ?

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Guest on December 17th 2014, 9:46 pm

@Ange Tuteur wrote:Will you be using this as a warning system ?


Indeed, Forumotion style if you can. I'd like to start with 100%, increments by 20. Dropped down to 0% is a ban to me.

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 17th 2014, 10:14 pm

I think you already know, but on the support we use a profile field. ( Topic )

However, if you want to use this script for that you could do something like this :
Go to Administration Panel > Modules > Reputation

Set the default value to 5. Then change your script to this :
Code:
$(document).ready(function() {
  
  var version = 'phpbb3';
  
  var settings = {
      repName : 'Reputation',
      repImage1 : '100% image',
      repImage2 : '80% image',
      repImage3 : '60% image',
      repImage4 : '40% image',
      repImage5 : '20% image',
      repImage6 : '0% image'
    };
  
  var repLv = {
      lv1 : 5,
      lv2 : 4,
      lv3 : 3,
      lv4 : 2,
      lv5 : 1,
      lv6 : 0,
    };
  
    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+).*');
 
   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').html('<img src="'+settings.repImage1+'"/>') }
          if (rep >= repLv.lv2) { $(this).find('#repu').html('<img src="'+settings.repImage2+'"/>') }
          if (rep >= repLv.lv3) { $(this).find('#repu').html('<img src="'+settings.repImage3+'"/>') }
          if (rep >= repLv.lv4) { $(this).find('#repu').html('<img src="'+settings.repImage4+'"/>') }
          if (rep >= repLv.lv5) { $(this).find('#repu').html('<img src="'+settings.repImage5+'"/>') }
          if (rep >= repLv.lv6) { $(this).find('#repu').html('<img src="'+settings.repImage6+'"/>') }
      });
    }
});

Fill in the fields as needed.

Now if you're going to use Reputation as the warning system you need to remove it from use of normal members. Or you could create a new number field that only moderators or administrators can modify.

Let me know what you want to use.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Guest on December 18th 2014, 7:55 am

Yeah, I think I should go with that last option, but I'm not sure. In fact I'm very much confused now! :/ I've got things installed now (JS and CSS) when I stumbled upon your tutorial.

I want to be able to set member's reputation as a warning system to members in their profiles using these perhaps: http://help.forumotion.com/t74247-translucent-warning-bars  .

What should I do next? Remove your tutorial JS and CSS and start over using what?

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 18th 2014, 11:25 pm

Create a profile field with the following content. ( You can change the name to what you want )

Make sure to replace the content after saving.

Then create a new script with this :
Placement : In the topics
Code:
$(document).ready(function() {
  
  var version = 'phpbb3';
  
  var settings = {
      repName : 'Rep',
      repImage1 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-100.png',
      repImage2 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-80.png',
      repImage3 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-60.png',
      repImage4 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-40.png',
      repImage5 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-20.png',
      repImage6 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-0.png'
    };
  
  var repLv = {
      lv1 : 5,
      lv2 : 4,
      lv3 : 3,
      lv4 : 2,
      lv5 : 1,
      lv6 : 0,
    };
  
    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+).*');
 
   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').html('<img src="'+settings.repImage1+'"/>') }
          if (rep == repLv.lv2) { $(this).find('#repu').html('<img src="'+settings.repImage2+'"/>') }
          if (rep == repLv.lv3) { $(this).find('#repu').html('<img src="'+settings.repImage3+'"/>') }
          if (rep == repLv.lv4) { $(this).find('#repu').html('<img src="'+settings.repImage4+'"/>') }
          if (rep == repLv.lv5) { $(this).find('#repu').html('<img src="'+settings.repImage5+'"/>') }
          if (rep == repLv.lv6) { $(this).find('#repu').html('<img src="'+settings.repImage6+'"/>') }
      });
    }
});

Change rep to the name of your field.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Guest on December 19th 2014, 8:22 am


Valkyrie

Admin

Rep:  5 <------
Aantal berichten:  1
Punten:  36
Registratiedatum:  14-11-14


OK, that seems to be working, but now it shows "Rep: 5" as well. How can we hide that?

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 19th 2014, 10:11 am

Replace your script with this :
Code:
$(document).ready(function() {
 
  var version = 'phpbb3';
 
  var settings = {
      repName : 'Rep',
      repImage1 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-100.png',
      repImage2 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-80.png',
      repImage3 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-60.png',
      repImage4 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-40.png',
      repImage5 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-20.png',
      repImage6 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-0.png'
    };
 
  var repLv = {
      lv1 : 5,
      lv2 : 4,
      lv3 : 3,
      lv4 : 2,
      lv5 : 1,
      lv6 : 0,
    };
 
    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+).*'), regex = new RegExp('<span class="label"><span style="color:#.*?;">'+settings.repName+'</span>: </span> \\d+<br>');
 
  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').html('<img src="'+settings.repImage1+'"/>') }
          if (rep == repLv.lv2) { $(this).find('#repu').html('<img src="'+settings.repImage2+'"/>') }
          if (rep == repLv.lv3) { $(this).find('#repu').html('<img src="'+settings.repImage3+'"/>') }
          if (rep == repLv.lv4) { $(this).find('#repu').html('<img src="'+settings.repImage4+'"/>') }
          if (rep == repLv.lv5) { $(this).find('#repu').html('<img src="'+settings.repImage5+'"/>') }
          if (rep == repLv.lv6) { $(this).find('#repu').html('<img src="'+settings.repImage6+'"/>') }
          $(this).html($(this).html().replace(regex,''));
      });
    }
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Guest on December 19th 2014, 11:16 am

Yay!

Het werkt! Dank je wel, Ange! (Dutch) Wink
It works! Thank you, Ange!

Guest
Guest


Back to top Go down

Solved Re: Fixed reputation (to be modified by admins only)

Post by Ange Tuteur on December 19th 2014, 11:20 am

You're welcome ^^

Topic archived

Happy holidays santa

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

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