PDA

View Full Version : Question about usergroup filtering


DJ29Joesph
02-24-2010, 03:37 PM
Ok, I have this plugin that shows when a user post a reply or post a new thread on my forums. The problem is I can't enable the admin forums to be shown as members would be able to see it. I then thought about it and looked through the database and seen that theirs a table called "forumpermission". I noticed that for whatever forumid it was it had usergroupid and then permission for that forumid. After looking through and confirming my results, anything that has "forumpermissions" set to '0', means they can't read or see the forum. So obviously I need a sql query to display the information something like:


SELECT u.usergroupid, p.usergroupid, p.forumpermissions, p.forumid FROM from " . TABLE_PREFIX . "forumpermission p
LEFT JOIN " . TABLE_PREFIX . "user u on (u.usergroupid = p.usergroupid)
WHERE p.forumpermissions > 0


the question is now that its only showing things via forumpermissions, what if condition can I use to show it only to the usergroup that has forumpermissions > 0 or even just the admin usergroup.

Thanks