• Hi!

    Is there any way to have statistics shortcode, like “We currently have [total_photos] photos in our database in [total_categories] categories.”

    Also my previus shortcode would be nice: now I have a random photo form the latest album, but a name of that album to be fetched with link would be a good idea.

    Also a question regarding the II.E settings table: I would like to show on every cover the total of sub categories (if there are any) and a total of photos in all what is inside. That works OK (but the word “and” would be nice, like “Show XX categories AND XX photos”) for parent albums, but in the SUBalbum there is no info about the subsubalbums, only the number of photos in the SUBalbum… Any hints?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Is there any way to have statistics shortcode, like “We currently have [total_photos] photos in our database in [total_categories] categories.”

    This you can do in php (e.g. on a page template):

    
    <?php 
    if ( function_exists('wppa_albums') ) { // Make sure wppa is activated
    	$total_photo_count = wppa_get_photo_count(); 
    	$catlist = wppa_get_catlist();
    	$total_cats_count = is_array( $catlist ) ? count( $catlist ) : '0';
    	echo 'We currently have ' . $total_photo_count . ' photos in our database in ' . $total_cats_count . ' categories';
    }
    ?>
    
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Also my previus shortcode would be nice: now I have a random photo form the latest album, but a name of that album to be fetched with link would be a good idea.

    
    <?php
    if ( function_exists( 'wppa_get_random_photo_id_from_youngest_album' ) ) {
    	$photo = wppa_get_random_photo_id_from_youngest_album();
    	if ( $photo ) {
    		echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="photo" photo="' . $photo . '"][/wppa]' ) );
    	}
    	$album = wppa_get_photo_item( $photo, 'album' );
    	$page = 1234 // Change this into the page number where the link has to end
    	echo 'View the album <a href="' . wppa_get_album_url( $album, $page, 'content', '1' ) . '" >' . wppa_get_album_name( $album ) . '</a> of this photo';
    }
    ?>
    

    This shows something like:

    View the album Album name of this photo

    Note: it is assumed that the first wppa shortcode on the target page is:

    [wppa type="landing"][/wppa]

    If this shortcode is e.g. the third, change the function call into:

    
    wppa_get_album_url( $album, $page, 'content', '3' )
    
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Also a question regarding the II.E settings table: I would like to show on every cover the total of sub categories (if there are any) and a total of photos in all what is inside. That works OK (but the word “and” would be nice, like “Show XX categories AND XX photos”) for parent albums, but in the SUBalbum there is no info about the subsubalbums, only the number of photos in the SUBalbum… Any hints?

    Categories are for albums like tags for photos.
    Categories can appear cross all albums, there is no hierarchical relation between them, nor are they limited to appear inside a album-sub-sub-album tree.
    This is why “I would like to show on every cover the total of sub categories” i do not see the reasoning of this. i.e. i just do not get what you mean here.
    You can show the total number of sub albums and total number of photos in the entire tree below any album on the album cover if you select detailed in Table II-E5 and have Table II-E4 ticked.

    Note: changimng the number of photos will get the treecounts recalculated at the background, so it may take a few minutes and pageloads before the updated numbers will be displayed.

    Thread Starter bodzio16

    (@bodzio16)

    1) Did the trick! I confused the categories with albums, but I changed the function, and added the proper plurar / singlurar “photo / photos” funtion. Thanks!
    2) Did the trick, but I can’t think of the shortcode for the photo to open in a lightbox…
    3) I confused the categories with albums. OK, it works when “detailed” is chosen, but then it says like “View 17 albums (448) and 0 photos (8690)” And I would like to show “View TOTAL albums and TOTAL photos”. When changed to “totals only” it shows the totals in the parent album, but in the subsubalbum it shows ONLY the total of photos in all cildren even when it has few albums in it.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I can’t think of the shortcode for the photo to open in a lightbox…

    That is not possible. Lightbox can only be opened by a click on an image.

    When changed to “totals only” it shows the totals in the parent album, but in the subsubalbum it shows ONLY the total of photos in all cildren even when it has few albums in it.

    Sounds buggy. I will get into this.

    Thread Starter bodzio16

    (@bodzio16)

    I can’t think of the shortcode for the photo to open in a lightbox…

    That is not possible. Lightbox can only be opened by a click on an image.

    Yes, but what shortcode has a link to do so? “photo”? “mphoto”? Can’t get it working.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    If you want it to work on “photo” set Table VI-B3a to lightbox.
    If you want it to work on “mphoto” set Table VI-B4a to lightbox.

    Thread Starter bodzio16

    (@bodzio16)

    Checked, when you are deep in few albums is won’t show on the cover the number of childalbums in the child album, only number of total photos in all childalbums.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Verified. Problem reproduced. Will be fixed in 6.6.16

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Statistics’ is closed to new replies.