Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:09:26+00:00 2026-06-08T20:09:26+00:00

Using PunBB on Forumotion the idea was to use the Points system to replace

  • 0

Using PunBB on Forumotion the idea was to use the Points system to replace the number of points displayed with a string of text. Using a span class I first defined a class ‘honorpoints’ around the code that shows the number of points a user has.

<span class="honorpoints"><!-- BEGIN profile_field -->{postrow.displayed.profile_field.CONTENT}<!-- END profile_field --></span>

When using that code on the forums it will display a number, based on a user’s points, next to their username. The following jQuery code was what I tried to use to replace the number.

$(".honorpoints").each(function(){
    var elm = $(this);
    var number = parseFloat(elm.text(), 10);
    if (number >= 1 && number <= 500) {
        state = "rank 1";
    } else if (number >= 500 && number < 3000) {
        state = "rank 2";
    }
    elm.text(state);
});

However, this doesn’t do anything and the numbers are still there. It’s supposed to replace UserA : 234 and UserB : 571 with UserA : rank 1 and UserB : rank 2. The code does work however when used on jsFiddle and when working with solely numbers instead of the {postrow.displayed.profile_field.CONTENT} code.
Help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:09:27+00:00Added an answer on June 8, 2026 at 8:09 pm

    Looking at the source of the page you provided in your comment, I believe your $('.honorpoints').each method is being called before the document is fully loaded (99546.js). Unless I’m missing something, you need to wrap that method in a $(document).ready function so it’s executed only once the DOM is ready:

    $(document).ready(function() {
        $(".honorpoints").each(function(){
            var elm = $(this);
            var number = parseFloat(elm.text(), 10);
            var state = "";
            if (number >= 1 && number <= 500) {
                state = "rank 1";
            } else if (number >= 500 && number < 3000) {
                state = "rank 2";
            }
            elm.text(state);
        });
    });
    

    I also added a declaration for the state variable since it’s a good practice (as it currently is in your question, the state variable is actually window.state because it was not previously declared).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CI for the first time and i'm smashing my head with this seemingly
Using import datetime in python, is it possible to take a formatted time/date string
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
Using the HTML5 File API I can get the Binary String representation of a
I'm integrating punBB into my existing site. Is it better to continue using one
I'm using TinyMCE to provide users the capability of simple text formatting (bold, italics,
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using C#, I need a class called User that has a username, password, active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.