1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Forum #295 Preparations for thread/topic filtering.

This commit is contained in:
Cameron
2016-05-22 11:58:27 -07:00
parent e15469e806
commit 00c640626d
3 changed files with 19 additions and 4 deletions

View File

@@ -1818,7 +1818,7 @@ class e107forum
* @param $view
* @return array
*/
function forumGetThreads($forumId, $from, $view)
function forumGetThreads($forumId, $from, $view, $filter = null)
{
$e107 = e107::getInstance();
$sql = e107::getDb();
@@ -1830,6 +1830,14 @@ class e107forum
LEFT JOIN `#user` AS u ON t.thread_user = u.user_id
LEFT JOIN `#user` AS lpu ON t.thread_lastuser = lpu.user_id
WHERE t.thread_forum_id = {$forumId}
";
if(!empty($filter))
{
$qry .= " AND ".$filter;
}
$qry .= "
GROUP BY thread_id
ORDER BY
t.thread_sticky DESC,