Advanced search  

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]

Pages: [1]   Go Down

Author Topic: keywords with large spreads  (Read 3990 times)

0 Members and 1 Guest are viewing this topic.

E. William

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
keywords with large spreads
« 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]);
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: keywords with large spreads
« Reply #1 on: December 17, 2013, 10:31:39 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: keywords with large spreads
« Reply #2 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.