/** * Either prints all of the galleries tgs as a UL list or a cloud * * @param string $option "cloud" for tag cloud, "list" for simple list * @param string $class CSS class * @param string $sort "results" for relevance list, "random" for random ordering, otherwise the list is alphabetical * @param bool $counter TRUE if you want the tag count within brackets behind the tag * @param bool $links set to TRUE to have tag search links included with the tag. * @param int $maxfontsize largest font size the cloud should display * @param int $maxcount the floor count for setting the cloud font size to $maxfontsize * @param int $mincount the minimum count for a tag to appear in the output * @param int $limit set to limit the number of tags displayed to the top $numtags * @param int $minfontsize minimum font size the cloud should display * @param bool $exclude_unassigned True or false if you wish to exclude tags that are not assigne to any item (default: true) * @param bool $checkaccess True or false (default: false) if you wish to exclude tags that are assigned to items (or are not assigned at all) the visitor is not allowed to see * Beware that this may cause overhead on large sites. Usage of the static_html_cache is strongely recommended then. * @since 1.1 */
function printAllTagsAs($option, $class = », $sort = NULL, $counter = FALSE, $links = TRUE, $maxfontsize = 2, $maxcount = 50, $mincount = 10, $limit = NULL, $minfontsize = 0.8, $exclude_unassigned = true, $checkaccess = false)
{
$tagcount = getAllTagsCount($exclude_unassigned, $checkaccess) { // in functions.php:1124
$sql = "SELECT DISTINCT tags.name, tags.id, (SELECT COUNT(*) FROM ‘obj_to_tag’ as object WHERE object.tagid = tags.id) AS count FROM ‘tags’ as tags ORDER BY `name`";
while ($tag = db_fetch_assoc($tagresult)) { if($checkaccess) {
$count = getTagCountByAccess($tag) {
$hideimages = getNotViewableImages() { // in functions.php:1539
if (is_null($_zp_not_viewable_image_list)) { $sql = ‘SELECT `id` FROM ‘images’ WHERE `show`= 0 OR albumid=id1 OR albumid=id2…’
$_zp_not_viewable_image_list = array();
while ($row = db_fetch_assoc($result))
$_zp_not_viewable_image_list[] = $row[‘id’];
}
return $_zp_not_viewable_image_list;
};
if (is_null($_zp_object_to_tags)) { $sql = "SELECT tagid, type, objectid FROM " . prefix(‘obj_to_tag’) …;
$_zp_object_to_tags = query_full_array($sql);
}
foreach($_zp_object_to_tags as $tagcheck) { // functions.php:1196
if ($tagcheck[‘tagid’] == $tag[‘id’]) {
if (!in_array($tagcheck[‘objectid’], $hideimages)) $count++; } } // foreach
return $count;
}; // getTagCountByAccess($tag)
} // if($checkaccess)
} // while
}; // getAllTagsCount
};