ok, I think that I got it right way now:
// Make sure guests can see this board.
$request = $db->query('', '
SELECT id_board, num_topics
FROM {db_prefix}boards
WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
AND ') . 'FIND_IN_SET(-1, member_groups) != 0
LIMIT 1',
array(
'current_board' => $board,
)
);
if ($db->num_rows($request) == 0)
{
if ($output_method == 'echo')
die($txt['ssi_no_guests']);
else
return array();
}
list ($board, $num_topics) = $db->fetch_row($request);
$db->free_result($request);
$total_news_items = $num_topics;