Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Javascript] IPB Reputation box v2



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  Shadow

avatar
Administrator
Administrator
Description:
This tutorial will improve the functionalities of default reputation box and add ranks based on post numbers.

Installation steps:

- Javascript
Add the following code to the Javascript:
Placement: In Topics

Code:
[panda=js]jQuery(document).ready(function(){
                jQuery('.user-info .post_field:contains("Reputation")').attr('style','background-color: #dff0d8;
    border-radius: 3px;
    color: #3c763d;
    display: block;
    font-weight: 700;
    margin: 0 auto 5px;
    max-width: 123px;
    padding: 3px 8px;
    text-align: center;');
jQuery(document).ready(function(){
                jQuery('.user-info .post_field:contains("Reputation: 0")').attr('style','background-color:  rgb(222, 222, 222);
    border-radius: 3px;
    color: #6e6e6e;
    display: block;
    font-weight: 700;
    margin: 0 auto 5px;
    max-width: 123px;
    padding: 3px 8px;
    text-align: center;');
 });

   $('.user-info .post_field:contains("Reputation")').each(function(){var rep=$(this).text().match(/\d+/g);$(this).append('<span class="title" style="font-weight:normal"></span>');
        if(rep==0){$(this).find('.title').text('\nNeutral')}
        if(rep>=1&&rep<10){$(this).find('.title').text('\nNewbie')}
        if(rep>=10&&rep<30){$(this).find('.title').text('\nGetting used to fame')}
        if(rep>=30&&rep<50){$(this).find('.title').text('\nBrilliant future')}
        if(rep>=50&&rep<100){$(this).find('.title').text('\nEveryone admire you')}
        if(rep>=100&&rep<200){$(this).find('.title').text('\nHonored elite ')}
        if(rep>=200){$(this).find('.title').text('\nBeyond famous')}})});

Explanation:  [ic]if(rep>=1&&rep<10)[/ic] // means if user have less than 10 reputation points they will have Newbie rank.
[ic] if(rep>=10&&rep<30){$(this).find('.title').text('\nGetting used to fame')}[/ic] If user have less than 30 reputation points they will have "getting used to fame' rank.

You are free to edit for your needs.

IMPORTANT change [ic]Reputation[/ic] and [ic]Reputation: 0[/ic] field to your language if it's not on English


Preview:






Forum Administrator, Coolyou,
Due to the volume of PMs I receive, I do not provide support via PM.
We have community forums for most support requests. If it's truly confidential, please do PM me.

Useful links:
-> Before asking question,  please use a Search option.
-> If you want to check our staff members click here.
->  Forum rules, this is a MUST READ thread.
->  FAQ (Frenquently asked questions)

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

2
Offline

  Andrei34

avatar
Punbb Rookie
Punbb Rookie
Good tutorial.

Powered by PunBB
Currently 0 users have thanked Andrei34 for this post:

3
Offline

  aEEk.#

avatar
Punbb Rookie
Punbb Rookie
how can u put images in jscript like a level system ? I mean to replace Newbie text with a image etc.

Powered by PunBB
Currently 0 users have thanked aEEk.# for this post:

4
Offline

  Grandfather

avatar
Newbie
Newbie
Very good.

Powered by PunBB
Currently 0 users have thanked Grandfather for this post:

5
Offline

  Sponsored content



Powered by PunBB
Currently 0 users have thanked Sponsored content for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML

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