Scandal
Well-known member
Hello all!
Well, I want to fetch some threads via the well known finder \XF::finder('XF:Thread').
If I wanted to fetch threads based on the permission of current visitor, I would use this:
But, what about if I want statically to fetch threads like a guest? I mean, threads that only forum guests (not logged in) can see.
I want to use that code on a cron job, so I don't want to take into account permissions based on logged in visitor. Only guests.
Any idea of what to apply on the Finder?
Well, I want to fetch some threads via the well known finder \XF::finder('XF:Thread').
If I wanted to fetch threads based on the permission of current visitor, I would use this:
PHP:
$visitor = \XF::visitor();
// [...]
$threads = \XF::finder('XF:Thread')->with('Forum.Node.Permissions|' . $visitor->permission_combination_id);
But, what about if I want statically to fetch threads like a guest? I mean, threads that only forum guests (not logged in) can see.
I want to use that code on a cron job, so I don't want to take into account permissions based on logged in visitor. Only guests.
Any idea of what to apply on the Finder?