⌈⌋ ⎇ branch:  freshcode


Check-in [e0cdb1b5c1]

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

Overview
Comment:Omit tags with just one reference from tag"cloud"; scale text down a bit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0cdb1b5c1b997adcfa841374e3ab3e7ebb3c9ed
User & Date: mario 2014-11-22 21:30:21
Context
2014-11-22
21:31
Decode sourceforge URLs to skip %20 for version extraction, also try to capture -beta and -rc suffixes. check-in: a19ff10c97 user: mario tags: trunk
21:30
Omit tags with just one reference from tag"cloud"; scale text down a bit. check-in: e0cdb1b5c1 user: mario tags: trunk
21:29
Rename QPL to QtPL check-in: e86d921713 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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> ";