AndrewSimm
Well-known member
I am working on a add-on that is more a less a player database. I would like to display a list of recent threads posted about the particular player on the profile page, which is also a part of my add-on. My question is, how should I approach pulling threads that contain the players names? I know the code below works, but I am sure there is a much more efficient way to generate this list.
Any suggestions on how this should be done?
Any suggestions on how this should be done?
PHP:
$fullname_thread_search = "%" . $player->fullname . "%";
$repo = $this->repository('XF:Thread');
$finder = $repo->findLatestThreads();
$threads = $finder->where('title','like', $fullname_thread_search)
->with("Forum.Node.Permissions|{$visitor->permission_combination_id}")
->fetch(10);