]> git.quilime.com - plog.git/commitdiff
getting tags working.
authorGabriel Dunne <gdunne@quilime.com>
Mon, 3 Sep 2012 23:25:18 +0000 (16:25 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Mon, 3 Sep 2012 23:25:18 +0000 (16:25 -0700)
18 files changed:
content/log/islands
content/log/overlords
content/log/temple
content/log/water_is_life
content/projects/mask
content/projects/prism
data/content/data.json [new file with mode: 0644]
data/content/log/data.json [new file with mode: 0644]
data/content/log/tags.json [new file with mode: 0644]
data/content/projects/data.json [new file with mode: 0644]
data/content/projects/tags.json [new file with mode: 0644]
data/content/tags.json [new file with mode: 0644]
data/tags.json [new file with mode: 0644]
lib/config.ini
lib/data.php
lib/init.php
lib/test/data_test.php
pages/tag [new file with mode: 0644]

index e3fd573e895623fb50fc769074c79e840d662719..93288d17e203f8ddbc45278ba1a78d4f28f9ff14 100644 (file)
@@ -1,5 +1,6 @@
 title = islands
 date = Oct 05 2011, 03:53:55 PM
+tags = writing quote
 --
 
 > Imagine that every man's mind is an island, surrounded by ocean. Each seems isolated, yet in reality all are linked by the bedrock from which they spring. If the ocean were to vanish, that would be the end of the islands. They would all be part of one continent, but their individuality would be gone.
index a8a052c6b8855c2eecb9a12ba617a22f65aeb8c8..e949c3d2c4307ae9ce7ee78829b7cf3f0cb3c9ac 100644 (file)
@@ -1,5 +1,6 @@
 title = childhoods end
 date = Oct 05 2011, 03:17:57 PM
+tags = india quote
 --
 
 > The case of India is particularly instructive. The main difference between us and the British in India was that they had no real motives for going there&mdash;no conscious objectives, that is, except such trivial and temporary ones as trade or hostility to other European powers. They found themselves possessors of an empire before they knew what to do with it, and were never really happy until they had got rid of it again.
index 915bef5ef9d21e971eb3fec28b67731051c99d6c..e56d25a889a89f10d841acc49bf30504744fd0d0 100644 (file)
@@ -1,5 +1,6 @@
 date = feb 20 2012
 title = temple
+tags = photo
 --
 <a href="http://www.flickr.com/photos/quilime/6914577153/sizes/z/in/photostream/">
        <img src="http://farm8.staticflickr.com/7053/6914577153_4c2b7d8a1a_z.jpg">
index 8249c81c059cc1fc1ef3dfb888cbea6b4591e548..b04bcc7a79c2f46e20849d482a5f8e2b2d7052dc 100644 (file)
@@ -1,6 +1,6 @@
 title = Water Is Life
 date = Oct 23 2011 06:04:38 PM
-draft = 1
+tags = water photo
 --
 
 <a href="http://www.flickr.com/photos/quilime/6266458764/sizes/l/in/photostream/"><img src="http://farm7.staticflickr.com/6034/6266458764_6f71bd0a7e_z.jpg"></a>
index d72fb4061dfde5cd98c529f6d5211d4725960bab..5a5a98b3d7dddb4339da40253d76be31d01ac675 100644 (file)
@@ -1,6 +1,7 @@
 title = mask
 date = 2007-07-02
 thumb = http://portfolio.quilime.com/2008/mask/thumb.png
+tags = mask painting
 --
 
 <img src="http://portfolio.quilime.com/2008/mask/mask.jpg" />
index ea834a35c32a4afd6f645e048ce3bd5b7e431c33..ae5806aad763c17bdffd2fef125fb7d603c5e7de 100644 (file)
@@ -1,6 +1,7 @@
 title = prism
 date = 2007-08-23
 thumb = http://portfolio.quilime.com/2008/prism/thumb.png
+tags = prism painting
 --
 
 <img src="http://portfolio.quilime.com/2008/prism/3.jpg" />
diff --git a/data/content/data.json b/data/content/data.json
new file mode 100644 (file)
index 0000000..8ca625c
--- /dev/null
@@ -0,0 +1 @@
+{"entries":[{"config":{"date":"feb 20 2012","title":"temple","tags":"photo"},"title":"temple","filename":"temple","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/temple","fileInfo":{},"timestamp":"1329724800","tags":["photo"],"content":"<p><a href=\"http:\/\/www.flickr.com\/photos\/quilime\/6914577153\/sizes\/z\/in\/photostream\/\">\n    <img src=\"http:\/\/farm8.staticflickr.com\/7053\/6914577153_4c2b7d8a1a_z.jpg\">\n<\/a><\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/temple\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"og","url":"log\/"},"media":"media\/\/og\/temple\/","thumb":"media\/\/og\/temple\/thumb.png","url":"\/og\/temple"},{"config":{"title":"Water Is Life","date":"Oct 23 2011 06:04:38 PM","tags":"water photo"},"title":"Water Is Life","filename":"water_is_life","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/water_is_life","fileInfo":{},"timestamp":"1319418278","tags":["water","photo"],"content":"<p><a href=\"http:\/\/www.flickr.com\/photos\/quilime\/6266458764\/sizes\/l\/in\/photostream\/\"><img src=\"http:\/\/farm7.staticflickr.com\/6034\/6266458764_6f71bd0a7e_z.jpg\"><\/a><\/p>\n\n<p>near Quotar Minar in Dadabari.<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/water_is_life\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"og","url":"log\/"},"media":"media\/\/og\/water_is_life\/","thumb":"media\/\/og\/water_is_life\/thumb.png","url":"\/og\/water_is_life"},{"config":{"title":"islands","date":"Oct 05 2011, 03:53:55 PM","tags":"writing quote"},"title":"islands","filename":"islands","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/islands","fileInfo":{},"timestamp":"1317855235","tags":["writing","quote"],"content":"<blockquote>\n  <p>Imagine that every man's mind is an island, surrounded by ocean. Each seems isolated, yet in reality all are linked by the bedrock from which they spring. If the ocean were to vanish, that would be the end of the islands. They would all be part of one continent, but their individuality would be gone.<\/p>\n  \n  <p>&mdash;\"The Inspector\" Overlord. <u>Childhoods End<\/u>, Arthur C. Clark. p.176<\/p>\n<\/blockquote>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/islands\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"og","url":"log\/"},"media":"media\/\/og\/islands\/","thumb":"media\/\/og\/islands\/thumb.png","url":"\/og\/islands"},{"config":{"title":"childhoods end","date":"Oct 05 2011, 03:17:57 PM","tags":"india quote"},"title":"childhoods end","filename":"overlords","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/overlords","fileInfo":{},"timestamp":"1317853077","tags":["india","quote"],"content":"<blockquote>\n  <p>The case of India is particularly instructive. The main difference between us and the British in India was that they had no real motives for going there&mdash;no conscious objectives, that is, except such trivial and temporary ones as trade or hostility to other European powers. They found themselves possessors of an empire before they knew what to do with it, and were never really happy until they had got rid of it again.<\/p>\n  \n  <p>&mdash;\"The Inspector\" Overlord. <u>Childhoods End<\/u>, Arthur C. Clark. p.161<\/p>\n<\/blockquote>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/overlords\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"og","url":"log\/"},"media":"media\/\/og\/overlords\/","thumb":"media\/\/og\/overlords\/thumb.png","url":"\/og\/overlords"},{"config":{"title":"prism","date":"2007-08-23","thumb":"http:\/\/portfolio.quilime.com\/2008\/prism\/thumb.png","tags":"prism painting"},"title":"prism","filename":"prism","path":"\/Users\/gdunne\/_code\/plog\/content\/projects\/prism","fileInfo":{},"timestamp":"1187852400","tags":["prism","painting"],"content":"<p><img src=\"http:\/\/portfolio.quilime.com\/2008\/prism\/3.jpg\" \/><\/p>\n\n<p>oil on canvas. 4' x 3'<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/projects\/prism\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"rojects","url":"projects\/"},"media":"media\/\/rojects\/prism\/","thumb":"http:\/\/portfolio.quilime.com\/2008\/prism\/thumb.png","url":"\/rojects\/prism"},{"config":{"title":"mask","date":"2007-07-02","thumb":"http:\/\/portfolio.quilime.com\/2008\/mask\/thumb.png","tags":"mask painting"},"title":"mask","filename":"mask","path":"\/Users\/gdunne\/_code\/plog\/content\/projects\/mask","fileInfo":{},"timestamp":"1183359600","tags":["mask","painting"],"content":"<p><img src=\"http:\/\/portfolio.quilime.com\/2008\/mask\/mask.jpg\" \/><\/p>\n\n<p>graphite on plywood. 12\" x 12\"<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/projects\/mask\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"rojects","url":"projects\/"},"media":"media\/\/rojects\/mask\/","thumb":"http:\/\/portfolio.quilime.com\/2008\/mask\/thumb.png","url":"\/rojects\/mask"}]}
\ No newline at end of file
diff --git a/data/content/log/data.json b/data/content/log/data.json
new file mode 100644 (file)
index 0000000..dacb6fe
--- /dev/null
@@ -0,0 +1 @@
+{"entries":[{"config":{"date":"feb 20 2012","title":"temple","tags":"photo"},"title":"temple","filename":"temple","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/temple","fileInfo":{},"timestamp":"1329724800","tags":["photo"],"content":"<p><a href=\"http:\/\/www.flickr.com\/photos\/quilime\/6914577153\/sizes\/z\/in\/photostream\/\">\n    <img src=\"http:\/\/farm8.staticflickr.com\/7053\/6914577153_4c2b7d8a1a_z.jpg\">\n<\/a><\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/temple\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"log","url":"\/log\/"},"media":"media\/\/log\/temple\/","thumb":"media\/\/log\/temple\/thumb.png","url":"\/log\/temple"},{"config":{"title":"Water Is Life","date":"Oct 23 2011 06:04:38 PM","tags":"water photo"},"title":"Water Is Life","filename":"water_is_life","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/water_is_life","fileInfo":{},"timestamp":"1319418278","tags":["water","photo"],"content":"<p><a href=\"http:\/\/www.flickr.com\/photos\/quilime\/6266458764\/sizes\/l\/in\/photostream\/\"><img src=\"http:\/\/farm7.staticflickr.com\/6034\/6266458764_6f71bd0a7e_z.jpg\"><\/a><\/p>\n\n<p>near Quotar Minar in Dadabari.<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/water_is_life\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"log","url":"\/log\/"},"media":"media\/\/log\/water_is_life\/","thumb":"media\/\/log\/water_is_life\/thumb.png","url":"\/log\/water_is_life"},{"config":{"title":"islands","date":"Oct 05 2011, 03:53:55 PM","tags":"writing quote"},"title":"islands","filename":"islands","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/islands","fileInfo":{},"timestamp":"1317855235","tags":["writing","quote"],"content":"<blockquote>\n  <p>Imagine that every man's mind is an island, surrounded by ocean. Each seems isolated, yet in reality all are linked by the bedrock from which they spring. If the ocean were to vanish, that would be the end of the islands. They would all be part of one continent, but their individuality would be gone.<\/p>\n  \n  <p>&mdash;\"The Inspector\" Overlord. <u>Childhoods End<\/u>, Arthur C. Clark. p.176<\/p>\n<\/blockquote>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/islands\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"log","url":"\/log\/"},"media":"media\/\/log\/islands\/","thumb":"media\/\/log\/islands\/thumb.png","url":"\/log\/islands"},{"config":{"title":"childhoods end","date":"Oct 05 2011, 03:17:57 PM","tags":"india quote"},"title":"childhoods end","filename":"overlords","path":"\/Users\/gdunne\/_code\/plog\/content\/log\/overlords","fileInfo":{},"timestamp":"1317853077","tags":["india","quote"],"content":"<blockquote>\n  <p>The case of India is particularly instructive. The main difference between us and the British in India was that they had no real motives for going there&mdash;no conscious objectives, that is, except such trivial and temporary ones as trade or hostility to other European powers. They found themselves possessors of an empire before they knew what to do with it, and were never really happy until they had got rid of it again.<\/p>\n  \n  <p>&mdash;\"The Inspector\" Overlord. <u>Childhoods End<\/u>, Arthur C. Clark. p.161<\/p>\n<\/blockquote>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/log\/overlords\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"log","url":"\/log\/"},"media":"media\/\/log\/overlords\/","thumb":"media\/\/log\/overlords\/thumb.png","url":"\/log\/overlords"}]}
\ No newline at end of file
diff --git a/data/content/log/tags.json b/data/content/log/tags.json
new file mode 100644 (file)
index 0000000..da87f8a
--- /dev/null
@@ -0,0 +1 @@
+{"tags":{"photo":2,"water":1,"writing":1,"quote":2,"india":1}}
\ No newline at end of file
diff --git a/data/content/projects/data.json b/data/content/projects/data.json
new file mode 100644 (file)
index 0000000..acde96c
--- /dev/null
@@ -0,0 +1 @@
+{"entries":[{"config":{"title":"prism","date":"2007-08-23","thumb":"http:\/\/portfolio.quilime.com\/2008\/prism\/thumb.png","tags":"prism painting"},"title":"prism","filename":"prism","path":"\/Users\/gdunne\/_code\/plog\/content\/projects\/prism","fileInfo":{},"timestamp":"1187852400","tags":["prism","painting"],"content":"<p><img src=\"http:\/\/portfolio.quilime.com\/2008\/prism\/3.jpg\" \/><\/p>\n\n<p>oil on canvas. 4' x 3'<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/projects\/prism\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"projects","url":"\/projects\/"},"media":"media\/\/projects\/prism\/","thumb":"http:\/\/portfolio.quilime.com\/2008\/prism\/thumb.png","url":"\/projects\/prism"},{"config":{"title":"mask","date":"2007-07-02","thumb":"http:\/\/portfolio.quilime.com\/2008\/mask\/thumb.png","tags":"mask painting"},"title":"mask","filename":"mask","path":"\/Users\/gdunne\/_code\/plog\/content\/projects\/mask","fileInfo":{},"timestamp":"1183359600","tags":["mask","painting"],"content":"<p><img src=\"http:\/\/portfolio.quilime.com\/2008\/mask\/mask.jpg\" \/><\/p>\n\n<p>graphite on plywood. 12\" x 12\"<\/p>\n","comments_enabled":false,"comments":{"comments":[],"comments_loc":"\/Users\/gdunne\/_code\/plogcomments\/\/Users\/gdunne\/_code\/plog\/content\/projects\/mask\/","fileInfo":{},"_recaptcha_resp":null,"_recaptcha_error":null,"_comment_error":null},"cat":{"name":"projects","url":"\/projects\/"},"media":"media\/\/projects\/mask\/","thumb":"http:\/\/portfolio.quilime.com\/2008\/mask\/thumb.png","url":"\/projects\/mask"}]}
\ No newline at end of file
diff --git a/data/content/projects/tags.json b/data/content/projects/tags.json
new file mode 100644 (file)
index 0000000..7a2a5ff
--- /dev/null
@@ -0,0 +1 @@
+{"tags":{"prism":1,"painting":2,"mask":1}}
\ No newline at end of file
diff --git a/data/content/tags.json b/data/content/tags.json
new file mode 100644 (file)
index 0000000..1d66e51
--- /dev/null
@@ -0,0 +1 @@
+{"tags":{"photo":2,"water":1,"writing":1,"quote":2,"india":1,"prism":1,"painting":2,"mask":1}}
\ No newline at end of file
diff --git a/data/tags.json b/data/tags.json
new file mode 100644 (file)
index 0000000..1d66e51
--- /dev/null
@@ -0,0 +1 @@
+{"tags":{"photo":2,"water":1,"writing":1,"quote":2,"india":1,"prism":1,"painting":2,"mask":1}}
\ No newline at end of file
index 0e5b84af544eb550264f53ea4397565a6c6e77bb..919a806c6d4ad069aeb0a59a172da09db722d7b0 100644 (file)
@@ -19,6 +19,7 @@ media       = media/
 
 config_file = config
 data_file   = data.json
+tags_file   = tags.json
 
 
 
index 87fb90a38223369c9edde3a383e15e6cf833da1c..1888d802d418889edb1986a22352243e490bfe30 100644 (file)
@@ -74,7 +74,7 @@ function get_entries( $path = "", $args = array() )
             fwrite($fp, json_encode(array( 'entries' => $entries )));
             fclose($fp);
             if (!file_exists( $data_file )) {
-                throw new Exception('Error creating tags json. Permissions?');
+                throw new Exception('Error creating data json. Permissions?');
             }
         }
     }
@@ -146,6 +146,58 @@ function get_pages()
 }
 
 
+/**
+ * get tags
+ */
+function get_tags($path = "", $args = array() )
+{
+
+    $data_path  = rtrim(LOCAL_ROOT . '/' . DATA_DIR . '/' . CONTENT_DIR . '/' . $path, '/');
+    $data_file  = rtrim($data_path . '/' . TAGS_FILE, '/');
+
+    if (DEV || !file_exists($data_file)) {
+
+        $create_datafile = true;
+
+        $entries = get_entries($path, $args);
+        $tags = array();
+
+        foreach($entries as $entry) {
+            $entry_tags = isset($entry->tags) && is_array($entry->tags) ? $entry->tags : array();
+            $tags = array_merge($tags, $entry_tags);
+        }
+
+        $tags = array_count_values($tags);
+
+
+        if ($create_datafile) {
+            if (!is_dir($data_path)) {
+                if (!mkdir($data_path, 0777, true)) {
+                    throw new Exception('Error making data folder in get_tags(). Permissions?');
+                }
+            }
+            $fp = fopen( $data_file, 'w');
+            fwrite($fp, json_encode(array( 'tags' => $tags )));
+            fclose($fp);
+            if (!file_exists( $data_file )) {
+                throw new Exception('Error creating tags json in get_tags(). Permissions?');
+            }
+        }        
+
+
+        // $fp = fopen( $data_file, 'w');
+        // fwrite($fp, json_encode(array( 'tags' => $tags )));
+        // fclose($fp);
+        // if (!file_exists( $data_file)) {
+        //     throw new Exception('Error creating tags.json. Permissions?');
+        // }
+    }
+
+    $json = json_decode(file_get_contents($data_file));
+    return (array) $json->tags;
+}
+
+
 /**
  * @param splFileInfo SPLFileInfo Object
  * @param page default is false
index 7533d5627a2604f17647890ace95e8ec640a6f70..74f228fedccce2ea058eea125aae52db2adbc14a 100644 (file)
@@ -36,6 +36,7 @@ define ('COMMENTS_DIR', $_cfg['comments']);
 define ('DATA_DIR', $_cfg['data']);
 define ('MEDIA_DIR', $_cfg['media']);
 define ('DATA_FILE', $_cfg['data_file']);
+define ('TAGS_FILE', $_cfg['tags_file']);
 define ('TEMPLATE_DIR', $_cfg['templates']);
 define ('PAGE_DIR', $_cfg['pages']);
 define ('CONFIG_DELIMITER', $_cfg['config_delim']);
index 5053ee61c30dea8a8b3fca483420f808f7d93ebf..9bc1b004c9ada34a3b71abb4c6edc99838dc3f08 100644 (file)
@@ -5,9 +5,6 @@ class DataTest extends UnitTestCase {
     function test_GettingEntriesArray() {
         $entries = get_entries('/');
         $this->assertTrue(is_array($entries));
-    }
-
-    function test_EntryFolderNotExist() {
         $this->expectException( new Exception("Directory does not exist") );
         get_entries('sdfs');
     }
@@ -22,6 +19,17 @@ class DataTest extends UnitTestCase {
         $this->assertTrue(is_array($dirs));
     }    
 
+    function test_GettingTagsArray() {
+        $tags = get_tags();
+        $this->assertTrue(is_array($tags));
+        $tags = get_tags('log/');
+        $this->assertTrue(is_array($tags));
+        $tags = get_tags('projects/');
+        $this->assertTrue(is_array($tags));
+        $this->expectException( new Exception("Directory does not exist") );
+        $tags = get_tags('asdf/');
+    }
+
     function test_getEntryIsFileObj() {
         $this->assertIsA(get_entry('/projects/prism'), 'stdClass');
     }
diff --git a/pages/tag b/pages/tag
new file mode 100644 (file)
index 0000000..ef0c764
--- /dev/null
+++ b/pages/tag
@@ -0,0 +1,30 @@
+title = tag
+--
+
+<? if (isset($tag)): ?>
+
+<? $entries = get_entries('/', $args = array('tag' => $tag)); ?>
+<? foreach($entries as $entry): ?>
+<?
+if (isset($entry->content_short))
+$entry->content = $entry->content_short .
+'<br /><a class="more" href="' . $entry->url . '">more &rarr;</a><br /><br />';
+?>
+
+<div class="entry">
+<? $this->include_template('entry.html.tpl', array('entry' => $entry)); ?>
+</div>
+
+<? endforeach; ?>
+
+<? else: ?>
+
+
+<ul class="tags">
+<? $tags = get_tags('/'); ksort($tags); ?>
+<? foreach($tags as $tag => $count) : ?>
+<li><a href="/tag/<?=$tag?>"><?=$tag?></a> &times; <?=$count?></li>
+<? endforeach; ?>
+</ul>
+
+<? endif; ?>