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.

Fixed reputation (to be modified by admins only)

Go down

Solved Fixed reputation (to be modified by admins only)

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

Hello and goodmorning to you! Smile

I've followed Ange's tutorial just now installing the reputation bar (https://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
avatar
Guest
Guest


Back to top Go down

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

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Guest 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!
avatar
Guest
Guest


Back to top Go down

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

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

Will you be using this as a warning system ?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Guest 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.
avatar
Guest
Guest


Back to top Go down

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

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Guest 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: https://help.forumotion.com/t74247-translucent-warning-bars  .

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


Back to top Go down

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

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

Create a profile field with the following content. ( You can change the name to what you want )
Fixed reputation (to be modified by admins only) Captu237
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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

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

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

Fixed reputation (to be modified by admins only) Snow-1
Valkyrie
Fixed reputation (to be modified by admins only) TranslucentWarningBars-100
Admin

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

Fixed reputation (to be modified by admins only) Icon_user_profile Fixed reputation (to be modified by admins only) Icon_contact_pm Fixed reputation (to be modified by admins only) Icon_contact_email Fixed reputation (to be modified by admins only) Icon_contact_www
OK, that seems to be working, but now it shows "Rep: 5" as well. How can we hide that?
avatar
Guest
Guest


Back to top Go down

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

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

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

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

Yay!

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


Back to top Go down

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

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

You're welcome ^^

Topic archived

Happy holidays santa
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top


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