-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathForum.php
More file actions
38 lines (29 loc) · 872 Bytes
/
Forum.php
File metadata and controls
38 lines (29 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Copyright (C) 2015-2019 FeatherBB
* based on code by (C) 2008-2015 FluxBB
* and Rickard Andersson (C) 2002-2008 PunBB
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
*/
namespace FeatherBB\Model\Api;
use FeatherBB\Core\Error;
use FeatherBB\Core\Interfaces\Hooks;
class Forum extends Api
{
public function display($id)
{
$forum = new \FeatherBB\Model\Forum();
Hooks::bind('model.forum.get_info_forum_query', function ($curForum) {
$curForum = $curForum->select('f.num_posts');
return $curForum;
});
try {
$data = $forum->getForumInfo($id);
} catch (Error $e) {
return $this->errorMessage;
}
$data = $data->asArray();
$data['moderators'] = unserialize($data['moderators']);
return $data;
}
}