How are the font sizes assigned in the Tag Cloud. Is there a threshold number of tags which assigns a tag to the largest font size.
Due to the size of my gallery, and the amount of images with the same tag, I seem to have a lot of tags getting assigned to the largest font size.
Is there a way to modify the code raising the the threshold, that triggers the largest font size?
Comments
There are parameters to the function for the the minimum and maximum sizes. The font size is based on ratios of those items.
Also, I see how the minimum & max are set, but what determines when a tag graduates from the small size to the medium size font. I am seeing 3 font sizes. Is this calculated in the ratio, so I don't have control of the floor count for the medium size font?
I also see there is an unanswered post similar to mine from 4 years ago:
http://www.zenphoto.org/support/topic.php?id=4199#post-25033
`$size = min(max(round(($size_max*($count-$count_min))/($count_max-$count_min),2), $size_min),$size_max);`
I am editing /zp-extensions/tag_extras.php
* @param integere $size_min smallest font size the cloud should display
* @param integer $size_max largest font size the cloud should display
* @param integer $count_min the minimum count for a tag to appear in the output
* @param integer $count_max the floor count for setting the cloud font size to $size_max
Something is not allowing the changes to take effect. So what are the parameters for if they change nothing?
Tags are showing without "tag_extras.php" even being present on the server. I don't get that.
If I disable/enable "show tags" in theme, tags do turn off and on.
Also, to my knowledge no official theme has an option to disable tags. So you probably are using a third party one.
But changing any of the parameters listed below has no effect on the cloud. Can you look at that code and see if there might be a reason why parameters are not being checked?
`
**
* 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, "abc" for alphabetical, blank for unsorted
* @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
* @since 1.1
*/
function printAllTagsAs($option,$class='',$sort='abc',$counter=FALSE,$links=TRUE,$maxfontsize=2,$maxcount=50,$mincount=10, $limit=NULL,$minfontsize=0.8)
`
Sorry for the all questions zpArdoise really needs to provide a little more support for his theme. I have not seen him offer support once since I have asked questions with zpArdoise mentioned.
If you change the parameters on the template-functions natrually the call on the theme overrides that. So you will not see any change. Did you read the theming tutorial?
Since you didn't tell what theme you are using it very well might be that it uses something custom for the tag cloud.
`
<?php if (getOption('show_tag')) { ?>
<?php printAllTagsAs('cloud', 'hor-list','abc', false, true, 2.5, 40, 10, NULL, 1); ?>
`
indeed, if zpardoise is not in the title of the message, I can simply miss the subject (I do not read all the forum posts).
you can also ask me for support on my website.
notice that I do my best to develop my theme for free on my free time and I am not sure that all 3rd party themes offer the same thing...
I use `printAllTagsAs` in gallery.php :
`<?php printAllTagsAs('cloud', 'hor-list', 'abc', false, true, 2.5, 30, 5, NULL, 1); ?>`
you should modify the parameters of the function in gallery.php, like that for example :
`<?php printAllTagsAs('cloud', 'hor-list', 'abc', false, true, 2.5, 500, 5, NULL, 1); ?>`
Anyone know why when I leave the sort "blank", I do not get a randomly sorted cloud? I tried with Garland also & coud not get a random sort as stated in paremeter details:
`* @param string $sort "results" for relevance list, "abc" for alphabetical, blank for unsorted`
Like this:
`<?php printAllTagsAs('cloud', 'hor-list', '', false, true, 2.5, 500, 5, NULL, 1); ?>`
all other values (null, "abc", '', "anything",...) causes an alphabetical order.
there is no option for tag random order (but maybe it would be a nice option).
@ zenphoto team :
the documentation of printAllTagsAs il not really the truth :
`"results" for relevance list, "abc" for alphabetical, blank for unsorted`, and I don't really understand what "unsorted" means in our case.
Just out of curiosity, I googled word cloud images & couldn't find any that were sorted alphabetically.
Interestingly the tags_extras plugin which was modeled after this does not even have a sort parameter.
`$sql = "SELECT DISTINCT tags.name, tags.id, (SELECT COUNT(*) FROM ".prefix('obj_to_tag')." as object WHERE object.tagid = tags.id) AS count FROM ".prefix('tags')." as tags ORDER BY 'name'" ;`
so, in `printAllTagsAs`, in all case but `$sort="results"`, tags are by alphabetical order.