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.
The forum of the forums
+2
SarkZKalie
flapflap
6 posters

    Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    flapflap
    flapflap
    New Member


    Posts : 9
    Reputation : 1
    Language : English

    Solved Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by flapflap 2/7/2017, 19:16

    Hello
    that's my new acc in here cuz I've forgotted the last 1 my forum is u can see it on my profil. So anyway
    After a few years break I've came and changed my forum to ModernBB & I would like n appriciate more new stuff(tips n tricks) for it. I've liked this Add a bar for Reputation so I've tried it but it does nothing
    Code:
    $(document).ready(function() {
     
      var version = 'modernbb';
     
      var settings = {
          repName : 'Reputation',
          repStyle : 'image',
          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 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 = { modernbb : version.toLowerCase() == 'modernbb', 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.modernbb || ver.phpbb3 || ver.punbb || ver.invision) {
          if (ver.modernbb || 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').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 + ')');
          });
        }
        else if (ver.phpbb2) {
          $('td .postdetails.poster-profile').each(function() {
              var rep = Number($(this).text().replace(reg,'$1'));
              $(this).parent().find('.name').next().after('<div id="repu">');
              if (rep >= repLv.lv1) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2  }
              if (rep >= repLv.lv2) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3  }
              if (rep >= repLv.lv3) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv4  }
              if (rep >= repLv.lv4) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv5  }
              if (rep >= repLv.lv5) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv6  }
              if (rep >= repLv.lv6) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv7  }
              if (rep >= repLv.lv7) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv8  }
              if (rep >= repLv.lv8) { $(this).parent().find('#repu').append(repBlock); var next = 'MAX'  }
              $(this).parent().find('#repu').attr('title','Reputation level ' + $(this).parent().find('#rLv').length  + '\nNext : (' + next + ')');
          });
        }
    });

    Check the tutorial n tell me what I have to change to work
    btw I need 10 levels but I think the problem is not this so far


    Last edited by flapflap on 5/7/2017, 12:56; edited 1 time in total
    SarkZKalie
    SarkZKalie
    Support Moderator
    Support Moderator


    Male Posts : 1442
    Reputation : 220
    Language : English

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by SarkZKalie 2/7/2017, 20:37

    I summon you @Ange Tuteur Twisted Evil
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by Ange Tuteur 3/7/2017, 02:54

    Hi,

    Use the following script ; it's updated to support modernbb, so someone should update this tutorial with it.
    Code:
    $(document).ready(function() {
     
      var version = 'modernbb';
     
      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,
          lv9 : 9,
          lv10 : 10
        };
     
      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', modernbb : version.toLowerCase() == 'modernbb' };
        var reg = new RegExp('.*'+settings.repName+'\\s+:\\s+(\\d+).*');
     
      if (ver.phpbb3 || ver.punbb || ver.invision || ver.modernbb) {
          if (ver.phpbb3 || ver.invision || ver.modernbb) { 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').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 = rep + '/' + repLv.lv9 }
              if (rep >= repLv.lv9) { $(this).find('#repu').append(repBlock); var next = rep + '/' + repLv.lv10 }
              if (rep >= repLv.lv10) { $(this).find('#repu').append(repBlock); var next = 'MAX' }
              $(this).find('#repu').attr('title','Reputation level ' + $(this).find('#rLv').length + '\nNext : (' + next + ')');
          });
        }
        else if (ver.phpbb2) {
          $('td .postdetails.poster-profile').each(function() {
              var rep = Number($(this).text().replace(reg,'$1'));
              $(this).parent().find('.name').next().after('<div id="repu">');
              if (rep >= repLv.lv1) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv2  }
              if (rep >= repLv.lv2) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv3  }
              if (rep >= repLv.lv3) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv4  }
              if (rep >= repLv.lv4) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv5  }
              if (rep >= repLv.lv5) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv6  }
              if (rep >= repLv.lv6) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv7  }
              if (rep >= repLv.lv7) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv8  }
              if (rep >= repLv.lv8) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv9  }
              if (rep >= repLv.lv9) { $(this).parent().find('#repu').append(repBlock); var next = rep + '/' + repLv.lv10  }
              if (rep >= repLv.lv10) { $(this).parent().find('#repu').append(repBlock); var next = 'MAX'  }
              $(this).parent().find('#repu').attr('title','Reputation level ' + $(this).parent().find('#rLv').length  + '\nNext : (' + next + ')');
          });
        }
    });
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by SLGray 4/7/2017, 02:02

    Thanks @Ange Tuteur!
    I have added the script to the tutorial.



    Add a bar for Reputation by Ange Tuteur for my ModernBB forum Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    flapflap
    flapflap
    New Member


    Posts : 9
    Reputation : 1
    Language : English

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by flapflap 5/7/2017, 01:43

    Yeah works fine ! Thank you.
    Just 1 question how can I add 1px or so gap between pictures? or easiest to edit the picture Very Happy
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19325
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by Ape 5/7/2017, 17:17

    yes you can find this part on your CSS files
    Code:
    .repuBlock
    at the bottom i think it is you will see some thing like this
    Code:
    margin: 0 0.5px;
    just change the 5 to say 6 to 7



    Add a bar for Reputation by Ange Tuteur for my ModernBB forum Left1212Add a bar for Reputation by Ange Tuteur for my ModernBB forum Center11Add a bar for Reputation by Ange Tuteur for my ModernBB forum Right112
    Add a bar for Reputation by Ange Tuteur for my ModernBB forum Ape_b110
    Add a bar for Reputation by Ange Tuteur for my ModernBB forum Ape1010
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Solved Re: Add a bar for Reputation by Ange Tuteur for my ModernBB forum

    Post by Draxion 5/7/2017, 22:07

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules

      Current date/time is 23/9/2024, 03:24