`printTags()` didn't quite do it for me, thanks though.
Here's my first stab at it, any improvements or feedback welcome. Chunks of this are obviously lifted straight from zp-core/*.php.
TODO: Make the magic numbers options in the theme (or arguments to the function if you guys want to use this).
`
function FlickrishPrintAlbumTagCloud( ) {
$sql = "SELECT t.tagid, tags.name, COUNT(*) AS count FROM ".
prefix('obj_to_tag').
" AS t LEFT JOIN (".
prefix('images'). "AS i, ".
prefix('tags'). "AS tags)".
" ON (t.objectid = i.id AND tags.id= t.tagid)".
" WHERE t.type = 'images'".
" AND i.albumid=".getAlbumId().
" GROUP BY t.tagid";
#echo $sql;
$tags = query_full_array($sql);
if (!is_array($tags)) {
return;
}
$size_min = 0.8; // ALLTAGS_MINFONTSIZE TODO: make param of theme
$size_max = 3.0;
$count_min = 1;
$count_max = 200;
foreach ($tags as $row) {
$count = $row['count'];
$tid = $row['tagid'];
$tname = $row['name'];
// TODO: use distribution instead of linear fn
$size = min(max(round(($size_max*($count-$count_min))/($count_max-$count_min),
2), $size_min)
,$size_max);
$size = str_replace(',','.', $size);
# TODO: specifying the album doesn't work for some reason.
#htmlspecialchars(getSearchURL($tname, '', 'tags', 0, array(getAlbumId()))).
echo "<a class=\"tagLink\" href=\"".
htmlspecialchars(getSearchURL($tname, '', 'tags',"")).'"'.
" style=\"font-size:".$size."em; rel=\"nofollow\">".
"$tname</a>\n";
}
}
`
Then in album.php :
`
<?php FlickrishPrintAlbumTagCloud()?>
`
And in theme.css :
`
div.albumTags A {
margin-left: 5px;
margin-right: 5px;
white-space: nowrap;
}
`