LatestPostsList with filter?

  • App
    WoltLab Suite Forum

    Hi all,


    I got a question regarding the lastPostList class,
    There is no filter for boardid's the only thing it can output is a list of threads where the user has access to.


    maybe it's an idea to modify the class so a custom filter can be specified (ig. to use in the dashboard boxes)


    from:

    Code
    public function __construct() {


    and


    Code
    $boardIDs = Board::getAccessibleBoardIDs(array('canViewBoard', 'canEnterBoard'));


    to:

    Code
    public function __construct($filter = null) {


    and


    Code
    if (is_null($filter)) {
                $boardIDs = Board::getAccessibleBoardIDs(array('canViewBoard', 'canEnterBoard'));
            } else {
                $boardIDs = $filter;
            }
    }
  • Great idea, I would like this small modification a lot.
    I already use this for my wbb3 and it's missing in wbb4.

    • Official Post

    You can add additional constraints using the condition builder:


    Code
    $latestPostsList = new LatestPostsList();
    $latestPostsList->getConditionBuilder()->add('thread.boardID IN (?)', array($arrayWithBoardIDs));

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!