Change
// If you want to limit it to one category, enter the category number here
// If you want to use all categories, set it to 0
$category = 0 ;
to
// If you want to limit it to one board, enter the category number here
// If you want to use all boards, set it to 0
$board = 0 ;
And change
AND $user_info[query_see_board] " .
($category > 0 ? "AND ID_CAT = $category" : "")
. " ORDER BY RAND() LIMIT $limit", __FILE__, __LINE__);
to
AND $user_info[query_see_board] " .
($board > 0 ? "AND b.ID_BOARD = $board" : "")
. " ORDER BY RAND() LIMIT $limit", __FILE__, __LINE__);