keywords with large spreads keywords with large spreads
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

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.