Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: keywords with large spreads  (Read 3993 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.032 seconds with 19 queries.