Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] user list plugin : random users not working

ChanuxChanux ✭✭
edited March 2012 in Vanilla 2.0 - 2.8

im using user list plugin. random user not working. always displaying same users. how can i fix

Best Answer

  • jspautschjspautsch ✭✭✭
    Answer ✓

    Looks like he forgot to include the OrderBy. Open up class.userlistmodule.php and find the following statement...

    $this->Users = $SQL
            ->Select($Select)
            ->From($From)
            ->Join('UserRole r','u.UserID = r.UserID')
            ->Where($Where)
            ->Get();

    ...then add a line to make it look like this:

    $this->Users = $SQL
            ->Select($Select)
            ->From($From)
            ->Join('UserRole r','u.UserID = r.UserID')
            ->Where($Where)
            ->OrderBy($Order)
            ->Get();

    See if that works!

Answers

  • jspautschjspautsch ✭✭✭
    Answer ✓

    Looks like he forgot to include the OrderBy. Open up class.userlistmodule.php and find the following statement...

    $this->Users = $SQL
            ->Select($Select)
            ->From($From)
            ->Join('UserRole r','u.UserID = r.UserID')
            ->Where($Where)
            ->Get();

    ...then add a line to make it look like this:

    $this->Users = $SQL
            ->Select($Select)
            ->From($From)
            ->Join('UserRole r','u.UserID = r.UserID')
            ->Where($Where)
            ->OrderBy($Order)
            ->Get();

    See if that works!

  • @jspautsch wow its working. thank you so much

Sign In or Register to comment.