![]() |
VB Usergroups Just a quick question. I have PP integrated with VB, can PP Identify Additional Usergroups from VB or is it only the primary usergroup? |
Photopost cycles through all usergroups for permissions. You can create additional usergroups in vb and then in photopost use the resync usergroup feature in edit usergroups set permissions and your good to go. |
Now that's what I thought, but on conditional code I've implemented into uploadphoto.php it's only reading the primary usergroup. I'll have another look to see what I've done wrong. Thanks Chuck. |
You can look at how we do group permissions in pp-inc.php in the function set_group_perms. |
Thanks Chuck, I'm using this conditional if ($User['adminedit'] == 1 || $usergroups == 17 But it only works if 17 is the primary usergroup From what I can see, $usergroups is the correct variable? |
That is not the correct variable and our usergroups is an array $User['usergroups'] |
This area in 'function set_group_perms'. pp-inc.php controls the usergroups settings per category? If I'm reading this correctly it's looking though all the usergroups a member can belong too? I've added an extra option under Admin - Usergroups and I'm trying to display the information from that option to 1 particular usergroup. $User['usergroups'] does not work at all $usergroups does work but only on the primary usergroup. The members that should see the information have the usergroup as an additional usergroup and although I could change that to the primary usergroup, it would cause problems down the line. So I'm trying to find a way to get the code to read all the usergroups the member belongs to to display the information under their additional usergroup. |
Both should work fine. $usergroups actually is all usergroups in vb. We define $mgroups as the usergroup and add the membergroupid's therefore it is an array and the same when we define $User['usergroups'] in the set perms function for the $User array remember those results are an array so any conditional clause needs to search an array you can not simply do a straight conditional. Right from vb3.php Code: Content visible to verified customers only. |
There should be examples here on in_array but you need to do an if clause and use in_array PHP: in_array - Manual Maybe Code: Content visible to verified customers only.Code: Content visible to verified customers only. |
Hi CHuck, I really appreciate your time with this, but I can't get my head around this properly I'm getting this error in_array() [function.in-array]: Wrong datatype for second argument in The 2nd argument being $usergroups, I'm presuming this has to be defined else where in uploadphoto.php to validate the argument So I added this code $usergroups = array("usergroups"); SO I ended up with Code: Content visible to verified customers only.Thanks again Chuck |
Sorry, just seen you edit chuck, I'll have a try with that. |
I have no idea I have never tried it as its not something I ever wanted to try. I was just tossing out ideas saying how our code works. You could probally discuss this at more length in the mod forums. |
I've done several pages of code edits and it all works except for this, and I'm sure it's a lot simpler than I'm making it... I'll take this to the mod discussion and see If anyone can help. Thanks again for your time and detailed explanations - It's very much appreciated ;) |
yeah you will have to post full examples of what your doing and code for people to understand what your doing so they may assist, |
| All times are GMT -5. The time now is 02:58 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0