Please upgrade here. These earlier versions are no longer being updated and have security issues.

[Solved] user list plugin : random users not working

ChanuxChanux Admin of Geek.lk ✭✭
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 Themester ✭✭✭
    Accepted 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!

    Pamela

Answers

  • jspautschjspautsch Themester ✭✭✭
    Accepted 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!

    Pamela
  • ChanuxChanux Admin of Geek.lk ✭✭

    @jspautsch wow its working. thank you so much

Sign In or Register to comment.