PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro How Do I...? (http://www.photopost.com/forum/photopost-pro-how-do-i/)
-   -   VB Usergroups (http://www.photopost.com/forum/photopost-pro-how-do-i/138921-vbulletin-usergroups.html)

Simons January 12th, 2009 07:54 AM

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?

Chuck S January 12th, 2009 08:30 AM

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.

Simons January 12th, 2009 09:37 AM

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.

Chuck S January 12th, 2009 10:16 AM

You can look at how we do group permissions in pp-inc.php in the function set_group_perms.

Simons January 12th, 2009 04:55 PM

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?

Chuck S January 12th, 2009 07:18 PM

That is not the correct variable and our usergroups is an array

$User['usergroups']

Simons January 12th, 2009 09:59 PM

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.

Chuck S January 13th, 2009 09:21 AM

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.

Chuck S January 13th, 2009 09:24 AM

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.
or

Code:

Content visible to verified customers only.

Simons January 13th, 2009 10:10 AM

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.
Your probably laughing at this stage, but am I on the right lines with this?

Thanks again Chuck

Simons January 13th, 2009 10:12 AM

Sorry, just seen you edit chuck, I'll have a try with that.

Chuck S January 13th, 2009 11:03 AM

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.

Simons January 13th, 2009 11:15 AM

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 ;)

Chuck S January 13th, 2009 01:01 PM

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97