 | |  | | | Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here. |
March 29th, 2008, 11:40 AM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
| Subalbums not shown in selectbox
pp-inc.php, function catmoveopt.
This is the query to get all albums for a specific user: Code: Content visible to verified customers only.
This query doesn't find subalbums, because they don't have the userid in the "parent" field, but the id of their parent album.
To get this working, album "categories" should also make use of the "children" field to store their children. This would allow to easily grab them without doing some recursive queries to get all children (and their children ..).
|
| |
March 29th, 2008, 12:09 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
I am not following your logic here it just doesnt seem quite right your query above. I am not clear on what your expecting where so please post where you mean exactly but if I edit a photo and select the change category options clearly my subalbums that I have assigned to other albums are listed as well as parent albums and I can move a photo there. I did test this functionality as I saw your post.
The admin options on showphoto category list does not include albums in any manner whether its parent subalbum etc so this would not be a bug to my knowledge it is intentional not to list albums since an admin sees all albums and this can slow down the page. If you hit editphoto you will see all the cats and albums listed which is correct.
The userid of an album is always stored in the parent field always. Children has no place here thats only used to assign an album or category to a category not an album. If you assign an album as a subalbum the actual parent album is listed in the categories table in the subalbum field of your album you just assigned to the parent album. I hope this clarifies the issue as if you check you will see what I am saying here so what your posting is not needed.
If there is something we are not understanding here please explain but the only place in the program that a full cat and album list is found in the program for a user is under editphoto.php and in admin for the admin on all the catmove boxes. The Admin catmove box only shows categories.
|
| |
March 29th, 2008, 03:10 PM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
|
Hi Chuck,
sorry for not being clear enough. I wasn't aware of the subalbums field that stores the parent id.
I'm using a customized call to the catmoveopt() function on my custom upload processing page. I want to display all albums of the current user. It looks like this:
catmoveopt(0,0,0,1);
the useralbums script basically uses the same call to display a selectbox with possible parent albums:
catmoveopt( 0, 0, 0, 1, true, true );
This call doesn't return any subalbums, because it uses the query as described above.
The parameters of the function are a bit misleading. For example, the second parameter "albums" needs to be "0" to display albums. I would expect it the other way round.
If I call it like this:
catmoveopt(0,0,0,1,false, false); // so albumsonly = 1
it basically works, but not for admins. They will get all albums.
If I use:
catmoveopt(0,0,0,1,true, false); // so albumsonly = 1 and onlymine = true
it doesn't display subalbums.
So it's not a real bug, just unexpected behaviour. With the current code, it's not possible to display just all albums of the current user. The function parameters just made me think that it should be possible.
So no bug, sorry for bugging you. Maybe it can be considered as a feature request => refactoring the catmoveopt function.
|
| |
March 29th, 2008, 08:03 PM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
Well the current code works in all aspects that I see by displaying all a users albums for a user or all albums for an admin. maybe you might need to debug your customizations?
|
| |
March 30th, 2008, 06:05 AM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
|
It works for all current use cases in the software, right. Just not as I was expecting it. What I need is basically the selectbox from the editphoto page. This selectbox display the subalbums, as you said. But it displays all users' albums if you have admin rights.
I just want to display all albums of the current user, regardless of the user rights. Anyway, I created a new parameter for that function, so that I can do what I want.
So again, no real bug, just some unexpected behaviour. Your hint regarding the subalbum field was the information I needed to understand what was missing. Thanks for that!
Feel free to move this thread to the suggestion or modification forum.
|
| |
March 30th, 2008, 11:39 AM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
Well personally if I am following what your trying to do your overthinking the issue by trying to add some new option in the function.
If you never want the admin to see other users albums and only want people to see their own stuff its real simply in the catmoveopt you simply change this Code: Content visible to verified customers only.
to say this Code: Content visible to verified customers only.
|
| |
March 30th, 2008, 11:47 AM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
|
That's basically what I did, I just used an additional parameter so that I don't change the default photopost behavior.
|
| |
March 30th, 2008, 11:49 AM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
LOL although this thread tells me you want to change the default behavior go figure |
| |
March 30th, 2008, 12:09 PM
|
#9 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
|
I want to populate a selectbox that doesn't exist in the standard photopost installation. It's on my upload page and allows the user to choose where is uploaded photos should be moved to. One shows all existing categories and another selectbox just shows his albums. I didn't want to change any existing selectbox (editphoto, useralbums). Hopefully, this clears things up a bit. I was just a bit confused about the function parameters, but you convinced me that it is desired that way.
An additional parameter is just easier to maintain during upgrades and an admin should get all albums on the editphoto page.
|
| |
March 30th, 2008, 12:12 PM
|
#10 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
Ah your talking about your hard coded flash or java upload page got ya.
|
| | |
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 | | | All times are GMT -5. The time now is 10:54 AM. | |