WordPress.org

Support

Support » Plugins and Hacks » Participants Database » [Resolved] Adding a number column to show ranking of each participant?

[Resolved] Adding a number column to show ranking of each participant?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Same question here 🙂
    Any trick?

    OK, first, create a field titled “Rank” (or whatever). This is only for display purposes, you’re going to ignore the value itself. Make this field show up in the list where you want your rank number to appear.

    At the top of your custom list somewhere inside of the PHP tags, but before the line that has $this->have_records() in it, put:

    $rank = 1 + ( $this->pagination->page - 1 ) * $this->page_list_limit;

    In the template, where it has:

    <?php $this->field->print_value() ?>

    Replace it with something like:

    <?php
       if ($this->field->name == 'rank') {
          echo $rank;
          $rank++;
       } else $this->field->print_value();
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Adding a number column to show ranking of each participant?’ is closed to new replies.
Skip to toolbar