cleaned up the code
This commit is contained in:
@@ -7,35 +7,19 @@ require_once ROOT_DIR.'/model/forum/Thread.php';
|
||||
require_once ROOT_DIR.'/model/forum/User.php';
|
||||
require_once ROOT_DIR.'/model/forum/Reply.php';
|
||||
|
||||
$boardTable = DBBoard::getBoards();
|
||||
$threadsTable = [];
|
||||
$usersTable = [];
|
||||
$boards = [];
|
||||
$threads = [];
|
||||
$boards = DBBoard::getBoards();
|
||||
$users = [];
|
||||
foreach ($boardTable as $row)
|
||||
$threads = [];
|
||||
$threadUsers = [];
|
||||
foreach ($boards as $board)
|
||||
{
|
||||
$threadsTable = array_merge($threadsTable, DBThread::getThreadsByBoard($row['ID']));
|
||||
array_push($boards, new Board($row['ID'], $row['name'], $row['permLevel']));
|
||||
$threads = array_merge($threads, DBThread::getThreadsByBoard($board->getId()));
|
||||
}
|
||||
foreach($threads as $thread)
|
||||
{
|
||||
array_push($users, DBUser::getUserByUID($thread->getUserID()));
|
||||
}
|
||||
foreach($threadsTable as $row)
|
||||
{
|
||||
|
||||
array_push($threads, new Thread($row['ID'],$row['users_ID'],$row['board_ID'],$row['title'],$row['text'],$row['date_created']));
|
||||
array_push($usersTable, DBUser::getUserByUID($row['users_ID']));
|
||||
|
||||
}
|
||||
foreach($usersTable as $row){
|
||||
$skipUser = false;
|
||||
foreach($users as $user){
|
||||
if($row->getId() == $user->getId()){
|
||||
$skipUser = true;
|
||||
}
|
||||
}
|
||||
if(!$skipUser){
|
||||
array_push($users, $row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user