 | |  | | | Photopost Pro How Do I...? Wondering how to do things in PhotoPost? |
January 12th, 2009, 07:54 AM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
| 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?
|
| |
January 12th, 2009, 08:30 AM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
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.
|
| |
January 12th, 2009, 09:37 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
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.
|
| |
January 12th, 2009, 10:16 AM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
You can look at how we do group permissions in pp-inc.php in the function set_group_perms.
|
| |
January 12th, 2009, 04:55 PM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
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?
|
| |
January 12th, 2009, 07:18 PM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
That is not the correct variable and our usergroups is an array
$User['usergroups']
|
| |
January 12th, 2009, 09:59 PM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
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.
|
| |
January 13th, 2009, 09:21 AM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
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.
|
| |
January 13th, 2009, 09:24 AM
|
#9 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
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.
|
| |
January 13th, 2009, 10:10 AM
|
#10 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
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
|
| |
January 13th, 2009, 10:12 AM
|
#11 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
Sorry, just seen you edit chuck, I'll have a try with that.
|
| |
January 13th, 2009, 11:03 AM
|
#12 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
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.
|
| |
January 13th, 2009, 11:15 AM
|
#13 (permalink)
| | Member Verified Customer
Join Date: Jan 2007
Posts: 126
|
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 |
| |
January 13th, 2009, 01:01 PM
|
#14 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,699
|
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,
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | Different time for usergroups!? | hubix | Classifieds Bug Reports | 3 | November 20th, 2006 09:46 AM | | Usergroups being ignored | peytondunn2712 | Photopost Pro Installation & Upgrades | 3 | January 27th, 2006 02:43 PM | | UserGroups | M Gravlee | General Discussion | 2 | January 26th, 2006 03:33 PM | | Usergroups | whitetigergrowl | Photopost Pro How Do I...? | 7 | December 8th, 2005 01:22 PM | | Trying to Create Usergroups | emgrueber | Photopost Pro Installation & Upgrades | 4 | November 8th, 2004 11:36 PM | All times are GMT -5. The time now is 01:30 PM. | |