Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2020-02-16 23:46:01

Vybez
New member
Registered: 2020-02-16
Posts: 4

Unable to fetch category/forum list

Hey, So Im using Fluxbb, and Im trying to setup forums but Im getting the error:Unable to fetch category/forum list
here is the full error message:
An error was encountered
File: /index.php
Line: 78

FluxBB reported: Unable to fetch category/forum list

Database reported: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') LEFT JOIN users AS u ON (f.last_poster=u.username) WHERE fp.read_forum IS NULL' at line 1 (Errno: 1064)

Failed query: SELECT u.group_id, u.id AS uid, c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM categories AS c INNER JOIN forums AS f ON c.id=f.cat_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=) LEFT JOIN users AS u ON (f.last_poster=u.username) WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position

and here is the code on the line that is specified:

$result = $db->query('SELECT u.group_id, u.id AS uid, c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'users AS u ON (f.last_poster=u.username) WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Offline

#2 2020-02-17 02:12:23

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,355
Website

Re: Unable to fetch category/forum list

...ON (fp.forum_id=f.id AND fp.group_id=) LEFT...

No value from $pun_user['g_id']

Offline

#3 2020-02-17 08:48:24

Vybez
New member
Registered: 2020-02-16
Posts: 4

Re: Unable to fetch category/forum list

Sorry Im a new to all this, how would I fix that?

Offline

#4 2020-02-17 11:44:13

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,355
Website

Re: Unable to fetch category/forum list

It is necessary to fill $pun_user array current user data.
At the beginning of each file responsible for a forum page, this is done like this:

define('PUN_ROOT', dirname(__FILE__).'/');
require PUN_ROOT.'include/common.php';

Offline

Board footer

Powered by FluxBB