Total Number of Items in Album for guests

iearn

Joined: 2006-12-20
Posts: 22
Posted: Fri, 2007-05-11 14:39

Hi,

I am using g2 and in our theme we display the total number of items in our gallery. It is actually just showing the number of items in our main/root album. This is the current code we are using in our theme.inc

list ($ret, $ItemCounts) = GalleryCoreApi::fetchItemizedDescendentCounts(array(1481));

if (!empty($ItemCounts)){
$theme['numberofactivities'] = $ItemCounts['1481']['GalleryDataItem'];
} else {
$theme['numberofactivities'] = "0";
}

This code shows number of items that the user is allowed to see. However we are using this is a "teaser" to non-logged in users to see how many items are in our gallery. Therefore the code above does not work as we desire. For example if I am not logged in it might say 70 but when I am logged in it shows 998. Is there a way I can get the number I want via the API? What would I have to do get this number to display the same for all users?

Thanks,
iEARN