forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: E. William on December 17, 2013, 09:37:48 am

Title: keywords with large spreads
Post by: E. William on December 17, 2013, 09:37:48 am
I've made a small alteration to the keywords.inc.php which sizes the cloud according to a curve, rather than linear.

I found that a linear spread made a few keywords stand out, while most would be printed in the smallest sizes. Applying a curve gave me a better looking cloud. Compare the screenshots to get an idea of the difference.

So I replaced:
Code: [Select]
    $step = ((25 - 10) / $spread);

    // Result to table
    echo '<tr><td class="tableb">';
    for ($i = 0; $i < $count; $i++) {
        if ($keywords_array[$i]) { // Eliminates Null Keywords

            $fontSize = (10 + ($keyword_count[$keywords_array[$i]] - $minQuantity) * $step);
            $keyword_param = urlencode($keywords_array[$i]);

With:
Code: [Select]
    $step = (25 - 10) / sqrt($spread);

    // Result to table
    echo '<tr><td class="tableb">';
    for ($i = 0; $i < $count; $i++) {
        if ($keywords_array[$i]) { // Eliminates Null Keywords

            $fontSize = (10 + sqrt($keyword_count[$keywords_array[$i]] - $minQuantity) * $step);
            $keyword_param = urlencode($keywords_array[$i]);
Title: Re: keywords with large spreads
Post by: Αndré on December 17, 2013, 10:31:39 am
Looks good. I consider to add this to cpg1.5.26.
Title: Re: keywords with large spreads
Post by: Αndré on January 29, 2014, 11:05:59 am
I decided to not add this to cpg1.5.x, as some people maybe don't like the change. Instead, I added it to cpg1.6.x in SVN revision 8665, with a small addition using the round function to get whole number as font size.