vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Question about usergroup filtering (https://vborg.vbsupport.ru/showthread.php?t=236790)

DJ29Joesph 02-24-2010 03:37 PM

Question about usergroup filtering
 
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:

Code:

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


All times are GMT. The time now is 07:57 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01039 seconds
  • Memory Usage 1,702KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete