Participants Database
[resolved] Adding a number column to show ranking of each participant? (3 posts)

  1. Reptar7
    Posted 3 years ago #

    Is there a way that I can have a column in the table that ranks each participant. So like the top row would be 1, second row 2, third row 3, etc.

    I don't want this to be a field for signup. It is just a ranking that shows up in the table depending on how things are sorted.


  2. franc3s
    Posted 3 years ago #

    Same question here :)
    Any trick?

  3. xnau webdesign
    Plugin Author

    Posted 3 years ago #

    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:

       if ($this->field->name == 'rank') {
          echo $rank;
       } else $this->field->print_value();

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Participants Database
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.