You will have to add a WHERE clause in there to exclude private categories and forums by checking the forums private status.
I have a simple toggle switch in my database called "showactive" if it is true then we show it, if not we don't. The reason for this is we don't want some forums showing up in external scripts even if they are public like General Chit Chat forums and Member only forums.
|