keywords with large spreads keywords with large spreads
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

keywords with large spreads

Started by E. William, December 17, 2013, 09:37:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

E. William

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:
    $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:
    $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]);

Αndré

Looks good. I consider to add this to cpg1.5.26.

Αndré

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.