A)Please read: http://wppa.opajaap.nl/members/ containing a full explanation of this topic and how it is currently implemented.
Especially the shortcode arguments album="#owner,#me" and album="#upldr,#me" will have your interest.
B)Enable backend upload on Table VII-A under Upload photos. They will get a menu item in the admin sidebar.
Make sure you ticked the box Owners only in Table VII-D1 to make sure they only upload in their own albums. If you want to allow them to edit name and description etc, tick Table VII-D2
Thread Starter
odp123
(@odp123)
OK, so far so good. Backend upload is enabled for the single users.
But regarding the shortcode I am having a little bit of a problem.
To be able to use a shortcode in php I am using <?php echo do_shortcode(); ?>
#owner,#me does not return any gallery and #upldr,#me return the album of the currently logged in user, as you explain. But what I want to achieve is to return the gallery of the ‘author’ regardless of who is logged in or not.
What I am looking for is something in the lines of:
<?php
$user = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
do_shortcode('[wppa type="album" album="$user->ID,0"][/wppa]');
?>
So fetch the user information based on user id and store in array $user, then use $user->author_name or $user->ID in shortcode to fetch the users gallery regardless of who is logged in
If the author is the owner of the album ( the one who created the album ) you can use his login name in ( example for login name joe ):
[wppa type=”cover” album=”#owner,joe”][/wppa]
so:
do_shortcode('[wppa type="cover" album="#owner,'.$user->ID.'"][/wppa]');
If you want to display the photos uploaded by joe use:
[wppa type=”album” album=”#upldr,joe”][/wppa]
so:
do_shortcode('[wppa type="album" album="#upldr,'.$user->ID.'"][/wppa]');
If you want to show all the photos that are in albums created by joe ( so the photos need not to be uploaded by him ):
[wppa type=”album” album=”#owner,joe”][/wppa]
so:
do_shortcode('[wppa type="album" album="#owner,'.$user->ID.'"][/wppa]');
Thread Starter
odp123
(@odp123)
here is my code
<?php
echo $curauth->user_login; //outputs test2. user album name is called test2
echo do_shortcode('[wppa type="cover" album="#owner,'.$curauth->user_login.'"][/wppa]');
?>
There is one photo in the gallery test2 but the result is “No albums or photos found matching your search criteria.”
Thread Starter
odp123
(@odp123)
got it THANKS!
echo do_shortcode('[wppa type="cover" album="#owner,'.$curauth->user_login.'"][/wppa]');
If you want to use the album name, you can use it with a leading $-sign:
[wppa type="cover" album="$test2"][/wppa]
This is case sensitive!
The number of photos must be > the setting in Table I-A4
Thread Starter
odp123
(@odp123)
marking this as solved. Thanks