The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with determining permissions based on forum and userid list
I am trying to determine from a list of users who has access (by my definition) how has "access" to a forum and here is what I have so far but its not working as expected. And it only grabs my current logged in user when it should get more.
Can someone please tell me if the if block in the while loop is really only evaulating to true when the user can view the forum, can reply to posts in the forum and post new messages in the forum? Any help will be most appreciated. Code:
echo('about to run query'); // Pull all userids $get_users = $db->query_read(" SELECT userid FROM " . TABLE_PREFIX . "user "); echo('about to add group users'); while($got_users = $vbulletin->db->fetch_array($get_users)){ $forumperms = fetch_permissions($foruminfo['forumid'],$got_users['userid']); if( ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) && ($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) && ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew']) ) { echo($got_users['userid']); $users .= "" . $got_users['userid'] . ","; } } I got it working!!!!! Here is what I ended up doing, hope it helps someone else! It appears that this board is either cynical or dead Code:
// Pull all userids $get_users = $db->query_read(" SELECT userid FROM " . TABLE_PREFIX . "user "); // Knock all the userids with access together into a list while($got_users = $vbulletin->db->fetch_array($get_users)){ $tmpinfo = fetch_userinfo($got_users['userid']) ; $forumperms = fetch_permissions($foruminfo['forumid'],$got_users['userid'],$tmpinfo); if( ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) && ($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) && ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew']) ) { echo('adding '.$got_users['userid']); $users .= "" . $got_users['userid'] . ","; } } |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|