⌈⌋ branch:  freshcode


Check-in [e0cdb1b5c1]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:e0cdb1b5c1b997adcfa841374e3ab3e7ebb3c9ed
Date: 2014-11-22 21:30:21
User: mario
Comment:Omit tags with just one reference from tag"cloud"; scale text down a bit.
Tags And Properties
  • branch=trunk inherited from [82405bb421]
  • sym-trunk inherited from [82405bb421]
Context
2014-11-22
21:31
[a19ff10c97] Decode sourceforge URLs to skip %20 for version extraction, also try to capture -beta and -rc suffixes. (user: mario, tags: trunk)
21:30
[e0cdb1b5c1] Omit tags with just one reference from tag"cloud"; scale text down a bit. (user: mario, tags: trunk)
21:29
[e86d921713] Rename QPL to QtPL (user: mario, tags: trunk)
Changes

Changes to page_tags.php.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</div>
</aside><?php



#-- print tag cloud
?>
<section id=main>
<h2>Tags</h2>
<p id=tag_cloud>
<?php

// Query `tags` table to generate a cloud
$tags = db("SELECT COUNT(name) AS cnt, tag FROM tags GROUP BY tag")->fetchAll();
$count = array_column($tags, "cnt");
if ($count) {
    $avg = count($count) / array_sum($count);

    // Print tag cloud
    foreach ($tags as $t) {



        // average
        $n = 
        $q = 1.0*$t["cnt"] / 1.0*$avg;
        
        /**
         * Qantify
         * - Values 0.1 - 20.0 are transitioned into the range 0.3 - 2.0
         */
        $q = atan($q * 0.75 + 0.1) * 1.55;
        
        // font size
        $q = sprintf("%.1f", $q * 100);

        // output
        print " <a href=\"/search?tag=" . urlencode($t["tag"])
            . "\" class=tag style=\"font-size: $q%;\"> $t[tag]</a> ";







|












>
>









|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</div>
</aside><?php



#-- print tag cloud
?>
<section id=main style="min-height: 1750pt">
<h2>Tags</h2>
<p id=tag_cloud>
<?php

// Query `tags` table to generate a cloud
$tags = db("SELECT COUNT(name) AS cnt, tag FROM tags GROUP BY tag")->fetchAll();
$count = array_column($tags, "cnt");
if ($count) {
    $avg = count($count) / array_sum($count);

    // Print tag cloud
    foreach ($tags as $t) {
    
        if ($t["cnt"] < 2) continue;

        // average
        $n = 
        $q = 1.0*$t["cnt"] / 1.0*$avg;
        
        /**
         * Qantify
         * - Values 0.1 - 20.0 are transitioned into the range 0.3 - 2.0
         */
        $q = atan($q * 0.55 - 0.1) * 1.35;
        
        // font size
        $q = sprintf("%.1f", $q * 100);

        // output
        print " <a href=\"/search?tag=" . urlencode($t["tag"])
            . "\" class=tag style=\"font-size: $q%;\"> $t[tag]</a> ";